Commit a2896b12 authored by Benedikt Geßele's avatar Benedikt Geßele

revision 5 and 6 separated; merged with jucs experimental

parent 1713c59a
......@@ -21,7 +21,9 @@ GDSL_ASM_HL=specifications/asm/asm.ml specifications/asm/asm-pretty.ml specifica
GDSL_RREIL_HL=specifications/rreil/rreil.ml specifications/rreil/rreil-examples.ml specifications/rreil/rreil-cif.ml specifications/rreil/rreil-pretty.ml specifications/rreil/fmap.ml specifications/rreil/rreil-opt.ml specifications/rreil/rreil-translator.ml
GDSL_OPT_HL=specifications/rreil/rreil-liveness.ml specifications/rreil/rreil-forward-subst.ml specifications/rreil/forward-subst/inline.ml specifications/rreil/rreil-cleanup.ml specifications/rreil/forward-subst/substitute.ml specifications/rreil/forward-subst/substmap.ml specifications/rreil/forward-subst/simplify-expressions.ml
GDSL_MIPS_HL=specifications/mips/mips.ml specifications/mips/mips-pretty.ml specifications/mips/mips-rreil-pretty.ml specifications/mips/mips-rreil-registermapping.ml specifications/mips/mips-rreil-translator.ml specifications/mips/mips-liveness.ml specifications/mips/mips-asm.ml specifications/mips/mips-traverse.ml
GDSL_MIPS_HL_R5=specifications/mips/mips_r5.ml specifications/mips/mips-pretty_r5.ml specifications/mips/mips-rreil-translator_r5.ml specifications/mips/mips-asm_r5.ml specifications/mips/mips-traverse_r5.ml
GDSL_MIPS_HL_R6=specifications/mips/mips_r6.ml specifications/mips/mips-pretty_r6.ml specifications/mips/mips-rreil-translator_r6.ml specifications/mips/mips-asm_r6.ml specifications/mips/mips-traverse_r6.ml
GDSL_MIPS_HL=specifications/mips/mips.ml specifications/mips/mips-pretty.ml specifications/mips/mips-rreil-pretty.ml specifications/mips/mips-rreil-registermapping.ml specifications/mips/mips-rreil-translator.ml specifications/mips/mips-liveness.ml specifications/mips/mips-asm.ml specifications/mips/mips-traverse.ml $(GDSL_MIPS_HL_R5)
GDSL_MIPS_TRANS_HL=
GDSL_SOURCES=$(GDSL_BASIS_HL) $(GDSL_RREIL_HL) $(GDSL_MIPS_HL) $(GDSL_MIPS_TRANS_HL) $(GDSL_OPT_HL) $(GDSL_ASM_HL)
......
......@@ -55,6 +55,7 @@ in case i of
| INSTRINDEX28 i: inner i 28
| COFUN i: inner i 25
| OP i: inner i 5
| _ : revision/generalize-immediate i
end end
val generalize-ua ua =
......
val revision/generalize-immediate i =
case i of
IMM16 x: asm-bounded (asm-boundary-sz 16) (asm-imm (zx x))
end
val revision/generalize-immediate i = let
val inner i sz = asm-bounded (asm-boundary-sz sz) (asm-imm (zx i))
in case i of
IMM21 i: inner i 21
| BP i: inner i 2
end end
export pretty : (insndata) -> rope
val pretty i = show/instruction i
val -++ a b = a +++ " " +++ b
val show/lvalue opnd =
case opnd of
GPR r: show/register r
| FPR r: show/register r
end
val show/rvalue opnd =
case opnd of
LVALUE l: show/lvalue l
| IMM imm: show/immediate imm
end
val show/immediate imm =
case imm of
IMM5 x: show-int (zx x)
| IMM16 x: show-int (zx x)
| OFFSET9 x: show-int (zx x)
| OFFSET16 x: show-int (zx x)
| SEL x: show-int (zx x)
| IMPL x: show-int (zx x)
| CODE10 x: show-int (zx x)
| CODE19 x: show-int (zx x)
| CODE20 x: show-int (zx x)
| STYPE x: show-int (zx x)
| POSSIZE x: show-int (zx x)
| SIZE x: show-int (zx x)
| POS x: show-int (zx x)
| HINT x: show-int (zx x)
| INSTRINDEX x: show-int (zx x)
| COFUN x: show-int (zx x)
| CC x: show-int (zx x)
| COND x: show-int (zx x)
| OP x: show-int (zx x)
end
val show/format format =
case format of
S : "S"
| D : "D"
| W : "W"
| L : "L"
| PS : "PS"
end
val show/register r =
case r of
ZERO: "zero"
| AT: "at"
| V0: "v0"
| V1: "v1"
| A0: "a0"
| A1: "a1"
| A2: "a2"
| A3: "a3"
| T0: "t0"
| T1: "t1"
| T2: "t2"
| T3: "t3"
| T4: "t4"
| T5: "t5"
| T6: "t6"
| T7: "t7"
| S0: "s0"
| S1: "s1"
| S2: "s2"
| S3: "s3"
| S4: "s4"
| S5: "s5"
| S6: "s6"
| S7: "s7"
| T8: "t8"
| T9: "t9"
| K0: "k0"
| K1: "k1"
| GP: "gp"
| SP: "sp"
| S8: "s8"
| RA: "ra"
| HI: "hi"
| LO: "lo"
| PC: "pc"
| F0: "f0"
| F1: "f1"
| F2: "f2"
| F3: "f3"
| F4: "f4"
| F5: "f5"
| F6: "f6"
| F7: "f7"
| F8: "f8"
| F9: "f9"
| F10: "f10"
| F11: "f11"
| F12: "f12"
| F13: "f13"
| F14: "f14"
| F15: "f15"
| F16: "f16"
| F17: "f17"
| F18: "f18"
| F19: "f19"
| F20: "f20"
| F21: "f21"
| F22: "f22"
| F23: "f23"
| F24: "f24"
| F25: "f25"
| F26: "f26"
| F27: "f27"
| F28: "f28"
| F29: "f29"
| F30: "f30"
| F31: "f31"
| FIR: "fir"
| FCCR: "fccr"
| FEXR: "fexr"
| FENR: "fenr"
| FCSR: "fcsr"
end
# -> sftl
val show/unop-src x = show/rvalue x.source
val show/unop x = show/lvalue x.destination
val show/binop-src x = show/rvalue x.source1 +++ ", " +++ show/rvalue x.source2
val show/binop-fmt x = show/lvalue x.destination +++ ", " +++ show/rvalue x.source
val show/binop x = show/lvalue x.destination +++ ", " +++ show/rvalue x.source
val show/ternop-src x = show/rvalue x.source1 +++ ", " +++ show/rvalue x.source2 +++ ", " +++ show/rvalue x.source3
val show/ternop x = show/lvalue x.destination +++ ", " +++ show/rvalue x.source1 +++ ", " +++ show/rvalue x.source2
val show/ternop-fmt x = show/lvalue x.destination +++ ", " +++ show/rvalue x.source1 +++ ", " +++ show/rvalue x.source2
val show/quadop x = show/lvalue x.destination +++ ", " +++ show/rvalue x.source1 +++ ", " +++ show/rvalue x.source2 +++ ", " +++ show/rvalue x.source3
val show/quadop-fmt x = show/lvalue x.destination +++ ", " +++ show/rvalue x.source1 +++ ", " +++ show/rvalue x.source2 +++ ", " +++ show/rvalue x.source3
val show/quadop-fmt-src x = show/rvalue x.source1 +++ ", " +++ show/rvalue x.source2 +++ ", " +++ show/rvalue x.source3 +++ ", " +++ show/rvalue x.source4
val show/instruction insn = let
val show/ua mnemonic ua = case ua of
NULLOP: mnemonic
| UNOP_SRC x: mnemonic -++ show/unop-src x
| UNOP x: mnemonic -++ show/unop x
| BINOP_SRC x: mnemonic -++ show/binop-src x
| BINOP_FMT x: mnemonic +++ "." +++ show/format x.fmt -++ show/binop-fmt x
| BINOP x: mnemonic -++ show/binop x
| TERNOP_SRC x: mnemonic -++ show/ternop-src x
| TERNOP x: mnemonic -++ show/ternop x
| TERNOP_FMT x: mnemonic +++ "." +++ show/format x.fmt -++ show/ternop-fmt x
| QUADOP x: mnemonic -++ show/quadop x
| QUADOP_FMT x: mnemonic +++ "." +++ show/format x.fmt -++ show/quadop-fmt x
| QUADOP_FMT_SRC x: mnemonic +++ "." +++ show/format x.fmt -++ show/quadop-fmt-src x
end
in
traverse show/ua insn.insn
end
# <- sutl
......@@ -88,6 +88,7 @@ val show/immediate imm =
| INSTRINDEX28 x: show-int (zx x)
| COFUN x: show-int (zx x)
| OP x: show-int (zx x)
| _ : revision/show/immediate imm
end
val show/format format =
......@@ -96,7 +97,7 @@ val show/format format =
| D : "D"
| W : "W"
| L : "L"
| PS : "PS"
| _ : revision/show/format format
end
val show/condop cond =
......
val revision/show/immediate imm = "ERROR"
val revision/show/format format =
case format of
PS : "PS"
end
val revision/show/immediate imm =
case imm of
IMM21 x: show-int (zx x)
| BP x: show-int (zx x)
end
val revision/show/format format = "ERROR"
val revision/sizeof-imm imm = 0
val revision/rval-imm sn x = SEM_LIN_IMM {const=0}
val sem-addi x = do
rs <- rval Signed x.op2;
imm <- rval Signed x.op3;
size <- return (sizeof-lval x.op1);
res <- mktemp;
add size res rs imm;
overflow-add-addi size res rs imm;
write x.op1 (var res)
end
val sem-lwl x = do
off/base <- rval Signed x.op2;
base <- return (extract-tuple off/base).opnd1;
off <- return (extract-tuple off/base).opnd2;
rt <- lval Signed x.op1;
size <- return (sizeof-lval x.op1);
vaddr <- mktemp;
add size vaddr base off;
bcpu <- is-big-endian-cpu;
bcpu2 <- mktemp;
movsx 2 bcpu2 1 bcpu;
byte <- mktemp;
xorb 2 byte (var vaddr) (var bcpu2);
shl 32 byte (var byte) (imm 3);
memword <- mktemp;
load 32 memword size (var vaddr);
lshift <- mktemp;
sub size lshift (imm 24) (var byte);
high <- mktemp;
shl size high (var memword) (var lshift);
rshift <- mktemp;
add size rshift (imm 8) (var byte);
low <- mktemp;
shl size low rt (var rshift);
shr size low (var low) (var rshift);
res <- mktemp;
orb size res (var high) (var low);
write x.op1 (var res)
end
val sem-lwr x = do
off/base <- rval Signed x.op2;
base <- return (extract-tuple off/base).opnd1;
off <- return (extract-tuple off/base).opnd2;
rt <- lval Signed x.op1;
size <- return (sizeof-lval x.op1);
vaddr <- mktemp;
add size vaddr base off;
bcpu <- is-big-endian-cpu;
bcpu2 <- mktemp;
movsx 2 bcpu2 1 bcpu;
byte <- mktemp;
xorb 2 byte (var vaddr) (var bcpu2);
shl 32 byte (var byte) (imm 3);
memword <- mktemp;
load 32 memword size (var vaddr);
lshift <- mktemp;
sub size lshift (imm 32) (var byte);
high <- mktemp;
shr size high (var memword) (var lshift);
shl size high (var high) (var lshift);
rshift <- mktemp;
sub size rshift (imm 31) (var byte);
low <- mktemp;
shl size low rt (var rshift);
shr size low (var low) (var rshift);
res <- mktemp;
orb size res (var high) (var low);
write x.op1 (var res)
end
val revision/semantics i =
case i of
ADDI x: sem-addi x
| ALNV-PS x: sem-default-quadop-lrrr-generic i x
| LWL x: sem-lwl x
| LWLE x: sem-lwl x
| LWR x: sem-lwr x
| LWRE x: sem-lwr x
| LWXC1 x: sem-default-binop-lr-tuple-generic i x
end
val revision/sizeof-imm imm =
case imm of
IMM21 i: 21
| BP i: 2
end
val revision/rval-imm sn x = let
val from-vec sn vec =
case sn of
Signed: SEM_LIN_IMM {const=sx vec}
| Unsigned: SEM_LIN_IMM {const=zx vec}
end
in
case x of
IMM21 i: from-vec sn i
| BP i: from-vec sn i
end
end
val sem-addiupc x = do
imm <- rval Signed x.op2;
size <- return (sizeof-lval x.op1);
pc <- return (semantic-reg-of Sem_PC);
res <- mktemp;
add size res (var pc) imm;
write x.op1 (var res)
end
val sem-align x = do
rs <- rval Unsigned x.op2;
rt <- rval Unsigned x.op3;
bp_op <- rval Unsigned x.op4;
size <- return (sizeof-rval x.op2);
bp <- return (lin-to-int bp_op);
left <- mktemp;
right <- mktemp;
shl size left rt (imm (8 * bp));
shr size right rs (imm (8 * (4 - bp)));
res <- mktemp;
orb size res (var left) (var right);
write x.op1 (var res)
end
val revision/semantics i =
case i of
ADDIUPC x: sem-addiupc x
| ALIGN x: sem-align x
end
val uarity-of insn = let
val f a b = b
in
traverse f insn
end
val mnemonic-of insn = let
val f a b = a
in
traverse f insn
end
val traverse-others f insn =
case insn of
PAUSE: f "PAUSE" (NULLOP)
end
# -> sftl
type uarity =
NULLOP
| UNOP_SRC of unop-src
| UNOP of unop
| BINOP_SRC of binop-src
| BINOP_FMT of binop-fmt
| BINOP of binop
| TERNOP_SRC of ternop-src
| TERNOP of ternop
| TERNOP_FMT of ternop-fmt
| QUADOP of quadop
| QUADOP_FMT of quadop-fmt
| QUADOP_FMT_SRC of quadop-fmt-src
val traverse f insn =
case insn of
ABS-fmt x: f "ABS.fmt" (BINOP_FMT x)
| ADD x: f "ADD" (TERNOP x)
| ADD-fmt x: f "ADD.fmt" (TERNOP_FMT x)
| ADDI x: f "ADDI" (TERNOP x)
| ADDIU x: f "ADDIU" (TERNOP x)
| ADDU x: f "ADDU" (TERNOP x)
| ALNV-PS x: f "ALNV.PS" (QUADOP x)
| AND x: f "AND" (TERNOP x)
| ANDI x: f "ANDI" (TERNOP x)
| BC1F x: f "BC1F" (BINOP_SRC x)
| BC1FL x: f "BC1FL" (BINOP_SRC x)
| BC1T x: f "BC1T" (BINOP_SRC x)
| BC1TL x: f "BC1TL" (BINOP_SRC x)
| BC2F x: f "BC2F" (BINOP_SRC x)
| BC2FL x: f "BC2FL" (BINOP_SRC x)
| BC2T x: f "BC2T" (BINOP_SRC x)
| BC2TL x: f "BC2TL" (BINOP_SRC x)
| BEQ x: f "BEQ" (TERNOP_SRC x)
| BEQL x: f "BEQL" (TERNOP_SRC x)
| BGEZ x: f "BGEZ" (BINOP_SRC x)
| BGEZAL x: f "BGEZAL" (BINOP_SRC x)
| BGEZALL x: f "BGEZALL" (BINOP_SRC x)
| BGEZL x: f "BGEZL" (BINOP_SRC x)
| BGTZ x: f "BGTZ" (BINOP_SRC x)
| BGTZL x: f "BGTZL" (BINOP_SRC x)
| BLEZ x: f "BLEZ" (BINOP_SRC x)
| BLEZL x: f "BLEZL" (BINOP_SRC x)
| BLTZ x: f "BLTZ" (BINOP_SRC x)
| BLTZAL x: f "BLTZAL" (BINOP_SRC x)
| BLTZALL x: f "BLTZALL" (BINOP_SRC x)
| BLTZL x: f "BLTZL" (BINOP_SRC x)
| BNE x: f "BNE" (TERNOP_SRC x)
| BNEL x: f "BNEL" (TERNOP_SRC x)
| BREAK x: f "BREAK" (UNOP_SRC x)
| C-cond-fmt x: f "C.cond.fmt" (QUADOP_FMT_SRC x)
| CACHE x: f "CACHE" (TERNOP_SRC x)
| CACHEE x: f "CACHEE" (TERNOP_SRC x)
| CEIL-L-fmt x: f "CEIL.L.fmt" (BINOP_FMT x)
| CEIL-W-fmt x: f "CEIL.W.fmt" (BINOP_FMT x)
| CFC1 x: f "CFC1" (BINOP x)
| CFC2 x: f "CFC2" (BINOP x)
| CLO x: f "CLO" (TERNOP x)
| CLZ x: f "CLZ" (TERNOP x)
| COP2 x: f "COP2" (UNOP_SRC x)
| CTC1 x: f "CTC1" (BINOP_SRC x)
| CTC2 x: f "CTC2" (BINOP_SRC x)
| CVT-D-fmt x: f "CVT.D.fmt" (BINOP_FMT x)
| CVT-L-fmt x: f "CVT.L.fmt" (BINOP_FMT x)
| CVT-PS-S x: f "CVT.PS.S" (TERNOP x)
| CVT-S-fmt x: f "CVT.S.fmt" (BINOP_FMT x)
| CVT-S-PL x: f "CVT.S.PL" (BINOP x)
| CVT-S-PU x: f "CVT.S.PU" (BINOP x)
| CVT-W-fmt x: f "CVT.W.fmt" (BINOP_FMT x)
| DERET: f "DERET" (NULLOP)
| DI x: f "DI" (UNOP x)
| DIV x: f "DIV" (BINOP_SRC x)
| DIV-fmt x: f "DIV.fmt" (TERNOP_FMT x)
| DIVU x: f "DIVU" (BINOP_SRC x)
| EI x: f "EI" (UNOP x)
| ERET: f "ERET" (NULLOP)
| EXT x: f "EXT" (QUADOP x)
| FLOOR-L-fmt x: f "FLOOR.L.fmt" (BINOP_FMT x)
| FLOOR-W-fmt x: f "FLOOR.W.fmt" (BINOP_FMT x)
| INS x: f "INS" (QUADOP x)
| J x: f "J" (UNOP_SRC x)
| JAL x: f "JAL" (UNOP_SRC x)
| JALR x: f "JALR" (TERNOP x)
| JALR-HB x: f "JALR.HB" (TERNOP x)
| JALX x: f "JALX" (UNOP_SRC x)
| JR x: f "JR" (BINOP_SRC x)
| JR-HB x: f "JR.HB" (BINOP_SRC x)
| LB x: f "LB" (TERNOP x)
| LBE x: f "LBE" (TERNOP x)
| LBU x: f "LBU" (TERNOP x)
| LBUE x: f "LBUE" (TERNOP x)
| LDC1 x: f "LDC1" (TERNOP x)
| LDC2 x: f "LDC2" (TERNOP_SRC x)
| LDXC1 x: f "LDXC1" (TERNOP x)
| LH x: f "LH" (TERNOP x)
| LHE x: f "LHE" (TERNOP x)
| LHU x: f "LHU" (TERNOP x)
| LHUE x: f "LHUE" (TERNOP x)
| LL x: f "LL" (TERNOP x)
| LLE x: f "LLE" (TERNOP x)
| LUI x: f "LUI" (BINOP x)
| LUXC1 x: f "LUXC1" (TERNOP x)
| LW x: f "LW" (TERNOP x)
| LWC1 x: f "LWC1" (TERNOP x)
| LWC2 x: f "LWC2" (TERNOP_SRC x)
| LWE x: f "LWE" (TERNOP x)
| LWL x: f "LWL" (TERNOP x)
| LWLE x: f "LWLE" (TERNOP x)
| LWR x: f "LWR" (TERNOP x)
| LWRE x: f "LWRE" (TERNOP x)
| LWXC1 x: f "LWXC1" (TERNOP x)
| MADD x: f "MADD" (BINOP_SRC x)
| MADD-fmt x: f "MADD.fmt" (QUADOP_FMT x)
| MADDU x: f "MADDU" (BINOP_SRC x)
| MFC0 x: f "MFC0" (TERNOP x)
| MFC1 x: f "MFC1" (BINOP x)
| MFC2 x: f "MFC2" (BINOP x)
| MFHC1 x: f "MFHC1" (BINOP x)
| MFHC2 x: f "MFHC2" (BINOP x)
| MFHI x: f "MFHI" (UNOP x)
| MFLO x: f "MFLO" (UNOP x)
| MOV-fmt x: f "MOV.fmt" (BINOP_FMT x)
| MOVF x: f "MOVF" (TERNOP x)
| MOVF-fmt x: f "MOVF.fmt" (TERNOP_FMT x)
| MOVN x: f "MOVN" (TERNOP x)
| MOVN-fmt x: f "MOVN.fmt" (TERNOP_FMT x)
| MOVT x: f "MOVT" (TERNOP x)
| MOVT-fmt x: f "MOVT.fmt" (TERNOP_FMT x)
| MOVZ x: f "MOVZ" (TERNOP x)
| MOVZ-fmt x: f "MOVZ.fmt" (TERNOP_FMT x)
| MSUB x: f "MSUB" (BINOP_SRC x)
| MSUB-fmt x: f "MSUB.fmt" (QUADOP_FMT x)
| MSUBU x: f "MSUBU" (BINOP_SRC x)
| MTC0 x: f "MTC0" (TERNOP_SRC x)
| MTC1 x: f "MTC1" (BINOP x)
| MTC2 x: f "MTC2" (BINOP_SRC x)
| MTHC1 x: f "MTHC1" (BINOP x)
| MTHC2 x: f "MTHC2" (BINOP_SRC x)
| MTHI x: f "MTHI" (UNOP_SRC x)
| MTLO x: f "MTLO" (UNOP_SRC x)
| MUL x: f "MUL" (TERNOP x)
| MUL-fmt x: f "MUL.fmt" (TERNOP_FMT x)
| MULT x: f "MULT" (BINOP_SRC x)
| MULTU x: f "MULTU" (BINOP_SRC x)
| NEG-fmt x: f "NEG.fmt" (BINOP_FMT x)
| NMADD-fmt x: f "NMADD.fmt" (QUADOP_FMT x)
| NMSUB-fmt x: f "NMSUB.fmt" (QUADOP_FMT x)
| NOR x: f "NOR" (TERNOP x)
| OR x: f "OR" (TERNOP x)
| ORI x: f "ORI" (TERNOP x)
| PLL-PS x: f "PLL.PS" (TERNOP x)
| PLU-PS x: f "PLU.PS" (TERNOP x)
| PREF x: f "PREF" (TERNOP_SRC x)
| PREFE x: f "PREFE" (TERNOP_SRC x)
| PREFX x: f "PREFX" (TERNOP_SRC x)
| PUL-PS x: f "PUL.PS" (TERNOP x)
| PUU-PS x: f "PUU.PS" (TERNOP x)
| RDHWR x: f "RDHWR" (BINOP x)
| RDPGPR x: f "RDPGPR" (BINOP x)
| RECIP-fmt x: f "RECIP.fmt" (BINOP_FMT x)
| ROTR x: f "ROTR" (TERNOP x)
| ROTRV x: f "ROTRV" (TERNOP x)
| ROUND-L-fmt x: f "ROUND.L.fmt" (BINOP_FMT x)
| ROUND-W-fmt x: f "ROUND.W.fmt" (BINOP_FMT x)
| RSQRT-fmt x: f "RSQRT.fmt" (BINOP_FMT x)
| SB x: f "SB" (TERNOP_SRC x)
| SBE x: f "SBE" (TERNOP_SRC x)
| SC x: f "SC" (TERNOP x)
| SCE x: f "SCE" (TERNOP x)
| SDBBP x: f "SDBBP" (UNOP_SRC x)
| SDC1 x: f "SDC1" (TERNOP_SRC x)
| SDC2 x: f "SDC2" (TERNOP_SRC x)
| SDXC1 x: f "SDXC1" (TERNOP_SRC x)
| SEB x: f "SEB" (BINOP x)
| SEH x: f "SEH" (BINOP x)
| SH x: f "SH" (TERNOP_SRC x)
| SHE x: f "SHE" (TERNOP_SRC x)
| SLL x: f "SLL" (TERNOP x)
| SLLV x: f "SLLV" (TERNOP x)
| SLT x: f "SLT" (TERNOP x)
| SLTI x: f "SLTI" (TERNOP x)
| SLTIU x: f "SLTIU" (TERNOP x)
| SLTU x: f "SLTU" (TERNOP x)
| SQRT-fmt x: f "SQRT.fmt" (BINOP_FMT x)
| SRA x: f "SRA" (TERNOP x)
| SRAV x: f "SRAV" (TERNOP x)
| SRL x: f "SRL" (TERNOP x)
| SRLV x: f "SRLV" (TERNOP x)
| SUB x: f "SUB" (TERNOP x)
| SUB-fmt x: f "SUB.fmt" (TERNOP_FMT x)
| SUBU x: f "SUBU" (TERNOP x)
| SUXC1 x: f "SUXC1" (TERNOP_SRC x)
| SW x: f "SW" (TERNOP_SRC x)
| SWC1 x: f "SWC1" (TERNOP_SRC x)
| SWC2 x: f "SWC2" (TERNOP_SRC x)
| SWE x: f "SWE" (TERNOP_SRC x)
| SWL x: f "SWL" (TERNOP_SRC x)
| SWLE x: f "SWLE" (TERNOP_SRC x)
| SWR x: f "SWR" (TERNOP_SRC x)
| SWRE x: f "SWRE" (TERNOP_SRC x)
| SWXC1 x: f "SWXC1" (TERNOP_SRC x)
| SYNC x: f "SYNC" (UNOP_SRC x)
| SYNCI x: f "SYNCI" (BINOP_SRC x)
| SYSCALL x: f "SYSCALL" (UNOP_SRC x)
| TEQ x: f "TEQ" (TERNOP_SRC x)
| TEQI x: f "TEQI" (BINOP_SRC x)
| TGE x: f "TGE" (TERNOP_SRC x)
| TGEI x: f "TGEI" (BINOP_SRC x)
| TGEIU x: f "TGEIU" (BINOP_SRC x)
| TGEU x: f "TGEU" (TERNOP_SRC x)
| TLBINV: f "TLBINV" (NULLOP)
| TLBINVF: f "TLBINVF" (NULLOP)
| TLBP: f "TLBP" (NULLOP)
| TLBR: f "TLBR" (NULLOP)
| TLBWI: f "TLBWI" (NULLOP)
| TLBWR: f "TLBWR" (NULLOP)
| TLT x: f "TLT" (TERNOP_SRC x)
| TLTI x: f "TLTI" (BINOP_SRC x)
| TLTIU x: f "TLTIU" (BINOP_SRC x)
| TLTU x: f "TLTU" (TERNOP_SRC x)
| TNE x: f "TNE" (TERNOP_SRC x)
| TNEI x: f "TNEI" (BINOP_SRC x)
| TRUNC-L-fmt x: f "TRUNC.L.fmt" (BINOP_FMT x)
| TRUNC-W-fmt x: f "TRUNC.W.fmt" (BINOP_FMT x)
| WAIT x: f "WAIT" (UNOP_SRC x)
| WRPGPR x: f "WRPGPR" (BINOP_SRC x)
| WSBH x: f "WSBH" (BINOP x)
| XOR x: f "XOR" (TERNOP x)
| XORI x: f "XORI" (TERNOP x)
| _: traverse-others f insn
end
# <- sutl
......@@ -33,10 +33,8 @@ val traverse f insn =
| ABS-fmt x: f "ABS" (BINOP_FLR x)
| ADD x: f "ADD" (TERNOP_LRR x)
| ADD-fmt x: f "ADD" (TERNOP_FLRR x)
| ADDI x: f "ADDI" (TERNOP_LRR x)
| ADDIU x: f "ADDIU" (TERNOP_LRR x)
| ADDU x: f "ADDU" (TERNOP_LRR x)
| ALNV-PS x: f "ALNV.PS" (QUADOP_LRRR x)
| AND x: f "AND" (TERNOP_LRR x)
| ANDI x: f "ANDI" (TERNOP_LRR x)
| BC1F x: f "BC1F" (BINOP_RR x)
......@@ -120,11 +118,6 @@ val traverse f insn =
| LWC1 x: f "LWC1" (BINOP_LR x)
| LWC2 x: f "LWC2" (BINOP_RR x)
| LWE x: f "LWE" (BINOP_LR x)
| LWL x: f "LWL" (BINOP_LR x)
| LWLE x: f "LWLE" (BINOP_LR x)
| LWR x: f "LWR" (BINOP_LR x)
| LWRE x: f "LWRE" (BINOP_LR x)
| LWXC1 x: f "LWXC1" (BINOP_LR x)
| MADD x: f "MADD" (BINOP_RR x)
| MADD-fmt x: f "MADD" (QUADOP_FLRRR x)
| MADDU x: f "MADDU" (BINOP_RR x)
......@@ -244,4 +237,5 @@ val traverse f insn =
| WSBH x: f "WSBH" (BINOP_LR x)
| XOR x: f "XOR" (TERNOP_LRR x)
| XORI x: f "XORI" (TERNOP_LRR x)
| _: revision/traverse f insn