aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/generator/host/jvm/inst.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-10-12 01:27:48 -0400
committerEduardo Julian2017-10-12 01:27:48 -0400
commitf3acc0d67e6cd4e7245c1e169a3c0469da4373a3 (patch)
tree9ed4796b085abb535ae6bee2f804166c30787691 /new-luxc/source/luxc/generator/host/jvm/inst.lux
parent1594c2c866db18c6c5360ae2451ffd38b879fc49 (diff)
- Compilation and tests for primitive conversions.
Diffstat (limited to 'new-luxc/source/luxc/generator/host/jvm/inst.lux')
-rw-r--r--new-luxc/source/luxc/generator/host/jvm/inst.lux26
1 files changed, 16 insertions, 10 deletions
diff --git a/new-luxc/source/luxc/generator/host/jvm/inst.lux b/new-luxc/source/luxc/generator/host/jvm/inst.lux
index aa9a852dd..ebf12023f 100644
--- a/new-luxc/source/luxc/generator/host/jvm/inst.lux
+++ b/new-luxc/source/luxc/generator/host/jvm/inst.lux
@@ -22,7 +22,11 @@
(L/map (function [code] (` ((~' #static) (~ (code;local-symbol code)) (~' int)))))
wrap))
-(with-expansions [<primitive> (declare T_BOOLEAN T_CHAR T_FLOAT T_DOUBLE
+(with-expansions [<conversion> (declare D2F D2I D2L
+ F2D F2I F2L
+ I2B I2C I2D I2F I2L I2S
+ L2D L2F L2I)
+ <primitive> (declare T_BOOLEAN T_CHAR T_FLOAT T_DOUBLE
T_BYTE T_SHORT T_INT T_LONG)
<stack> (declare DUP DUP2 DUP2_X1 DUP2_X2
POP POP2
@@ -39,6 +43,9 @@
DCMPG DCMPL)
<return> (declare RETURN IRETURN LRETURN DRETURN ARETURN)]
(host;import org.objectweb.asm.Opcodes
+ (#static NOP int)
+
+ <conversion>
<primitive>
(#static CHECKCAST int)
@@ -62,12 +69,6 @@
<arithmethic>
- (#static I2L int)
- (#static L2I int)
- (#static L2D int)
- (#static D2L int)
- (#static I2C int)
-
(#static AALOAD int)
(#static AASTORE int)
(#static ARRAYLENGTH int)
@@ -150,9 +151,17 @@
(do-to visitor
(MethodVisitor.visitInsn [(prefix <name>)]))))]
+ [NOP]
+
## Stack
[DUP] [DUP2] [DUP2_X1] [DUP2_X2] [POP] [POP2] [SWAP]
+ ## Conversions
+ [D2F] [D2I] [D2L]
+ [F2D] [F2I] [F2L]
+ [I2B] [I2C] [I2D] [I2F] [I2L] [I2S]
+ [L2D] [L2F] [L2I]
+
## Long bitwise
[LAND] [LOR] [LXOR] [LSHL] [LSHR] [LUSHR]
@@ -167,9 +176,6 @@
[DADD] [DSUB] [DMUL] [DDIV] [DREM]
[DCMPG] [DCMPL]
- ## Conversions
- [I2L] [L2I] [L2D] [D2L] [I2C]
-
## Array
[AALOAD] [AASTORE] [ARRAYLENGTH]