Merge git://factorcode.org/git/factor
						commit
						b71e07affe
					
				| 
						 | 
				
			
			@ -173,8 +173,8 @@ USE: cpu.x86.intrinsics
 | 
			
		|||
T{ x86-backend f 8 } compiler-backend set-global
 | 
			
		||||
 | 
			
		||||
! The ABI for passing structs by value is pretty messed up
 | 
			
		||||
"void*" c-type clone "__stack_value" define-primitive-type
 | 
			
		||||
T{ stack-params } "__stack_value" c-type set-c-type-reg-class
 | 
			
		||||
<< "void*" c-type clone "__stack_value" define-primitive-type
 | 
			
		||||
T{ stack-params } "__stack_value" c-type set-c-type-reg-class >>
 | 
			
		||||
 | 
			
		||||
: struct-types&offset ( struct-type -- pairs )
 | 
			
		||||
    struct-type-fields [
 | 
			
		||||
| 
						 | 
				
			
			@ -200,5 +200,3 @@ M: struct-type flatten-value-type ( type -- seq )
 | 
			
		|||
            "void*" "double" ? c-type ,
 | 
			
		||||
        ] each
 | 
			
		||||
    ] if ;
 | 
			
		||||
 | 
			
		||||
12 profiler-prologue set-global
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
! Copyright (C) 2005, 2006 Slava Pestov.
 | 
			
		||||
! Copyright (C) 2005, 2008 Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: alien arrays cpu.x86.assembler cpu.x86.allot
 | 
			
		||||
cpu.x86.architecture cpu.architecture kernel kernel.private math
 | 
			
		||||
| 
						 | 
				
			
			@ -240,33 +240,18 @@ IN: cpu.x86.intrinsics
 | 
			
		|||
    }
 | 
			
		||||
} define-intrinsics
 | 
			
		||||
 | 
			
		||||
\ fixnum-shift-fast {
 | 
			
		||||
    {
 | 
			
		||||
        [
 | 
			
		||||
            "y" operand NEG
 | 
			
		||||
            "y" operand %untag-fixnum
 | 
			
		||||
            "x" operand "y" operand SAR
 | 
			
		||||
            ! Mask off low bits
 | 
			
		||||
            "x" operand %untag
 | 
			
		||||
        ] H{
 | 
			
		||||
            { +input+ { { f "x" } { f "y" } } }
 | 
			
		||||
            { +output+ { "x" } }
 | 
			
		||||
            { +clobber+ { "y" } }
 | 
			
		||||
        }
 | 
			
		||||
    } {
 | 
			
		||||
        [
 | 
			
		||||
            "x" operand "y" get neg SAR
 | 
			
		||||
: %untag-fixnums ( seq -- )
 | 
			
		||||
    [ %untag-fixnum ] unique-operands ;
 | 
			
		||||
 | 
			
		||||
\ fixnum-shift-fast [
 | 
			
		||||
    "x" operand "y" get
 | 
			
		||||
    dup 0 < [ neg SAR ] [ SHL ] if
 | 
			
		||||
    ! Mask off low bits
 | 
			
		||||
    "x" operand %untag
 | 
			
		||||
] H{
 | 
			
		||||
    { +input+ { { f "x" } { [ ] "y" } } }
 | 
			
		||||
    { +output+ { "x" } }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
} define-intrinsics
 | 
			
		||||
 | 
			
		||||
: %untag-fixnums ( seq -- )
 | 
			
		||||
    [ %untag-fixnum ] unique-operands ;
 | 
			
		||||
} define-intrinsic
 | 
			
		||||
 | 
			
		||||
: overflow-check ( word -- )
 | 
			
		||||
    "end" define-label
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue