Merge git://factorcode.org/git/factor
						commit
						aa08a1f5f6
					
				| 
						 | 
				
			
			@ -17,7 +17,7 @@ IN: bootstrap.compiler
 | 
			
		|||
"cpu." cpu append require
 | 
			
		||||
 | 
			
		||||
nl
 | 
			
		||||
"Compiling some words to speed up bootstrap..." write
 | 
			
		||||
"Compiling some words to speed up bootstrap..." write flush
 | 
			
		||||
 | 
			
		||||
! Compile a set of words ahead of the full compile.
 | 
			
		||||
! This set of words was determined semi-empirically
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -450,6 +450,14 @@ cell 8 = [
 | 
			
		|||
    16 -3 [ fixnum-shift-fast ] compile-call
 | 
			
		||||
] unit-test
 | 
			
		||||
 | 
			
		||||
[ 2 ] [
 | 
			
		||||
    16 [ -3 fixnum-shift-fast ] compile-call
 | 
			
		||||
] unit-test
 | 
			
		||||
 | 
			
		||||
[ 8 ] [
 | 
			
		||||
    1 3 [ fixnum-shift-fast ] compile-call
 | 
			
		||||
] unit-test
 | 
			
		||||
 | 
			
		||||
[ 8 ] [
 | 
			
		||||
    1 [ 3 fixnum-shift-fast ] compile-call
 | 
			
		||||
] unit-test
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -172,7 +172,8 @@ IN: cpu.ppc.intrinsics
 | 
			
		|||
\ fixnum-shift-fast {
 | 
			
		||||
    {
 | 
			
		||||
        [
 | 
			
		||||
            "out" operand "x" operand "y" get neg SRAWI
 | 
			
		||||
            "out" operand "x" operand "y" get
 | 
			
		||||
            dup 0 < [ neg SRAWI ] [ swapd SLWI ] if
 | 
			
		||||
            ! Mask off low bits
 | 
			
		||||
            "out" operand dup %untag
 | 
			
		||||
        ] H{
 | 
			
		||||
| 
						 | 
				
			
			@ -199,6 +200,7 @@ IN: cpu.ppc.intrinsics
 | 
			
		|||
            { +input+ { { f "x" } { f "y" } } }
 | 
			
		||||
            { +scratch+ { { f "out" } } }
 | 
			
		||||
            { +output+ { "out" } }
 | 
			
		||||
            { +clobber+ { "x" "y" } }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
} define-intrinsics
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -120,7 +120,7 @@ HELP: fixnum-shift ( x y -- z )
 | 
			
		|||
{ $description "Primitive version of " { $link shift } ". The result may overflow to a bignum." }
 | 
			
		||||
{ $warning "This word does not perform type checking, and passing objects of the wrong type can crash the runtime. User code should call the generic word " { $link shift } " instead." } ;
 | 
			
		||||
 | 
			
		||||
HELP: fixnum-shift-shift ( x y -- z )
 | 
			
		||||
HELP: fixnum-shift-fast ( x y -- z )
 | 
			
		||||
{ $values { "x" fixnum } { "y" fixnum } { "z" fixnum } }
 | 
			
		||||
{ $description "Primitive version of " { $link shift } ". Unlike " { $link fixnum-shift } ", does not perform an overflow check, so the result may be incorrect." }
 | 
			
		||||
{ $warning "This word does not perform type checking, and passing objects of the wrong type can crash the runtime. User code should call the generic word " { $link shift } " instead." } ;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue