fix32: additional conversions
This commit is contained in:
parent
d4562c34a7
commit
b9c2a4501f
|
@ -86,6 +86,13 @@
|
|||
@x32-from-u32 ( x** -> x/** )
|
||||
DENOM32 !u32-mul
|
||||
|
||||
@x32-from-s8 ( x^ -> x/** )
|
||||
DUP #80 AND #07 SFT #ff MUL SWP ( >> )
|
||||
@x32-from-s16 ( x* -> x/** )
|
||||
DUP2 #8000 AND2 #0f SFT2 #ffff MUL2 SWP2 ( >> )
|
||||
@x32-from-s32 ( x** -> x/** )
|
||||
DENOM32 !u32-mul
|
||||
|
||||
@x32-signed-op ( x** y** f* -> f[x,y]** )
|
||||
STH2 LIT2r 0001 ( x** y** [f* 0^ 1^] )
|
||||
OVR2 #8000 LTH2 ?{ u32-negate SWPr } ( x** y** [f* ab*] )
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
#7fff x32-from-u16 x32-emit #0a18 DEO ( 32767.0 )
|
||||
#8000 x32-from-u16 x32-emit #0a18 DEO ( 32768.0 )
|
||||
#ffff x32-from-u16 x32-emit #0a18 DEO ( 65535.0 )
|
||||
#01 x32-from-s8 x32-emit #0a18 DEO ( 10.0 )
|
||||
#0a x32-from-s8 x32-emit #0a18 DEO ( 10.0 )
|
||||
#80 x32-from-s8 x32-emit #0a18 DEO ( -128.0 )
|
||||
#ff x32-from-s8 x32-emit #0a18 DEO ( -1.0 )
|
||||
#0a18 DEO
|
||||
#0000 #03e8 #0000 #07d0 LIT "+ ;x32-add #0000 #0bb8 test-binop ( 1 + 2 = 3 )
|
||||
#ffff #fc18 #ffff #fc18 LIT "+ ;x32-add #ffff #f830 test-binop ( -1 + -1 = -2 )
|
||||
|
|
Loading…
Reference in New Issue