cpu/ppc cleanup

release
Slava Pestov 2007-09-29 19:56:27 -04:00
parent 894a657056
commit 2c39beaec5
2 changed files with 10 additions and 17 deletions

View File

@ -325,9 +325,7 @@ M: ppc-backend %unbox-f ( dst src -- )
drop 0 swap v>operand LI ;
M: ppc-backend %unbox-any-c-ptr ( dst src -- )
"is-f" define-label
"is-alien" define-label
"end" define-label
{ "is-f" "is-alien" "end" } [ define-label ] each
0 over v>operand f v>operand CMPI
"is-f" get BEQ
12 over v>operand header-offset LWZ

View File

@ -601,12 +601,7 @@ IN: cpu.ppc.intrinsics
} define-intrinsic
! Alien intrinsics
: %alien-get ( quot -- )
"offset" operand dup %untag-fixnum
"offset" operand dup "alien" operand ADD
"output" operand "offset" operand 0 roll call ; inline
: %alien-set ( quot -- )
: %alien-accessor ( quot -- )
"offset" operand dup %untag-fixnum
"offset" operand dup "alien" operand ADD
"value" operand "offset" operand 0 roll call ; inline
@ -617,13 +612,13 @@ IN: cpu.ppc.intrinsics
{ unboxed-c-ptr "alien" simple-c-ptr }
{ f "offset" fixnum }
} }
{ +scratch+ { { f "output" } { f "address" } } }
{ +output+ { "output" } }
{ +scratch+ { { f "value" } { f "address" } } }
{ +output+ { "value" } }
{ +clobber+ { "offset" } }
} ;
: %alien-integer-get ( quot -- )
%alien-get
%alien-accessor
"output" operand dup %tag-fixnum ; inline
: alien-integer-set-template
@ -641,7 +636,7 @@ IN: cpu.ppc.intrinsics
"offset" get "value" get = [
"value" operand dup %untag-fixnum
] unless
%alien-set ; inline
%alien-accessor ; inline
: define-alien-integer-intrinsics ( word get-quot word set-quot -- )
[ %alien-integer-set ] curry
@ -668,7 +663,7 @@ define-alien-integer-intrinsics
define-alien-integer-intrinsics
\ alien-cell [
[ LWZ ] %alien-get
[ LWZ ] %alien-accessor
] H{
{ +input+ {
{ unboxed-c-ptr "alien" simple-c-ptr }
@ -680,7 +675,7 @@ define-alien-integer-intrinsics
} define-intrinsic
\ set-alien-cell [
[ STW ] %alien-set
[ STW ] %alien-accessor
] H{
{ +input+ {
{ unboxed-c-ptr "value" simple-c-ptr }
@ -712,10 +707,10 @@ define-alien-integer-intrinsics
} ;
: define-alien-float-intrinsics ( word get-quot word set-quot -- )
[ %alien-set ] curry
[ %alien-accessor ] curry
alien-float-set-template
define-intrinsic
[ %alien-get ] curry
[ %alien-accessor ] curry
alien-float-get-template
define-intrinsic ;