aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/host
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/host')
-rw-r--r--new-luxc/source/luxc/lang/host/jvm/inst.lux73
1 files changed, 53 insertions, 20 deletions
diff --git a/new-luxc/source/luxc/lang/host/jvm/inst.lux b/new-luxc/source/luxc/lang/host/jvm/inst.lux
index e52d11d9b..b673c7d7e 100644
--- a/new-luxc/source/luxc/lang/host/jvm/inst.lux
+++ b/new-luxc/source/luxc/lang/host/jvm/inst.lux
@@ -72,21 +72,27 @@
## Jump
(~~ (declare IF_ICMPEQ IF_ICMPGT IF_ICMPLT
IF_ICMPNE IF_ICMPGE IF_ICMPLE
- IF_ACMPEQ IFNULL
+ IF_ACMPEQ IF_ACMPNE IFNULL IFNONNULL
IFEQ IFNE IFLT IFLE IFGT IFGE
GOTO))
+ (~~ (declare BIPUSH SIPUSH))
+ (~~ (declare ICONST_M1 ICONST_0 ICONST_1 ICONST_2 ICONST_3 ICONST_4 ICONST_5
+ LCONST_0 LCONST_1
+ FCONST_0 FCONST_1 FCONST_2
+ DCONST_0 DCONST_1))
(#static ACONST_NULL int)
## Var
- (~~ (declare ILOAD LLOAD DLOAD ALOAD
- ISTORE LSTORE ASTORE))
+ (~~ (declare IINC
+ ILOAD LLOAD FLOAD DLOAD ALOAD
+ ISTORE LSTORE FSTORE DSTORE ASTORE))
## Arithmetic
- (~~ (declare IADD ISUB IMUL IDIV IREM
- LADD LSUB LMUL LDIV LREM LCMP
- FADD FSUB FMUL FDIV FREM FCMPG FCMPL
- DADD DSUB DMUL DDIV DREM DCMPG DCMPL))
+ (~~ (declare IADD ISUB IMUL IDIV IREM INEG
+ LADD LSUB LMUL LDIV LREM LNEG LCMP
+ FADD FSUB FMUL FDIV FREM FNEG FCMPG FCMPL
+ DADD DSUB DMUL DDIV DREM DNEG DCMPG DCMPL))
## Bit-wise
(~~ (declare IAND IOR IXOR ISHL ISHR IUSHR
@@ -162,21 +168,45 @@
[string Text function.identity]
)
-(template: (prefix short)
+(template: (!prefix short)
(`` ((~~ (template.identifier ["org/objectweb/asm/Opcodes::" short])))))
+(template [<constant>]
+ [(def: #export <constant>
+ Inst
+ (function (_ visitor)
+ (do-to visitor
+ (org/objectweb/asm/MethodVisitor::visitInsn (!prefix <constant>)))))]
+
+ [ICONST_M1] [ICONST_0] [ICONST_1] [ICONST_2] [ICONST_3] [ICONST_4] [ICONST_5]
+ [LCONST_0] [LCONST_1]
+ [FCONST_0] [FCONST_1] [FCONST_2]
+ [DCONST_0] [DCONST_1]
+ )
+
(def: #export NULL
Inst
(function (_ visitor)
(do-to visitor
- (org/objectweb/asm/MethodVisitor::visitInsn (prefix ACONST_NULL)))))
+ (org/objectweb/asm/MethodVisitor::visitInsn (!prefix ACONST_NULL)))))
+
+(template [<constant>]
+ [(def: #export (<constant> constant)
+ (-> Int Inst)
+ (function (_ visitor)
+ (do-to visitor
+ (org/objectweb/asm/MethodVisitor::visitIntInsn (!prefix <constant>) constant))))]
+
+ [BIPUSH]
+ [SIPUSH]
+ )
(template [<name>]
[(def: #export <name>
Inst
(function (_ visitor)
(do-to visitor
- (org/objectweb/asm/MethodVisitor::visitInsn (prefix <name>)))))]
+ (org/objectweb/asm/MethodVisitor::visitInsn (!prefix <name>)))))]
[NOP]
@@ -192,23 +222,23 @@
[L2D] [L2F] [L2I]
## Integer arithmetic
- [IADD] [ISUB] [IMUL] [IDIV] [IREM]
+ [IADD] [ISUB] [IMUL] [IDIV] [IREM] [INEG]
## Integer bitwise
[IAND] [IOR] [IXOR] [ISHL] [ISHR] [IUSHR]
## Long arithmetic
- [LADD] [LSUB] [LMUL] [LDIV] [LREM]
+ [LADD] [LSUB] [LMUL] [LDIV] [LREM] [LNEG]
[LCMP]
## Long bitwise
[LAND] [LOR] [LXOR] [LSHL] [LSHR] [LUSHR]
## Float arithmetic
- [FADD] [FSUB] [FMUL] [FDIV] [FREM] [FCMPG] [FCMPL]
+ [FADD] [FSUB] [FMUL] [FDIV] [FREM] [FNEG] [FCMPG] [FCMPL]
## Double arithmetic
- [DADD] [DSUB] [DMUL] [DDIV] [DREM]
+ [DADD] [DSUB] [DMUL] [DDIV] [DREM] [DNEG]
[DCMPG] [DCMPL]
## Array
@@ -232,15 +262,18 @@
[RETURN] [IRETURN] [LRETURN] [FRETURN] [DRETURN] [ARETURN]
)
+(type: #export Register Nat)
+
(template [<name>]
[(def: #export (<name> register)
- (-> Nat Inst)
+ (-> Register Inst)
(function (_ visitor)
(do-to visitor
- (org/objectweb/asm/MethodVisitor::visitVarInsn (prefix <name>) (.int register)))))]
+ (org/objectweb/asm/MethodVisitor::visitVarInsn (!prefix <name>) (.int register)))))]
- [ILOAD] [LLOAD] [DLOAD] [ALOAD]
- [ISTORE] [LSTORE] [ASTORE]
+ [IINC]
+ [ILOAD] [LLOAD] [FLOAD] [DLOAD] [ALOAD]
+ [ISTORE] [LSTORE] [FSTORE] [DSTORE] [ASTORE]
)
(template [<name> <inst>]
@@ -317,11 +350,11 @@
(-> //.Label Inst)
(function (_ visitor)
(do-to visitor
- (org/objectweb/asm/MethodVisitor::visitJumpInsn (prefix <name>) @where))))]
+ (org/objectweb/asm/MethodVisitor::visitJumpInsn (!prefix <name>) @where))))]
[IF_ICMPEQ] [IF_ICMPGT] [IF_ICMPLT]
[IF_ICMPNE] [IF_ICMPGE] [IF_ICMPLE]
- [IF_ACMPEQ] [IFNULL]
+ [IF_ACMPEQ] [IF_ACMPNE] [IFNULL] [IFNONNULL]
[IFEQ] [IFNE] [IFLT] [IFLE] [IFGT] [IFGE]
[GOTO]
)