cpu/ppc cleanup
parent
894a657056
commit
2c39beaec5
|
@ -325,9 +325,7 @@ M: ppc-backend %unbox-f ( dst src -- )
|
||||||
drop 0 swap v>operand LI ;
|
drop 0 swap v>operand LI ;
|
||||||
|
|
||||||
M: ppc-backend %unbox-any-c-ptr ( dst src -- )
|
M: ppc-backend %unbox-any-c-ptr ( dst src -- )
|
||||||
"is-f" define-label
|
{ "is-f" "is-alien" "end" } [ define-label ] each
|
||||||
"is-alien" define-label
|
|
||||||
"end" define-label
|
|
||||||
0 over v>operand f v>operand CMPI
|
0 over v>operand f v>operand CMPI
|
||||||
"is-f" get BEQ
|
"is-f" get BEQ
|
||||||
12 over v>operand header-offset LWZ
|
12 over v>operand header-offset LWZ
|
||||||
|
|
|
@ -601,12 +601,7 @@ IN: cpu.ppc.intrinsics
|
||||||
} define-intrinsic
|
} define-intrinsic
|
||||||
|
|
||||||
! Alien intrinsics
|
! Alien intrinsics
|
||||||
: %alien-get ( quot -- )
|
: %alien-accessor ( quot -- )
|
||||||
"offset" operand dup %untag-fixnum
|
|
||||||
"offset" operand dup "alien" operand ADD
|
|
||||||
"output" operand "offset" operand 0 roll call ; inline
|
|
||||||
|
|
||||||
: %alien-set ( quot -- )
|
|
||||||
"offset" operand dup %untag-fixnum
|
"offset" operand dup %untag-fixnum
|
||||||
"offset" operand dup "alien" operand ADD
|
"offset" operand dup "alien" operand ADD
|
||||||
"value" operand "offset" operand 0 roll call ; inline
|
"value" operand "offset" operand 0 roll call ; inline
|
||||||
|
@ -617,13 +612,13 @@ IN: cpu.ppc.intrinsics
|
||||||
{ unboxed-c-ptr "alien" simple-c-ptr }
|
{ unboxed-c-ptr "alien" simple-c-ptr }
|
||||||
{ f "offset" fixnum }
|
{ f "offset" fixnum }
|
||||||
} }
|
} }
|
||||||
{ +scratch+ { { f "output" } { f "address" } } }
|
{ +scratch+ { { f "value" } { f "address" } } }
|
||||||
{ +output+ { "output" } }
|
{ +output+ { "value" } }
|
||||||
{ +clobber+ { "offset" } }
|
{ +clobber+ { "offset" } }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
: %alien-integer-get ( quot -- )
|
: %alien-integer-get ( quot -- )
|
||||||
%alien-get
|
%alien-accessor
|
||||||
"output" operand dup %tag-fixnum ; inline
|
"output" operand dup %tag-fixnum ; inline
|
||||||
|
|
||||||
: alien-integer-set-template
|
: alien-integer-set-template
|
||||||
|
@ -641,7 +636,7 @@ IN: cpu.ppc.intrinsics
|
||||||
"offset" get "value" get = [
|
"offset" get "value" get = [
|
||||||
"value" operand dup %untag-fixnum
|
"value" operand dup %untag-fixnum
|
||||||
] unless
|
] unless
|
||||||
%alien-set ; inline
|
%alien-accessor ; inline
|
||||||
|
|
||||||
: define-alien-integer-intrinsics ( word get-quot word set-quot -- )
|
: define-alien-integer-intrinsics ( word get-quot word set-quot -- )
|
||||||
[ %alien-integer-set ] curry
|
[ %alien-integer-set ] curry
|
||||||
|
@ -668,7 +663,7 @@ define-alien-integer-intrinsics
|
||||||
define-alien-integer-intrinsics
|
define-alien-integer-intrinsics
|
||||||
|
|
||||||
\ alien-cell [
|
\ alien-cell [
|
||||||
[ LWZ ] %alien-get
|
[ LWZ ] %alien-accessor
|
||||||
] H{
|
] H{
|
||||||
{ +input+ {
|
{ +input+ {
|
||||||
{ unboxed-c-ptr "alien" simple-c-ptr }
|
{ unboxed-c-ptr "alien" simple-c-ptr }
|
||||||
|
@ -680,7 +675,7 @@ define-alien-integer-intrinsics
|
||||||
} define-intrinsic
|
} define-intrinsic
|
||||||
|
|
||||||
\ set-alien-cell [
|
\ set-alien-cell [
|
||||||
[ STW ] %alien-set
|
[ STW ] %alien-accessor
|
||||||
] H{
|
] H{
|
||||||
{ +input+ {
|
{ +input+ {
|
||||||
{ unboxed-c-ptr "value" simple-c-ptr }
|
{ 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 -- )
|
: define-alien-float-intrinsics ( word get-quot word set-quot -- )
|
||||||
[ %alien-set ] curry
|
[ %alien-accessor ] curry
|
||||||
alien-float-set-template
|
alien-float-set-template
|
||||||
define-intrinsic
|
define-intrinsic
|
||||||
[ %alien-get ] curry
|
[ %alien-accessor ] curry
|
||||||
alien-float-get-template
|
alien-float-get-template
|
||||||
define-intrinsic ;
|
define-intrinsic ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue