: ds-reg 14 ; inline
: rs-reg 15 ; inline
-: reserved-area-size
+: reserved-area-size ( -- n )
os {
{ linux [ 2 ] }
{ macosx [ 6 ] }
} case cells ; foldable
-: lr-save
+: lr-save ( -- n )
os {
{ linux [ 1 ] }
{ macosx [ 2 ] }
: param@ ( n -- x ) reserved-area-size + ; inline
-: param-save-size 8 cells ; foldable
+: param-save-size ( -- n ) 8 cells ; foldable
: local@ ( n -- x )
reserved-area-size param-save-size + + ; inline
-: factor-area-size 2 cells ;
+: factor-area-size ( -- n ) 2 cells ; foldable
: next-save ( n -- i ) cell - ;
1 1 rot ADDI
0 MTLR ;
-: (%call) 11 MTLR BLRL ;
+: (%call) ( -- ) 11 MTLR BLRL ;
-: (%jump) 11 MTCTR BCTR ;
+: (%jump) ( -- ) 11 MTCTR BCTR ;
: %load-dlsym ( symbol dll register -- )
0 swap LOAD32 rc-absolute-ppc-2/2 rel-dlsym ;
4 1 rot cell + local@ LWZ
] when* r> f %alien-invoke ;
-: temp@ stack-frame* factor-area-size - swap - ;
+: temp@ ( m -- n ) stack-frame* factor-area-size - swap - ;
: struct-return@ ( size n -- n ) [ local@ ] [ temp@ ] ?if ;
compiler.constants ;
IN: cpu.ppc.intrinsics
-: %slot-literal-known-tag
+: %slot-literal-known-tag ( -- out value offset )
"val" operand
"obj" operand
"n" get cells
"obj" get operand-tag - ;
-: %slot-literal-any-tag
+: %slot-literal-any-tag ( -- out value offset )
"obj" operand "scratch1" operand %untag
"val" operand "scratch1" operand "n" get cells ;
-: %slot-any
+: %slot-any ( -- out value offset )
"obj" operand "scratch1" operand %untag
"offset" operand "n" operand 1 SRAWI
"scratch1" operand "val" operand "offset" operand ;
}
} define-intrinsics
-: generate-fixnum-mod
+: generate-fixnum-mod ( -- )
#! PowerPC doesn't have a MOD instruction; so we compute
#! x-(x/y)*y. Puts the result in "s" operand.
"s" operand "r" operand "y" operand MULLW
\ fixnum+ \ ADD \ ADDO. overflow-template
\ fixnum- \ SUBF \ SUBFO. overflow-template
-: generate-fixnum/i
+: generate-fixnum/i ( -- )
#! This VOP is funny. If there is an overflow, it falls
#! through to the end, and the result is in "x" operand.
#! Otherwise it jumps to the "no-overflow" label and the