PowerPC float>fixnum intrinsic

darcs
slava 2006-11-17 02:04:37 +00:00
parent f5b6bbdd73
commit 57f4d59b8c
5 changed files with 14 additions and 8 deletions

View File

@ -1,7 +1,6 @@
+ 0.87:
- claim: if module fails to load, reloading it doesn't work?
- intrinsic fixnum>float float>fixnum
- fix search unit test
- these things are "Too Slow":

View File

@ -19,10 +19,6 @@ memory namespaces sequences words ;
: stack@ macosx? 24 8 ? + ;
: lr@ macosx? 8 4 ? + ;
! Frames are 16-byte aligned, minimum size is 32 bytes
! Grows down
! - lr@: return address
M: int-regs return-reg drop 3 ;
M: int-regs fastcall-regs drop { 3 4 5 6 7 8 9 10 } ;
M: int-regs vregs drop { 3 4 5 6 7 8 9 10 } ;
@ -31,7 +27,6 @@ M: float-regs return-reg drop 1 ;
M: float-regs fastcall-regs drop { 1 2 3 4 5 6 7 8 } ;
M: float-regs vregs drop { 0 1 2 3 4 5 6 7 8 9 10 11 12 13 } ;
GENERIC: loc>operand ( loc -- reg n )
M: ds-loc loc>operand ds-loc-n cells neg 14 swap ;

View File

@ -206,7 +206,7 @@ M: label BC >r 0 BC r> rel-relative-2 rel-label ;
: (FMR) >r 0 -rot 72 r> x-form 63 insn ;
: FMR 0 (FMR) ; : FMR. 1 (FMR) ;
: (FCTIWZ) >r 0 -rot 15 r> x-form 63 insn ;
: (FCTIWZ) >r 0 -rot r> 15 x-form 63 insn ;
: FCTIWZ 0 (FCTIWZ) ; : FCTIWZ. 1 (FCTIWZ) ;
: (FADD) >r 0 21 r> a-form 63 insn ;

View File

@ -292,6 +292,17 @@ math-internals namespaces sequences words ;
first2 define-float-jump
] each
\ float>fixnum [
"scratch" operand "in" operand FCTIWZ
"scratch" operand 1 0 stack@ STFD
"out" operand 1 cell stack@ LWZ
"out" operand dup %tag-fixnum
] H{
{ +input+ { { float "in" } } }
{ +scratch+ { { float "scratch" } { f "out" } } }
{ +output+ { "out" } }
} define-intrinsic
\ tag [
"in" operand "out" operand tag-mask ANDI
"out" operand dup %tag-fixnum

View File

@ -1,7 +1,8 @@
typedef struct _F_STACK_FRAME {
struct _F_STACK_FRAME *previous;
CELL padding;
CELL padding1;
CELL *return_address;
CELL padding2;
} F_STACK_FRAME;
#define SIGSEGV_EXC_STATE_TYPE ppc_exception_state_t