From 1db5c446a954c251f8cf49cac557155ab7aba997 Mon Sep 17 00:00:00 2001 From: "Ilya V. Matveychikov" Date: Tue, 4 Feb 2014 02:52:13 +0400 Subject: [PATCH] Add TMS320 disassembly engine This patch adds TMS320 DSP family processors disassembly engine. It's purpose to add support for the all the families processors but as for now the only one of them is supported (C55X). --- libr/asm/Jamroot | 3 + libr/asm/arch/tms320/c55x/table.h | 2701 +++++++++++++++++++++++++++ libr/asm/arch/tms320/c55x/table_e.h | 1275 +++++++++++++ libr/asm/arch/tms320/tms320_dasm.c | 1035 ++++++++++ libr/asm/arch/tms320/tms320_dasm.h | 223 +++ libr/asm/arch/tms320/tms320_p.h | 76 + libr/asm/p/Makefile | 2 +- libr/asm/p/asm_tms320.c | 67 + libr/asm/p/tms320.mk | 10 + libr/include/r_asm.h | 1 + plugins.def.cfg | 1 + 11 files changed, 5393 insertions(+), 1 deletion(-) create mode 100644 libr/asm/arch/tms320/c55x/table.h create mode 100644 libr/asm/arch/tms320/c55x/table_e.h create mode 100644 libr/asm/arch/tms320/tms320_dasm.c create mode 100644 libr/asm/arch/tms320/tms320_dasm.h create mode 100644 libr/asm/arch/tms320/tms320_p.h create mode 100644 libr/asm/p/asm_tms320.c create mode 100644 libr/asm/p/tms320.mk diff --git a/libr/asm/Jamroot b/libr/asm/Jamroot index 58965367c4..366688ad0b 100644 --- a/libr/asm/Jamroot +++ b/libr/asm/Jamroot @@ -7,6 +7,9 @@ ASM_OBJS += arch/x86/ollyasm/asmserv.c arch/x86/ollyasm/assembl.c arch/x86/ollya ASM_OBJS += arch/c55plus/c55plus.c arch/c55plus/decode.c arch/c55plus/decode_funcs.c ; ASM_OBJS += arch/c55plus/hashtable.c arch/c55plus/hashvector.c arch/c55plus/ins.c arch/c55plus/utils.c ; +# TMS320 +ASM_OBJS += arch/tms320/tms320_dasm.c ; + # ARC ASM_OBJS += arch/arc/gnu/arc-dis.c ; ASM_OBJS += arch/arc/gnu/arc-ext.c ; diff --git a/libr/asm/arch/tms320/c55x/table.h b/libr/asm/arch/tms320/c55x/table.h new file mode 100644 index 0000000000..279796fe93 --- /dev/null +++ b/libr/asm/arch/tms320/c55x/table.h @@ -0,0 +1,2701 @@ +{ + .byte = 0x48, + .size = 0x02, + .insn = { + // xxxxx10001001000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,4), LIST_END }, + .f_list = NULL, + .syntax = INSN_SYNTAX(RETI), + }, +}, +{ + .byte = 0x60, + .size = 0x02, + .insn = { + // lCCCCCCC01100lll + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,l3), INSN_FLAG(8,CCCCCCC), INSN_FLAG(15,l1), LIST_END }, + .syntax = INSN_SYNTAX(BCC l4, cond), + }, +}, +{ + .byte = 0x68, + .size = 0x05, + .insn = { + // PPPPPPPPPPPPPPPPPPPPPPPPxCCCCCCC01101000 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), INSN_FLAG(16,P24), LIST_END }, + .syntax = INSN_SYNTAX(BCC P24, cond), + }, +}, +{ + .byte = 0x69, + .size = 0x05, + .insn = { + // PPPPPPPPPPPPPPPPPPPPPPPPxCCCCCCC01101001 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), INSN_FLAG(16,P24), LIST_END }, + .syntax = INSN_SYNTAX(CALLCC P24, cond), + }, +}, +{ + .byte = 0x6a, + .size = 0x04, + .insn = { + // PPPPPPPPPPPPPPPPPPPPPPPP01101010 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,P24), LIST_END }, + .syntax = INSN_SYNTAX(B P24), + }, +}, +{ + .byte = 0x6c, + .size = 0x04, + .insn = { + // PPPPPPPPPPPPPPPPPPPPPPPP01101100 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,P24), LIST_END }, + .syntax = INSN_SYNTAX(CALL P24), + }, +}, +{ + .byte = 0x6d, + .size = 0x04, + .insn = { + // LLLLLLLLLLLLLLLLxCCCCCCC01101101 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), INSN_FLAG(16,L16), LIST_END }, + .syntax = INSN_SYNTAX(BCC L16, cond), + }, +}, +{ + .byte = 0x6e, + .size = 0x04, + .insn = { + // LLLLLLLLLLLLLLLLxCCCCCCC01101110 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), INSN_FLAG(16,L16), LIST_END }, + .syntax = INSN_SYNTAX(CALLCC L16, cond), + }, +}, +{ + .byte = 0x6f, + .size = 0x04, + .insn = { + // LLLLLLLLKKKKKKKKFSSSccxu01101111 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,u), INSN_FLAG(10,cc), INSN_FLAG(12,FSSS), INSN_FLAG(16,K8), INSN_FLAG(24,L8), LIST_END }, + .syntax = INSN_SYNTAX(BCC[U] L8, src RELOP K8), + }, +}, +{ + .byte = 0x70, + .size = 0x04, + .insn = { + // SSDDSHFTKKKKKKKKKKKKKKKK01110000 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(24,SHFT), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD K16 << #SHFT, [ACx,] ACy), + }, +}, +{ + .byte = 0x71, + .size = 0x04, + .insn = { + // SSDDSHFTKKKKKKKKKKKKKKKK01110001 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(24,SHFT), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB K16 << #SHFT, [ACx,] ACy), + }, +}, +{ + .byte = 0x72, + .size = 0x04, + .insn = { + // SSDDSHFTkkkkkkkkkkkkkkkk01110010 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(24,SHFT), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(AND k16 << #SHFT, [ACx,] ACy), + }, +}, +{ + .byte = 0x73, + .size = 0x04, + .insn = { + // SSDDSHFTkkkkkkkkkkkkkkkk01110011 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(24,SHFT), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(OR k16 << #SHFT, [ACx,] ACy), + }, +}, +{ + .byte = 0x74, + .size = 0x04, + .insn = { + // SSDDSHFTkkkkkkkkkkkkkkkk01110100 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(24,SHFT), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(XOR k16 << #SHFT, [ACx,] ACy), + }, +}, +{ + .byte = 0x75, + .size = 0x04, + .insn = { + // xxDDSHFTKKKKKKKKKKKKKKKK01110101 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(24,SHFT), INSN_FLAG(28,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV K16 << #SHFT, ACx), + }, +}, +{ + .byte = 0x76, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // FDDD00SSkkkkkkkkkkkkkkkk01110110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(24,SS), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(BFXTR k16, ACx, dst), + }, + { + // FDDD01SSkkkkkkkkkkkkkkkk01110110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(24,SS), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(BFXPA k16, ACx, dst), + }, + { + // FDDD10xxKKKKKKKKKKKKKKKK01110110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV K16, dst), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x77, + .size = 0x04, + .insn = { + // FDDDxxxxDDDDDDDDDDDDDDDD01110111 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,D16), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AMOV D16, TAx), + }, +}, +{ + .byte = 0x78, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // xxx0000xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, DP), + }, + { + // xxx0001xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, SSP), + }, + { + // xxx0010xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, CDP), + }, + { + // xxx0011xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, BSA01), + }, + { + // xxx0100xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, BSA23), + }, + { + // xxx0101xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, BSA45), + }, + { + // xxx0110xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, BSA67), + }, + { + // xxx0111xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, BSAC), + }, + { + // xxx1000xkkkkkkkkkkkkkkkk01111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(MOV k16, SP), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x79, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // SSDDxx0%KKKKKKKKKKKKKKKK01111001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(24,R), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(MPYK[R] K16, [ACx,] ACy), + }, + { + // SSDDss1%KKKKKKKKKKKKKKKK01111001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(24,R), INSN_FLAG(26,ss), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(MACK[R] Tx, K16, [ACx,] ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x7a, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // SSDD000xKKKKKKKKKKKKKKKK01111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD K16 << #16, [ACx,] ACy), + }, + { + // SSDD001xKKKKKKKKKKKKKKKK01111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB K16 << #16, [ACx,] ACy), + }, + { + // SSDD010xkkkkkkkkkkkkkkkk01111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(AND k16 << #16, [ACx,] ACy), + }, + { + // SSDD011xkkkkkkkkkkkkkkkk01111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(OR k16 << #16, [ACx,] ACy), + }, + { + // SSDD100xkkkkkkkkkkkkkkkk01111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(XOR k16 << #16, [ACx,] ACy), + }, + { + // xxDD101xKKKKKKKKKKKKKKKK01111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,3,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(28,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV K16 << #16, ACx), + }, + { + // xxxx110xxxxxxxxxxxxxxxxx01111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(25,3,6), LIST_END }, + .f_list = NULL, + .syntax = INSN_SYNTAX(IDLE), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x7b, + .size = 0x04, + .insn = { + // FDDDFSSSKKKKKKKKKKKKKKKK01111011 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(24,FSSS), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(ADD K16, [src,] dst), + }, +}, +{ + .byte = 0x7c, + .size = 0x04, + .insn = { + // FDDDFSSSKKKKKKKKKKKKKKKK01111100 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,K16), INSN_FLAG(24,FSSS), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(SUB K16, [src,] dst), + }, +}, +{ + .byte = 0x7d, + .size = 0x04, + .insn = { + // FDDDFSSSkkkkkkkkkkkkkkkk01111101 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(24,FSSS), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AND k16, src, dst), + }, +}, +{ + .byte = 0x7e, + .size = 0x04, + .insn = { + // FDDDFSSSkkkkkkkkkkkkkkkk01111110 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(24,FSSS), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(OR k16, src, dst), + }, +}, +{ + .byte = 0x7f, + .size = 0x04, + .insn = { + // FDDDFSSSkkkkkkkkkkkkkkkk01111111 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k16), INSN_FLAG(24,FSSS), INSN_FLAG(28,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(XOR k16, src, dst), + }, +}, +{ + .byte = 0x80, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // YMMM00xxXXXMMMYY10000000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(MOV dbl(Xmem), dbl(Ymem)), + }, + { + // YMMM01xxXXXMMMYY10000000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(MOV Xmem, Ymem), + }, + { + // YMMM10SSXXXMMMYY10000000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(MOV ACx, Xmem, Ymem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x81, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // YMMM00DDXXXMMMYY10000001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(ADD Xmem, Ymem, ACx), + }, + { + // YMMM01DDXXXMMMYY10000001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(SUB Xmem, Ymem, ACx), + }, + { + // YMMM10DDXXXMMMYY10000001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(MOV Xmem, Ymem, ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x82, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // uuDDDDg%YMMM00mmXXXMMMYY10000010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx :: MPY[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy), + }, + { + // uuDDDDg%YMMM01mmXXXMMMYY10000010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx :: MPY[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy), + }, + { + // uuDDDDg%YMMM10mmXXXMMMYY10000010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx :: MPY[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy), + }, + { + // uuxxDDg%YMMM11mmXXXMMMYY10000010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(AMAR Xmem :: MPY[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x83, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // uuDDDDg%YMMM00mmXXXMMMYY10000011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx :: MAC[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy), + }, + { + // uuDDDDg%YMMM01mmXXXMMMYY10000011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx :: MAC[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy), + }, + { + // uuDDDDg%YMMM10mmXXXMMMYY10000011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx >> #16 :: MAC[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy), + }, + { + // uuxxDDg%YMMM11mmXXXMMMYY10000011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(AMAR Xmem :: MAC[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x84, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // uuDDDDg%YMMM00mmXXXMMMYY10000100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx :: MAC[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy >> #16), + }, + { + // uuxxDDg%YMMM01mmXXXMMMYY10000100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(AMAR Xmem :: MAC[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACx >> #16), + }, + { + // uuDDDDg%YMMM10mmXXXMMMYY10000100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx :: MAC[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy >> #16), + }, + { + // uuDDDDg%YMMM11mmXXXMMMYY10000100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx >> #16 :: MAC[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy >> #16), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x85, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // uuxxDDg%YMMM00mmXXXMMMYY10000101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(AMAR Xmem :: MAS[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACx), + }, + { + // uuDDDDg%YMMM01mmXXXMMMYY10000101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,DD), INSN_FLAG(28,DD), INSN_FLAG(30,uu), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]Xmem[)], [uns(]Cmem[)], ACx :: MAS[R][40] [uns(]Ymem[)], [uns(]Cmem[)], ACy), + }, + { + // xxxxxxxxYMMM10mmXXXMMMYY10000101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(AMAR Xmem, Ymem, Cmem), + }, + { + // DDx0DDU%YMMM11mmXXXMMMYY10000101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), INSN_MASK(28,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(FIRSADD Xmem, Ymem, Cmem, ACx, ACy), + }, + { + // DDx1DDU%YMMM11mmXXXMMMYY10000101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), INSN_MASK(28,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,mm), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(FIRSSUB Xmem, Ymem, Cmem, ACx, ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x86, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // 000guuU%YMMMxxDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,uu), INSN_FLAG(28,g), LIST_END }, + .syntax = INSN_SYNTAX(MPYM[R][40] [T3 = ][uns(]Xmem[)], [uns(]Ymem[)], ACx), + }, + { + // 001guuU%YMMMSSDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,uu), INSN_FLAG(28,g), LIST_END }, + .syntax = INSN_SYNTAX(MACM[R][40] [T3 = ][uns(]Xmem[)], [uns(]Ymem[)], [ACx,] ACy), + }, + { + // 010guuU%YMMMSSDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,uu), INSN_FLAG(28,g), LIST_END }, + .syntax = INSN_SYNTAX(MACM[R][40] [T3 = ][uns(]Xmem[)], [uns(]Ymem[)], ACx >> #16[, ACy]), + }, + { + // 011guuU%YMMMSSDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,uu), INSN_FLAG(28,g), LIST_END }, + .syntax = INSN_SYNTAX(MASM[R][40] [T3 = ][uns(]Xmem[)], [uns(]Ymem[)], [ACx,] ACy), + }, + { + // 100xssU%YMMMDDDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,ss), LIST_END }, + .syntax = INSN_SYNTAX(MASM[R] [T3 = ]Xmem, Tx, ACx :: MOV Ymem << #16, ACy), + }, + { + // 101xssU%YMMMDDDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,ss), LIST_END }, + .syntax = INSN_SYNTAX(MACM[R] [T3 = ]Xmem, Tx, ACx :: MOV Ymem << #16, ACy), + }, + { + // 110xxxx%YMMMDDDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), LIST_END }, + .syntax = INSN_SYNTAX(LMS Xmem, Ymem, ACx, ACy), + }, + { + // 1110xxn%YMMMDDDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(28,4,14), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), LIST_END }, + .syntax = INSN_SYNTAX(SQDST Xmem, Ymem, ACx, ACy), + }, + { + // 1111xxn%YMMMDDDDXXXMMMYY10000110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(28,4,15), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,DD), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), LIST_END }, + .syntax = INSN_SYNTAX(ABDST Xmem, Ymem, ACx, ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x87, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // 000xssU%YMMMSSDDXXXMMMYY10000111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,ss), LIST_END }, + .syntax = INSN_SYNTAX(MPYM[R] [T3 = ]Xmem, Tx, ACy :: MOV HI(ACx << T2), Ymem), + }, + { + // 001xssU%YMMMSSDDXXXMMMYY10000111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,ss), LIST_END }, + .syntax = INSN_SYNTAX(MACM[R] [T3 = ]Xmem, Tx, ACy :: MOV HI(ACx << T2), Ymem), + }, + { + // 010xssU%YMMMSSDDXXXMMMYY10000111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(26,ss), LIST_END }, + .syntax = INSN_SYNTAX(MASM[R] [T3 = ]Xmem, Tx, ACy :: MOV HI(ACx << T2), Ymem), + }, + { + // 01100001YMMMSSDDXXXMMMYY10000111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(24,8,97), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(LMSF Xmem, Ymem, ACx, ACy), + }, + { + // 100xxxxxYMMMSSDDXXXMMMYY10000111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(ADD Xmem << #16, ACx, ACy :: MOV HI(ACy << T2), Ymem), + }, + { + // 101xxxxxYMMMSSDDXXXMMMYY10000111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(SUB Xmem << #16, ACx, ACy :: MOV HI(ACy << T2), Ymem), + }, + { + // 110xxxxxYMMMSSDDXXXMMMYY10000111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(29,3,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,YY), INSN_FLAG(10,MMM), INSN_FLAG(13,XXX), INSN_FLAG(16,DD), INSN_FLAG(18,SS), INSN_FLAG(20,MMM), INSN_FLAG(23,Y), LIST_END }, + .syntax = INSN_SYNTAX(MOV Xmem << #16, ACy :: MOV HI(ACx << T2), Ymem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x90, + .size = 0x02, + .insn = { + // XSSSXDDD10010000 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,XDDD), INSN_FLAG(12,XSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV xsrc, xdst), + }, +}, +{ + .byte = 0x91, + .size = 0x02, + .insn = { + // xxxxxxSS10010001 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,SS), LIST_END }, + .syntax = INSN_SYNTAX(B ACx), + }, +}, +{ + .byte = 0x92, + .size = 0x02, + .insn = { + // xxxxxxSS10010010 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,SS), LIST_END }, + .syntax = INSN_SYNTAX(CALL ACx), + }, +}, +{ + .byte = 0x94, + .size = 0x02, + .insn = { + // xxxxxxxx10010100 + .i_list = NULL, + .m_list = NULL, + .f_list = NULL, + .syntax = INSN_SYNTAX(RESET), + }, +}, +{ + .byte = 0x95, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // 0xxkkkkk10010101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k5), LIST_END }, + .syntax = INSN_SYNTAX(INTR k5), + }, + { + // 1xxkkkkk10010101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,k5), LIST_END }, + .syntax = INSN_SYNTAX(TRAP k5), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x96, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // 0CCCCCCC10010110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), LIST_END }, + .syntax = INSN_SYNTAX(XCC [label, ]cond), + }, + { + // 1CCCCCCC10010110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), LIST_END }, + .syntax = INSN_SYNTAX(XCCPART [label, ]cond), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x9e, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // 0CCCCCCC10011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), LIST_END }, + .syntax = INSN_SYNTAX(XCC [label, ]cond), + }, + { + // 1CCCCCCC10011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), LIST_END }, + .syntax = INSN_SYNTAX(XCCPART [label, ]cond), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x9f, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // 0CCCCCCC10011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), LIST_END }, + .syntax = INSN_SYNTAX(XCC [label, ]cond), + }, + { + // 1CCCCCCC10011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,CCCCCCC), LIST_END }, + .syntax = INSN_SYNTAX(XCCPART [label, ]cond), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xa0, + .size = 0x02, + .insn = { + // AAAAAAAI1010FDDD + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,FDDD), INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, dst), + }, +}, +{ + .byte = 0xb0, + .size = 0x02, + .insn = { + // AAAAAAAI101100DD + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,DD), INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem << #16, ACx), + }, +}, +{ + .byte = 0xb4, + .size = 0x02, + .insn = { + // AAAAAAAI10110100 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(AMAR Smem), + }, +}, +{ + .byte = 0xb5, + .size = 0x02, + .insn = { + // AAAAAAAI10110101 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(PSH Smem), + }, +}, +{ + .byte = 0xb6, + .size = 0x02, + .insn = { + // AAAAAAAI10110110 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(DELAY Smem), + }, +}, +{ + .byte = 0xb7, + .size = 0x02, + .insn = { + // AAAAAAAI10110111 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(PSH dbl(Lmem)), + }, +}, +{ + .byte = 0xb8, + .size = 0x02, + .insn = { + // AAAAAAAI10111000 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(POP dbl(Lmem)), + }, +}, +{ + .byte = 0xbb, + .size = 0x02, + .insn = { + // AAAAAAAI10111011 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(POP Smem), + }, +}, +{ + .byte = 0xbc, + .size = 0x02, + .insn = { + // AAAAAAAI101111SS + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,SS), INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV HI(ACx), Smem), + }, +}, +{ + .byte = 0xc0, + .size = 0x02, + .insn = { + // AAAAAAAI1100FSSS + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,FSSS), INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV src, Smem), + }, +}, +{ + .byte = 0xd0, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // 0%DD01mmAAAAAAAI11010000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), INSN_MASK(23,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(20,DD), INSN_FLAG(22,R), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R] Smem, uns(Cmem), ACx), + }, + { + // 0%DD10mmAAAAAAAI11010000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), INSN_MASK(23,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(20,DD), INSN_FLAG(22,R), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R] Smem, uns(Cmem), ACx), + }, + { + // 0%DD11mmAAAAAAAI11010000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), INSN_MASK(23,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(20,DD), INSN_FLAG(22,R), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R] Smem, uns(Cmem), ACx), + }, + { + // U%DDxxmmAAAAAAAI11010000 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MACM[R]Z [T3 = ]Smem, Cmem, ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xd1, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // U%DD00mmAAAAAAAI11010001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MPYM[R] [T3 = ]Smem, Cmem, ACx), + }, + { + // U%DD01mmAAAAAAAI11010001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MACM[R] [T3 = ]Smem, Cmem, ACx), + }, + { + // U%DD10mmAAAAAAAI11010001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MASM[R] [T3 = ]Smem, Cmem, ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xd2, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // U%DD00SSAAAAAAAI11010010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SS), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MACM[R] [T3 = ]Smem, [ACx,] ACy), + }, + { + // U%DD01SSAAAAAAAI11010010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SS), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MASM[R] [T3 = ]Smem, [ACx,] ACy), + }, + { + // U%DD10SSAAAAAAAI11010010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SS), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(SQAM[R] [T3 = ]Smem, [ACx,] ACy), + }, + { + // U%DD11SSAAAAAAAI11010010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SS), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(SQSM[R] [T3 = ]Smem, [ACx,] ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xd3, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // U%DD00SSAAAAAAAI11010011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SS), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MPYM[R] [T3 = ]Smem, [ACx,] ACy), + }, + { + // U%DD10xxAAAAAAAI11010011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(SQRM[R] [T3 = ]Smem, ACx), + }, + { + // U%DDu1ssAAAAAAAI11010011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,ss), INSN_FLAG(19,u), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MPYM[R][U] [T3 = ]Smem, Tx, ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xd4, + .size = 0x03, + .insn = { + // U%DDssSSAAAAAAAI11010100 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SS), INSN_FLAG(18,ss), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MACM[R] [T3 = ]Smem, Tx, [ACx,] ACy), + }, +}, +{ + .byte = 0xd5, + .size = 0x03, + .insn = { + // U%DDssSSAAAAAAAI11010101 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SS), INSN_FLAG(18,ss), INSN_FLAG(20,DD), INSN_FLAG(22,R), INSN_FLAG(23,U), LIST_END }, + .syntax = INSN_SYNTAX(MASM[R] [T3 = ]Smem, Tx, [ACx,] ACy), + }, +}, +{ + .byte = 0xd6, + .size = 0x03, + .insn = { + // FDDDFSSSAAAAAAAI11010110 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(ADD Smem, [src,] dst), + }, +}, +{ + .byte = 0xd7, + .size = 0x03, + .insn = { + // FDDDFSSSAAAAAAAI11010111 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(SUB Smem, [src,] dst), + }, +}, +{ + .byte = 0xd8, + .size = 0x03, + .insn = { + // FDDDFSSSAAAAAAAI11011000 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(SUB src, Smem, dst), + }, +}, +{ + .byte = 0xd9, + .size = 0x03, + .insn = { + // FDDDFSSSAAAAAAAI11011001 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AND Smem, src, dst), + }, +}, +{ + .byte = 0xda, + .size = 0x03, + .insn = { + // FDDDFSSSAAAAAAAI11011010 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(OR Smem, src, dst), + }, +}, +{ + .byte = 0xdb, + .size = 0x03, + .insn = { + // FDDDFSSSAAAAAAAI11011011 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(XOR Smem, src, dst), + }, +}, +{ + .byte = 0xdc, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // kkkkxx00AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(BTST k4, Smem, TC1), + }, + { + // kkkkxx01AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(BTST k4, Smem, TC2), + }, + { + // 0000xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, DP), + }, + { + // 0001xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, CDP), + }, + { + // 0010xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BSA01), + }, + { + // 0011xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BSA23), + }, + { + // 0100xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BSA45), + }, + { + // 0101xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BSA67), + }, + { + // 0110xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BSAC), + }, + { + // 0111xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, SP), + }, + { + // 1000xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, SSP), + }, + { + // 1001xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BK03), + }, + { + // 1010xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BK47), + }, + { + // 1011xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,11), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BKC), + }, + { + // 1100xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,12), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, DPH), + }, + { + // 1111xx10AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), INSN_MASK(20,4,15), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, PDP), + }, + { + // x000xx11AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,3), INSN_MASK(20,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, CSR), + }, + { + // x001xx11AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,3), INSN_MASK(20,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BRC0), + }, + { + // x010xx11AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,3), INSN_MASK(20,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, BRC1), + }, + { + // x011xx11AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,3), INSN_MASK(20,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, TRN0), + }, + { + // x100xx11AAAAAAAI11011100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,3), INSN_MASK(20,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, TRN1), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xdd, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // SSDDss00AAAAAAAI11011101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(18,ss), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD Smem << Tx, [ACx,] ACy), + }, + { + // SSDDss01AAAAAAAI11011101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(18,ss), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB Smem << Tx, [ACx,] ACy), + }, + { + // SSDDss10AAAAAAAI11011101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(18,ss), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADDSUB2CC Smem, ACx, Tx, TC1, TC2, ACy), + }, + { + // x%DDss11AAAAAAAI11011101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,2,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(18,ss), INSN_FLAG(20,DD), INSN_FLAG(22,R), LIST_END }, + .syntax = INSN_SYNTAX(MOV [rnd(]Smem << Tx[)], ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xde, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // SSDD0000AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADDSUBCC Smem, ACx, TC1, ACy), + }, + { + // SSDD0001AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADDSUBCC Smem, ACx, TC2, ACy), + }, + { + // SSDD0010AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADDSUBCC Smem, ACx, TC1, TC2, ACy), + }, + { + // SSDD0011AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUBC Smem, [ACx,] ACy), + }, + { + // SSDD0100AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD Smem << #16, [ACx,] ACy), + }, + { + // SSDD0101AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB Smem << #16, [ACx,] ACy), + }, + { + // SSDD0110AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB ACx, Smem << #16, ACy), + }, + { + // ssDD1000AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,ss), LIST_END }, + .syntax = INSN_SYNTAX(ADDSUB Tx, Smem, ACx), + }, + { + // ssDD1001AAAAAAAI11011110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,ss), LIST_END }, + .syntax = INSN_SYNTAX(SUBADD Tx, Smem, ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xdf, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // FDDD000uAAAAAAAI11011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,u), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV [uns(]high_byte(Smem)[)], dst), + }, + { + // FDDD001uAAAAAAAI11011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,u), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV [uns(]low_byte(Smem)[)], dst), + }, + { + // xxDD010uAAAAAAAI11011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,u), INSN_FLAG(20,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV [uns(]Smem[)], ACx), + }, + { + // SSDD100uAAAAAAAI11011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,u), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD [uns(]Smem[)], CARRY, [ACx,] ACy), + }, + { + // SSDD101uAAAAAAAI11011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,u), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB [uns(]Smem[)], BORROW, [ACx,] ACy), + }, + { + // SSDD110uAAAAAAAI11011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,u), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD [uns(]Smem[)], [ACx,] ACy), + }, + { + // SSDD111uAAAAAAAI11011111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,u), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB [uns(]Smem[)], [ACx,] ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xe0, + .size = 0x03, + .insn = { + // FSSSxxxtAAAAAAAI11100000 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,t), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BTST src, Smem, TCx), + }, +}, +{ + .byte = 0xe1, + .size = 0x03, + .insn = { + // DDSHIFTWAAAAAAAI11100001 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(22,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV low_byte(Smem) << #SHIFTW, ACx), + }, +}, +{ + .byte = 0xe2, + .size = 0x03, + .insn = { + // DDSHIFTWAAAAAAAI11100010 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(22,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV high_byte(Smem) << #SHIFTW, ACx), + }, +}, +{ + .byte = 0xe3, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // kkkk000xAAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(BTSTSET k4, Smem, TC1), + }, + { + // kkkk001xAAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(BTSTSET k4, Smem, TC2), + }, + { + // kkkk010xAAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(BTSTCLR k4, Smem, TC1), + }, + { + // kkkk011xAAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(BTSTCLR k4, Smem, TC2), + }, + { + // kkkk100xAAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(BTSTNOT k4, Smem, TC1), + }, + { + // kkkk101xAAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(BTSTNOT k4, Smem, TC2), + }, + { + // FSSS1100AAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,12), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BSET src, Smem), + }, + { + // FSSS1101AAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,13), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BCLR src, Smem), + }, + { + // FSSS111xAAAAAAAI11100011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BNOT src, Smem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xe4, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // FSSSx0xxAAAAAAAI11100100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(PSH src,Smem), + }, + { + // FDDDx1xxAAAAAAAI11100100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(POP dst, Smem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xe5, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // FSSS01x0AAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,1,0), INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV src, high_byte(Smem)), + }, + { + // FSSS01x1AAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,1,1), INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV src, low_byte(Smem)), + }, + { + // 000010xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV DP, Smem), + }, + { + // 000110xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV CDP, Smem), + }, + { + // 001010xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BSA01, Smem), + }, + { + // 001110xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,14), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BSA23, Smem), + }, + { + // 010010xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,18), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BSA45, Smem), + }, + { + // 010110xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,22), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BSA67, Smem), + }, + { + // 011010xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,26), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BSAC, Smem), + }, + { + // 011110xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,30), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV SP, Smem), + }, + { + // 100010xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,34), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV SSP, Smem), + }, + { + // 100110xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,38), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BK03, Smem), + }, + { + // 101010xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,42), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BK47, Smem), + }, + { + // 101110xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,46), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BKC, Smem), + }, + { + // 110010xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,50), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV DPH, Smem), + }, + { + // 111110xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,62), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV PDP, Smem), + }, + { + // x00011xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,5,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV CSR, Smem), + }, + { + // x00111xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,5,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BRC0, Smem), + }, + { + // x01011xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,5,11), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV BRC1, Smem), + }, + { + // x01111xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,5,15), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV TRN0, Smem), + }, + { + // x10011xxAAAAAAAI11100101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,5,19), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV TRN1, Smem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xe6, + .size = 0x03, + .insn = { + // KKKKKKKKAAAAAAAI11100110 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,K8), LIST_END }, + .syntax = INSN_SYNTAX(MOV K8, Smem), + }, +}, +{ + .byte = 0xe7, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // SSss00xxAAAAAAAI11100111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,ss), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV ACx << Tx, Smem), + }, + { + // SSss10x%AAAAAAAI11100111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,R), INSN_FLAG(20,ss), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV [rnd(]HI(ACx << Tx)[)], Smem), + }, + { + // SSss11u%AAAAAAAI11100111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,R), INSN_FLAG(17,u), INSN_FLAG(20,ss), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV [uns(] [rnd(]HI[(saturate](ACx << Tx)[)))], Smem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xe8, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // SSxxx0x%AAAAAAAI11101000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,R), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV [rnd(]HI(ACx)[)], Smem), + }, + { + // SSxxx1u%AAAAAAAI11101000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,R), INSN_FLAG(17,u), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV [uns(] [rnd(]HI[(saturate](ACx)[)))], Smem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xe9, + .size = 0x03, + .insn = { + // SSSHIFTWAAAAAAAI11101001 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV ACx << #SHIFTW, Smem), + }, +}, +{ + .byte = 0xea, + .size = 0x03, + .insn = { + // SSSHIFTWAAAAAAAI11101010 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV HI(ACx << #SHIFTW), Smem), + }, +}, +{ + .byte = 0xeb, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // xxxx01xxAAAAAAAI11101011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV RETA, dbl(Lmem)), + }, + { + // xxSS10x0AAAAAAAI11101011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,1,0), INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV ACx, dbl(Lmem)), + }, + { + // xxSS10u1AAAAAAAI11101011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,1,1), INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(17,u), INSN_FLAG(20,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV [uns(]saturate(ACx)[)], dbl(Lmem)), + }, + { + // FSSS1100AAAAAAAI11101011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,12), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV pair(TAx), dbl(Lmem)), + }, + { + // xxSS1101AAAAAAAI11101011 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,13), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV ACx >> #1, dual(Lmem)), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xec, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // FSSS000xAAAAAAAI11101100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BSET Baddr, src), + }, + { + // FSSS001xAAAAAAAI11101100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BCLR Baddr, src), + }, + { + // FSSS010xAAAAAAAI11101100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BTSTP Baddr, src), + }, + { + // FSSS011xAAAAAAAI11101100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BNOT Baddr, src), + }, + { + // FSSS100tAAAAAAAI11101100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,t), INSN_FLAG(20,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(BTST Baddr, src, TCx), + }, + { + // XDDD1110AAAAAAAI11101100 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,14), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,XDDD), LIST_END }, + .syntax = INSN_SYNTAX(AMAR Smem, XAdst), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xed, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // 00DD1010AAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,10), INSN_MASK(22,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV dbl(Lmem), pair(HI(ACx))), + }, + { + // 00DD1100AAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,12), INSN_MASK(22,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV dbl(Lmem), pair(LO(ACx))), + }, + { + // 00SS1110AAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,14), INSN_MASK(22,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV pair(HI(ACx)), dbl(Lmem)), + }, + { + // 00SS1111AAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,15), INSN_MASK(22,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV pair(LO(ACx)), dbl(Lmem)), + }, + { + // SSDD000nAAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD dbl(Lmem), [ACx,] ACy), + }, + { + // SSDD001nAAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB dbl(Lmem), [ACx,] ACy), + }, + { + // SSDD010xAAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB ACx, dbl(Lmem), ACy), + }, + { + // xxxx011xAAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), LIST_END }, + .syntax = INSN_SYNTAX(MOV dbl(Lmem), RETA), + }, + { + // xxDD100gAAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,g), INSN_FLAG(20,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV[40] dbl(Lmem), ACx), + }, + { + // FDDD111xAAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV dbl(Lmem), pair(TAx)), + }, + { + // XDDD1111AAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,15), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,XDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV dbl(Lmem), XAdst), + }, + { + // XSSS0101AAAAAAAI11101101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,XSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV XAsrc, dbl(Lmem)), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xee, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // SSDD000xAAAAAAAI11101110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD dual(Lmem), [ACx,] ACy), + }, + { + // SSDD001xAAAAAAAI11101110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB dual(Lmem), [ACx,] ACy), + }, + { + // SSDD010xAAAAAAAI11101110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB ACx, dual(Lmem), ACy), + }, + { + // ssDD011xAAAAAAAI11101110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,ss), LIST_END }, + .syntax = INSN_SYNTAX(SUB dual(Lmem), Tx, ACx), + }, + { + // ssDD100xAAAAAAAI11101110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,ss), LIST_END }, + .syntax = INSN_SYNTAX(ADD dual(Lmem), Tx, ACx), + }, + { + // ssDD101xAAAAAAAI11101110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,ss), LIST_END }, + .syntax = INSN_SYNTAX(SUB Tx, dual(Lmem), ACx), + }, + { + // ssDD110xAAAAAAAI11101110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,ss), LIST_END }, + .syntax = INSN_SYNTAX(ADDSUB Tx, dual(Lmem), ACx), + }, + { + // ssDD111xAAAAAAAI11101110 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,3,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(20,DD), INSN_FLAG(22,ss), LIST_END }, + .syntax = INSN_SYNTAX(SUBADD Tx, dual(Lmem), ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xef, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // xxxx00mmAAAAAAAI11101111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), LIST_END }, + .syntax = INSN_SYNTAX(MOV Cmem, Smem), + }, + { + // xxxx01mmAAAAAAAI11101111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), LIST_END }, + .syntax = INSN_SYNTAX(MOV Smem, Cmem), + }, + { + // xxxx10mmAAAAAAAI11101111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), LIST_END }, + .syntax = INSN_SYNTAX(MOV Cmem,dbl(Lmem)), + }, + { + // xxxx11mmAAAAAAAI11101111 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,2,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), LIST_END }, + .syntax = INSN_SYNTAX(MOV dbl(Lmem), Cmem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xf0, + .size = 0x04, + .insn = { + // KKKKKKKKKKKKKKKKAAAAAAAI11110000 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,K16), LIST_END }, + .syntax = INSN_SYNTAX(CMP Smem == K16, TC1), + }, +}, +{ + .byte = 0xf1, + .size = 0x04, + .insn = { + // KKKKKKKKKKKKKKKKAAAAAAAI11110001 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,K16), LIST_END }, + .syntax = INSN_SYNTAX(CMP Smem == K16, TC2), + }, +}, +{ + .byte = 0xf2, + .size = 0x04, + .insn = { + // kkkkkkkkkkkkkkkkAAAAAAAI11110010 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,k16), LIST_END }, + .syntax = INSN_SYNTAX(BAND Smem, k16, TC1), + }, +}, +{ + .byte = 0xf3, + .size = 0x04, + .insn = { + // kkkkkkkkkkkkkkkkAAAAAAAI11110011 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,k16), LIST_END }, + .syntax = INSN_SYNTAX(BAND Smem, k16, TC2), + }, +}, +{ + .byte = 0xf4, + .size = 0x04, + .insn = { + // kkkkkkkkkkkkkkkkAAAAAAAI11110100 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,k16), LIST_END }, + .syntax = INSN_SYNTAX(AND k16, Smem), + }, +}, +{ + .byte = 0xf5, + .size = 0x04, + .insn = { + // kkkkkkkkkkkkkkkkAAAAAAAI11110101 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,k16), LIST_END }, + .syntax = INSN_SYNTAX(OR k16, Smem), + }, +}, +{ + .byte = 0xf6, + .size = 0x04, + .insn = { + // kkkkkkkkkkkkkkkkAAAAAAAI11110110 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,k16), LIST_END }, + .syntax = INSN_SYNTAX(XOR k16, Smem), + }, +}, +{ + .byte = 0xf7, + .size = 0x04, + .insn = { + // KKKKKKKKKKKKKKKKAAAAAAAI11110111 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,K16), LIST_END }, + .syntax = INSN_SYNTAX(ADD K16, Smem), + }, +}, +{ + .byte = 0xf8, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // xxDDx0U%KKKKKKKKAAAAAAAI11111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,K8), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(28,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPYMK[R] [T3 = ]Smem, K8, ACx), + }, + { + // SSDDx1U%KKKKKKKKAAAAAAAI11111000 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,K8), INSN_FLAG(24,R), INSN_FLAG(25,U), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(MACMK[R] [T3 = ]Smem, K8, [ACx,] ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xf9, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // SSDD00xxuxSHIFTWAAAAAAAI11111001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(23,u), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(ADD [uns(]Smem[)] << #SHIFTW, [ACx,] ACy), + }, + { + // SSDD01xxuxSHIFTWAAAAAAAI11111001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(23,u), INSN_FLAG(28,DD), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(SUB [uns(]Smem[)] << #SHIFTW, [ACx,] ACy), + }, + { + // xxDD10xxuxSHIFTWAAAAAAAI11111001 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(23,u), INSN_FLAG(28,DD), LIST_END }, + .syntax = INSN_SYNTAX(MOV [uns(]Smem[)] << #SHIFTW, ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xfa, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // SSxxx0x%xxSHIFTWAAAAAAAI11111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(24,R), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV [rnd(]HI(ACx << #SHIFTW)[)], Smem), + }, + { + // SSxxx1x%uxSHIFTWAAAAAAAI11111010 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(26,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,SHIFTW), INSN_FLAG(23,u), INSN_FLAG(24,R), INSN_FLAG(30,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV [uns(] [rnd(]HI[(saturate](ACx << #SHIFTW)[)))], Smem), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0xfb, + .size = 0x04, + .insn = { + // KKKKKKKKKKKKKKKKAAAAAAAI11111011 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,K16), LIST_END }, + .syntax = INSN_SYNTAX(MOV K16, Smem), + }, +}, +{ + .byte = 0xfc, + .size = 0x04, + .insn = { + // LLLLLLLLLLLLLLLLAAAAAAAI11111100 + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,L16), LIST_END }, + .syntax = INSN_SYNTAX(BCC L16, ARn_mod ! = #0), + }, +}, +{ + .byte = 0xfd, + .size = 0x04, + .insn = { + .i_list = (insn_item_t []) { + { + // DDDDuug%000000mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MPY[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%000001mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MAC[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%000010mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MPY[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%000011mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MAS[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%000100mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MPY[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%000101mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MAC[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%000110mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MAS[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%000111mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MAC[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%001000mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MAC[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx>>#16), + }, + { + // DDDDuug%001001mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy>>#16 :: MAS[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%001010mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy>>#16 :: MPY[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%001011mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,11), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy>>#16 :: MAC[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx>>#16), + }, + { + // DDDDuug%001100mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,12), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]Smem[)], [uns(]HI(Cmem)[)], ACy :: MAS[R][40] [uns(]Smem[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%010000mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,16), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MPY[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%010001mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,17), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MAC[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%010010mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,18), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MPY[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%010011mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,19), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MAS[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%010100mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,20), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MPY[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%010101mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,21), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MAC[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%010110mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,22), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MAS[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%010111mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,23), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MAC[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%011000mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,24), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MAC[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx>>#16), + }, + { + // DDDDuug%011001mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,25), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy>>#16 :: MAS[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%011010mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,26), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy>>#16 :: MPY[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + { + // DDDDuug%011011mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,27), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy>>#16 :: MAC[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx>>#16), + }, + { + // DDDDuug%011100mmAAAAAAAI11111101 + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(18,6,28), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(8,AAAAAAAI), INSN_FLAG(16,mm), INSN_FLAG(24,R), INSN_FLAG(25,g), INSN_FLAG(26,uu), INSN_FLAG(28,DD), INSN_FLAG(30,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R][40] [uns(]HI(Lmem)[)], [uns(]HI(Cmem)[)], ACy :: MAS[R][40] [uns(]LO(Lmem)[)], [uns(]LO(Cmem)[)], ACx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, diff --git a/libr/asm/arch/tms320/c55x/table_e.h b/libr/asm/arch/tms320/c55x/table_e.h new file mode 100644 index 0000000000..e19b55bfca --- /dev/null +++ b/libr/asm/arch/tms320/c55x/table_e.h @@ -0,0 +1,1275 @@ +{ + .byte = 0x00, + .size = 0x03, + .insn = { + // kkkkkkkkxCCCCCCC0000000E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,CCCCCCC), INSN_FLAG(16,k8), LIST_END }, + .syntax = INSN_SYNTAX(RPTCC k8, cond), + }, +}, +{ + .byte = 0x02, + .size = 0x03, + .insn = { + // xxxxxxxxxCCCCCCC0000001E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,CCCCCCC), LIST_END }, + .syntax = INSN_SYNTAX(RETCC cond), + }, +}, +{ + .byte = 0x04, + .size = 0x03, + .insn = { + // LLLLLLLLxCCCCCCC0000010E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,CCCCCCC), INSN_FLAG(16,L8), LIST_END }, + .syntax = INSN_SYNTAX(BCC L8, cond), + }, +}, +{ + .byte = 0x06, + .size = 0x03, + .insn = { + // LLLLLLLLLLLLLLLL0000011E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,L16), LIST_END }, + .syntax = INSN_SYNTAX(B L16), + }, +}, +{ + .byte = 0x08, + .size = 0x03, + .insn = { + // LLLLLLLLLLLLLLLL0000100E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,L16), LIST_END }, + .syntax = INSN_SYNTAX(CALL L16), + }, +}, +{ + .byte = 0x0c, + .size = 0x03, + .insn = { + // kkkkkkkkkkkkkkkk0000110E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k16), LIST_END }, + .syntax = INSN_SYNTAX(RPT k16), + }, +}, +{ + .byte = 0x0e, + .size = 0x03, + .insn = { + // llllllllllllllll0000111E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,l16), LIST_END }, + .syntax = INSN_SYNTAX(RPTB pmad), + }, +}, +{ + .byte = 0x10, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // xxSHIFTWDDSS00000001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,SHIFTW), LIST_END }, + .syntax = INSN_SYNTAX(AND ACx << #SHIFTW[, ACy]), + }, + { + // xxSHIFTWDDSS00010001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,SHIFTW), LIST_END }, + .syntax = INSN_SYNTAX(OR ACx << #SHIFTW[, ACy]), + }, + { + // xxSHIFTWDDSS00100001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,SHIFTW), LIST_END }, + .syntax = INSN_SYNTAX(XOR ACx << #SHIFTW[, ACy]), + }, + { + // xxSHIFTWDDSS00110001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,SHIFTW), LIST_END }, + .syntax = INSN_SYNTAX(ADD ACx << #SHIFTW, ACy), + }, + { + // xxSHIFTWDDSS01000001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,SHIFTW), LIST_END }, + .syntax = INSN_SYNTAX(SUB ACx << #SHIFTW, ACy), + }, + { + // xxSHIFTWDDSS01010001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,SHIFTW), LIST_END }, + .syntax = INSN_SYNTAX(SFTS ACx, #SHIFTW[, ACy]), + }, + { + // xxSHIFTWDDSS01100001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,SHIFTW), LIST_END }, + .syntax = INSN_SYNTAX(SFTSC ACx, #SHIFTW[, ACy]), + }, + { + // xxSHIFTWDDSS01110001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,SHIFTW), LIST_END }, + .syntax = INSN_SYNTAX(SFTL ACx, #SHIFTW[, ACy]), + }, + { + // xxddxxxxxxSS10000001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(20,dd), LIST_END }, + .syntax = INSN_SYNTAX(EXP ACx, Tx), + }, + { + // xxddxxxxDDSS10010001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(20,dd), LIST_END }, + .syntax = INSN_SYNTAX(MANT ACx, ACy :: NEXP ACx, Tx), + }, + { + // SSddxxxtxxSS10100001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(16,t), INSN_FLAG(20,dd), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(BCNT ACx, ACy,TCx, Tx), + }, + { + // SSDDnnnnDDSS11000001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,12), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MAXDIFF ACx, ACy, ACz, ACw), + }, + { + // SSDDxxxrDDSS11010001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,13), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,r), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(DMAXDIFF ACx, ACy, ACz, ACw, TRNx), + }, + { + // SSDDxxxxDDSS11100001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,14), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MINDIFF ACx, ACy, ACz, ACw), + }, + { + // SSDDxxxrDDSS11110001000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,15), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), INSN_FLAG(14,DD), INSN_FLAG(16,r), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(DMINDIFF ACx, ACy, ACz, ACw, TRNx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x12, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // FDDDxuxtFSSScc000001001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,cc), INSN_FLAG(12,FSSS), INSN_FLAG(16,t), INSN_FLAG(18,u), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(CMP[U] src RELOP dst, TCx), + }, + { + // FDDD0uttFSSScc010001001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,1), INSN_MASK(19,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,cc), INSN_FLAG(12,FSSS), INSN_FLAG(16,tt), INSN_FLAG(18,u), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(CMPAND[U] src RELOP dst, TCy, TCx), + }, + { + // FDDD1uttFSSScc010001001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,1), INSN_MASK(19,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,cc), INSN_FLAG(12,FSSS), INSN_FLAG(16,tt), INSN_FLAG(18,u), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(CMPAND[U] src RELOP dst, !TCy, TCx), + }, + { + // FDDD0uttFSSScc100001001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,2), INSN_MASK(19,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,cc), INSN_FLAG(12,FSSS), INSN_FLAG(16,tt), INSN_FLAG(18,u), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(CMPOR[U] src RELOP dst, TCy, TCx), + }, + { + // FDDD1uttFSSScc100001001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,2), INSN_MASK(19,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,cc), INSN_FLAG(12,FSSS), INSN_FLAG(16,tt), INSN_FLAG(18,u), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(CMPOR[U] src RELOP dst, !TCy, TCx), + }, + { + // FDDD0xvvFSSSxx110001001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,3), INSN_MASK(19,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), INSN_FLAG(16,vv), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(ROL BitOut, src, BitIn, dst), + }, + { + // FDDD1xvvFSSSxx110001001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,3), INSN_MASK(19,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), INSN_FLAG(16,vv), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(ROR BitIn, src, BitOut, dst), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x14, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // FDDD0000FSSSxxxx0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AADD TAx, TAy), + }, + { + // FDDD0001FSSSxxxx0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AMOV TAx, TAy), + }, + { + // FDDD0010FSSSxxxx0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(ASUB TAx, TAy), + }, + { + // FDDD0100PPPPPPPP0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,P8), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AADD P8, TAx), + }, + { + // FDDD0101PPPPPPPP0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,P8), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AMOV P8, TAx), + }, + { + // FDDD0110PPPPPPPP0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,P8), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(ASUB P8, TAx), + }, + { + // FDDD1000FSSSxxxx0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AADD TAx, TAy), + }, + { + // FDDD1001FSSSxxxx0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AMOV TAx, TAy), + }, + { + // FDDD1010FSSSxxxx0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(ASUB TAx, TAy), + }, + { + // FDDD1100PPPPPPPP0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,12), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,P8), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AADD P8, TAx), + }, + { + // FDDD1101PPPPPPPP0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,13), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,P8), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AMOV P8, TAx), + }, + { + // FDDD1110PPPPPPPP0001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,14), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,P8), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(ASUB P8, TAx), + }, + { + // XACD0000XACS00010001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,1), INSN_MASK(16,4,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,XACS), INSN_FLAG(20,XACD), LIST_END }, + .syntax = INSN_SYNTAX(AADD XACsrc, XACdst), + }, + { + // XACD0001XACS00010001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,1), INSN_MASK(16,4,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,XACS), INSN_FLAG(20,XACD), LIST_END }, + .syntax = INSN_SYNTAX(AMOV XACsrc, XACdst), + }, + { + // XACD0010XACS00010001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,1), INSN_MASK(16,4,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,XACS), INSN_FLAG(20,XACD), LIST_END }, + .syntax = INSN_SYNTAX(ASUB XACsrc, XACdst), + }, + { + // XACD1000XACS00010001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,1), INSN_MASK(16,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,XACS), INSN_FLAG(20,XACD), LIST_END }, + .syntax = INSN_SYNTAX(AADD XACsrc, XACdst), + }, + { + // XACD1001XACS00010001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,1), INSN_MASK(16,4,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,XACS), INSN_FLAG(20,XACD), LIST_END }, + .syntax = INSN_SYNTAX(AMOV XACsrc, XACdst), + }, + { + // XACD1010XACS00010001010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,1), INSN_MASK(16,4,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,XACS), INSN_FLAG(20,XACD), LIST_END }, + .syntax = INSN_SYNTAX(ASUB XACsrc, XACdst), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x16, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // kkkk0000xxxxxkkk0001011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k3), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k7, DPH), + }, + { + // kkkk0011xxxkkkkk0001011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k5), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k9, PDP), + }, + { + // kkkk0100kkkkkkkk0001011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k12, BK03), + }, + { + // kkkk0101kkkkkkkk0001011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k12, BK47), + }, + { + // kkkk0110kkkkkkkk0001011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k12, BKC), + }, + { + // kkkk1000kkkkkkkk0001011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k12, CSR), + }, + { + // kkkk1001kkkkkkkk0001011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k12, BRC0), + }, + { + // kkkk1010kkkkkkkk0001011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(16,4,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(20,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k12, BRC1), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x18, + .size = 0x03, + .insn = { + // FDDDFSSSkkkkkkkk0001100E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(AND k8, src, dst), + }, +}, +{ + .byte = 0x1a, + .size = 0x03, + .insn = { + // FDDDFSSSkkkkkkkk0001101E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(OR k8, src, dst), + }, +}, +{ + .byte = 0x1c, + .size = 0x03, + .insn = { + // FDDDFSSSkkkkkkkk0001110E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), INSN_FLAG(16,FSSS), INSN_FLAG(20,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(XOR k8, src, dst), + }, +}, +{ + .byte = 0x1e, + .size = 0x03, + .insn = { + .i_list = (insn_item_t []) { + { + // SSDDxx0%KKKKKKKK0001111E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,K8), INSN_FLAG(16,R), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MPYK[R] K8, [ACx,] ACy), + }, + { + // SSDDss1%KKKKKKKK0001111E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(17,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,K8), INSN_FLAG(16,R), INSN_FLAG(18,ss), INSN_FLAG(20,DD), INSN_FLAG(22,SS), LIST_END }, + .syntax = INSN_SYNTAX(MACK[R] Tx, K8, [ACx,] ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x20, + .size = 0x01, + .insn = { + // 0010000E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), LIST_END }, + .syntax = INSN_SYNTAX(NOP), + }, +}, +{ + .byte = 0x22, + .size = 0x02, + .insn = { + // FSSSFDDD0010001E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV src, dst), + }, +}, +{ + .byte = 0x24, + .size = 0x02, + .insn = { + // FSSSFDDD0010010E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(ADD [src,] dst), + }, +}, +{ + .byte = 0x26, + .size = 0x02, + .insn = { + // FSSSFDDD0010011E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(SUB [src,] dst), + }, +}, +{ + .byte = 0x28, + .size = 0x02, + .insn = { + // FSSSFDDD0010100E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(AND src, dst), + }, +}, +{ + .byte = 0x2a, + .size = 0x02, + .insn = { + // FSSSFDDD0010101E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(OR src, dst), + }, +}, +{ + .byte = 0x2c, + .size = 0x02, + .insn = { + // FSSSFDDD0010110E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(XOR src, dst), + }, +}, +{ + .byte = 0x2e, + .size = 0x02, + .insn = { + // FSSSFDDD0010111E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MAX [src,] dst), + }, +}, +{ + .byte = 0x30, + .size = 0x02, + .insn = { + // FSSSFDDD0011000E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MIN [src,] dst), + }, +}, +{ + .byte = 0x32, + .size = 0x02, + .insn = { + // FSSSFDDD0011001E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(ABS [src,] dst), + }, +}, +{ + .byte = 0x34, + .size = 0x02, + .insn = { + // FSSSFDDD0011010E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(NEG [src,] dst), + }, +}, +{ + .byte = 0x36, + .size = 0x02, + .insn = { + // FSSSFDDD0011011E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(NOT [src,] dst), + }, +}, +{ + .byte = 0x38, + .size = 0x02, + .insn = { + // FSSSFDDD0011100E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(PSH src1, src2), + }, +}, +{ + .byte = 0x3a, + .size = 0x02, + .insn = { + // FSSSFDDD0011101E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(POP dst1, dst2), + }, +}, +{ + .byte = 0x3c, + .size = 0x02, + .insn = { + // kkkkFDDD0011110E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV k4, dst), + }, +}, +{ + .byte = 0x3e, + .size = 0x02, + .insn = { + // kkkkFDDD0011111E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(MOV –k4, dst), + }, +}, +{ + .byte = 0x40, + .size = 0x02, + .insn = { + // kkkkFDDD0100000E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(ADD k4, dst), + }, +}, +{ + .byte = 0x42, + .size = 0x02, + .insn = { + // kkkkFDDD0100001E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(SUB k4, dst), + }, +}, +{ + .byte = 0x44, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // 00SSFDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(14,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), INSN_FLAG(12,SS), LIST_END }, + .syntax = INSN_SYNTAX(MOV HI(ACx), TAx), + }, + { + // 01x0FDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(12,1,0), INSN_MASK(14,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(SFTS dst, #−1), + }, + { + // 01x1FDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(12,1,1), INSN_MASK(14,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(SFTS dst, #1), + }, + { + // 1000FDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(12,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV SP, TAx), + }, + { + // 1001FDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(12,4,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV SSP, TAx), + }, + { + // 1010FDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(12,4,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV CDP, TAx), + }, + { + // 1100FDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(12,4,12), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV BRC0, TAx), + }, + { + // 1101FDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(12,4,13), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV BRC1, TAx), + }, + { + // 1110FDDD0100010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(12,4,14), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(MOV RPTC, TAx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x46, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // kkkk00000100011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(BCLR k4, ST0_55), + }, + { + // kkkk00010100011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(BSET k4, ST0_55), + }, + { + // kkkk00100100011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(BCLR k4, ST1_55), + }, + { + // kkkk00110100011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(BSET k4, ST1_55), + }, + { + // kkkk01000100011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(BCLR k4, ST2_55), + }, + { + // kkkk01010100011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(BSET k4, ST2_55), + }, + { + // kkkk01100100011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(BCLR k4, ST3_55), + }, + { + // kkkk01110100011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(BSET k4, ST3_55), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x48, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // xxxxx0000100100E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), LIST_END }, + .syntax = INSN_SYNTAX(RPT CSR), + }, + { + // FSSSx0010100100E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(RPTADD CSR, TAx), + }, + { + // kkkkx0100100100E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(RPTADD CSR, k4), + }, + { + // kkkkx0110100100E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,k4), LIST_END }, + .syntax = INSN_SYNTAX(RPTSUB CSR, k4), + }, + { + // xxxxx1000100100E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), LIST_END }, + .syntax = INSN_SYNTAX(RET), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x4a, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // 0LLLLLLL0100101E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,L7), LIST_END }, + .syntax = INSN_SYNTAX(B L7), + }, + { + // 1lllllll0100101E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(15,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,l7), LIST_END }, + .syntax = INSN_SYNTAX(RPTBLOCAL pmad), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x4c, + .size = 0x02, + .insn = { + // kkkkkkkk0100110E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k8), LIST_END }, + .syntax = INSN_SYNTAX(RPT k8), + }, +}, +{ + .byte = 0x4e, + .size = 0x02, + .insn = { + // KKKKKKKK0100111E + .i_list = NULL, + .m_list = NULL, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,K8), LIST_END }, + .syntax = INSN_SYNTAX(AADD K8,SP), + }, +}, +{ + .byte = 0x50, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // FDDDx0000101000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(SFTL dst, #1), + }, + { + // FDDDx0010101000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(SFTL dst, #−1), + }, + { + // FDDDx0100101000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FDDD), LIST_END }, + .syntax = INSN_SYNTAX(POP dst), + }, + { + // xxDDx0110101000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,DD), LIST_END }, + .syntax = INSN_SYNTAX(POP dbl(ACx)), + }, + { + // FSSSx1100101000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(PSH src), + }, + { + // xxSSx1110101000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,3,7), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,SS), LIST_END }, + .syntax = INSN_SYNTAX(PSH dbl(ACx)), + }, + { + // XDDD01000101000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,XDDD), LIST_END }, + .syntax = INSN_SYNTAX(POPBOTH xdst), + }, + { + // XSSS01010101000E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,XSSS), LIST_END }, + .syntax = INSN_SYNTAX(PSHBOTH xsrc), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x52, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // FSSS00DD0101001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(10,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,DD), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV TAx, HI(ACx)), + }, + { + // FSSS10000101001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,8), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV TAx, SP), + }, + { + // FSSS10010101001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,9), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV TAx, SSP), + }, + { + // FSSS10100101001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,10), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV TAx, CDP), + }, + { + // FSSS11000101001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,12), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV TAx, CSR), + }, + { + // FSSS11010101001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,13), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV TAx, BRC1), + }, + { + // FSSS11100101001E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,4,14), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(12,FSSS), LIST_END }, + .syntax = INSN_SYNTAX(MOV TAx, BRC0), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x54, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // DDSS000%0101010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,3,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(ADD[R]V [ACx,] ACy), + }, + { + // DDSS001%0101010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,3,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SQA[R] [ACx,] ACy), + }, + { + // DDSS010%0101010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,3,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SQS[R] [ACx,] ACy), + }, + { + // DDSS011%0101010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,3,3), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R] [ACx,] ACy), + }, + { + // DDSS100%0101010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,3,4), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SQR[R] [ACx,] ACy), + }, + { + // DDSS101%0101010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,3,5), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(ROUND [ACx,] ACy), + }, + { + // DDSS110%0101010E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,3,6), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SAT[R] [ACx,] ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x56, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // DDSSss0%0101011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R] ACx, Tx, ACy[, ACy]), + }, + { + // DDSSss1%0101011E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAS[R] Tx, [ACx,] ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x58, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // DDSSss0%0101100E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,1,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(MPY[R] Tx, [ACx,] ACy), + }, + { + // DDSSss1%0101100E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,R), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(MAC[R] ACy, Tx, ACx, ACy), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x5a, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // DDSSss000101101E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(ADD ACx << Tx, ACy), + }, + { + // DDSSss010101101E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SUB ACx << Tx, ACy), + }, + { + // DDxxxx1t0101101E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(9,1,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,t), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SFTCC ACx, TCx), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x5c, + .size = 0x02, + .insn = { + .i_list = (insn_item_t []) { + { + // DDSSss000101110E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SFTL ACx, Tx[, ACy]), + }, + { + // DDSSss010101110E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,1), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SFTS ACx, Tx[, ACy]), + }, + { + // DDSSss100101110E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(8,2,2), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(10,ss), INSN_FLAG(12,SS), INSN_FLAG(14,DD), LIST_END }, + .syntax = INSN_SYNTAX(SFTSC ACx, Tx[, ACy]), + }, + LIST_END, + }, + .m_list = NULL, + .f_list = NULL, + .syntax = NULL, + }, +}, +{ + .byte = 0x5e, + .size = 0x02, + .insn = { + // 00kkkkkk0101111E + .i_list = NULL, + .m_list = (insn_mask_t []) { INSN_MASK(14,2,0), LIST_END }, + .f_list = (insn_flag_t []) { INSN_FLAG(0,E), INSN_FLAG(8,k6), LIST_END }, + .syntax = INSN_SYNTAX(SWAP ( )), + }, +}, diff --git a/libr/asm/arch/tms320/tms320_dasm.c b/libr/asm/arch/tms320/tms320_dasm.c new file mode 100644 index 0000000000..813cd1ad54 --- /dev/null +++ b/libr/asm/arch/tms320/tms320_dasm.c @@ -0,0 +1,1035 @@ +/* + * TMS320 disassembly engine + * + * Written by Ilya V. Matveychikov + * + * Distributed under LGPL + */ + +#include +#include + +/* public headers */ +#include +#include + +// TODO: wtf? +#define ht_(name) r_hashtable_##name + +/* private headers */ +#include "tms320_p.h" +#include "tms320_dasm.h" + +/* + * TMS320 disassembly engine implementation + */ + +int run_f_list(tms320_dasm_t * dasm) +{ + ut32 temp; + insn_flag_t * flag; + + if (!dasm->insn->f_list) + return 1; + + for (flag = dasm->insn->f_list; !f_list_last(flag); flag++) { + switch (flag->v) { + case TMS320_FLAG_E: + temp = get_bits(dasm->opcode64, flag->f, 1); + set_field_value(dasm, E, temp); + break; + case TMS320_FLAG_R: + temp = get_bits(dasm->opcode64, flag->f, 1); + set_field_value(dasm, R, temp); + break; + case TMS320_FLAG_U: + temp = get_bits(dasm->opcode64, flag->f, 1); + set_field_value(dasm, U, temp); + break; + case TMS320_FLAG_u: + temp = get_bits(dasm->opcode64, flag->f, 1); + set_field_value(dasm, u, temp); + break; + case TMS320_FLAG_g: + temp = get_bits(dasm->opcode64, flag->f, 1); + set_field_value(dasm, g, temp); + break; + case TMS320_FLAG_r: + temp = get_bits(dasm->opcode64, flag->f, 1); + set_field_value(dasm, r, temp); + break; + case TMS320_FLAG_t: + temp = get_bits(dasm->opcode64, flag->f, 1); + set_field_value(dasm, t, temp); + break; + + case TMS320_FLAG_k3: + temp = get_bits(dasm->opcode64, flag->f, 3); + set_field_value(dasm, k3, temp); + break; + case TMS320_FLAG_k4: + temp = get_bits(dasm->opcode64, flag->f, 4); + set_field_value(dasm, k4, temp); + break; + case TMS320_FLAG_k5: + temp = get_bits(dasm->opcode64, flag->f, 5); + set_field_value(dasm, k5, temp); + break; + case TMS320_FLAG_k6: + temp = get_bits(dasm->opcode64, flag->f, 6); + set_field_value(dasm, k6, temp); + break; + case TMS320_FLAG_k8: + temp = get_bits(dasm->opcode64, flag->f, 8); + set_field_value(dasm, k8, temp); + break; + case TMS320_FLAG_k12: + temp = get_bits(dasm->opcode64, flag->f, 12); + set_field_value(dasm, k12, temp); + break; + case TMS320_FLAG_k16: + temp = get_bits(dasm->opcode64, flag->f, 16); + set_field_value(dasm, k16, temp); + break; + + case TMS320_FLAG_l1: + temp = get_bits(dasm->opcode64, flag->f, 1); + set_field_value(dasm, l1, temp); + break; + case TMS320_FLAG_l3: + temp = get_bits(dasm->opcode64, flag->f, 3); + set_field_value(dasm, l3, temp); + break; + case TMS320_FLAG_l7: + temp = get_bits(dasm->opcode64, flag->f, 7); + set_field_value(dasm, l7, temp); + break; + case TMS320_FLAG_l16: + temp = get_bits(dasm->opcode64, flag->f, 16); + set_field_value(dasm, l16, temp); + break; + + case TMS320_FLAG_K8: + temp = get_bits(dasm->opcode64, flag->f, 8); + set_field_value(dasm, K8, temp); + break; + case TMS320_FLAG_K16: + temp = get_bits(dasm->opcode64, flag->f, 16); + set_field_value(dasm, K16, temp); + break; + + case TMS320_FLAG_L7: + temp = get_bits(dasm->opcode64, flag->f, 7); + set_field_value(dasm, L7, temp); + break; + case TMS320_FLAG_L8: + temp = get_bits(dasm->opcode64, flag->f, 8); + set_field_value(dasm, L8, temp); + break; + case TMS320_FLAG_L16: + temp = get_bits(dasm->opcode64, flag->f, 16); + set_field_value(dasm, L16, temp); + break; + + case TMS320_FLAG_P8: + temp = get_bits(dasm->opcode64, flag->f, 8); + set_field_value(dasm, P8, temp); + break; + case TMS320_FLAG_P24: + temp = get_bits(dasm->opcode64, flag->f, 24); + set_field_value(dasm, P24, temp); + break; + + case TMS320_FLAG_D16: + temp = get_bits(dasm->opcode64, flag->f, 16); + set_field_value(dasm, D16, temp); + break; + + case TMS320_FLAG_SHFT: + temp = get_bits(dasm->opcode64, flag->f, 4); + set_field_value(dasm, SHFT, temp); + break; + case TMS320_FLAG_SHIFTW: + temp = get_bits(dasm->opcode64, flag->f, 6); + set_field_value(dasm, SHIFTW, temp); + break; + + case TMS320_FLAG_CCCCCCC: + temp = get_bits(dasm->opcode64, flag->f, 7); + set_field_value(dasm, CCCCCCC, temp); + break; + case TMS320_FLAG_AAAAAAAI: + temp = get_bits(dasm->opcode64, flag->f, 8); + set_field_value(dasm, AAAAAAAI, temp); + break; + + case TMS320_FLAG_uu: + temp = get_bits(dasm->opcode64, flag->f, 2); + set_field_value(dasm, uu, temp); + break; + case TMS320_FLAG_cc: + temp = get_bits(dasm->opcode64, flag->f, 2); + set_field_value(dasm, cc, temp); + break; + case TMS320_FLAG_ss: + temp = get_bits(dasm->opcode64, flag->f, 2); + set_field_value(dasm, ss, temp); + break; + case TMS320_FLAG_dd: + temp = get_bits(dasm->opcode64, flag->f, 2); + set_field_value(dasm, dd, temp); + break; + case TMS320_FLAG_mm: + temp = get_bits(dasm->opcode64, flag->f, 2); + set_field_value(dasm, mm, temp); + break; + case TMS320_FLAG_vv: + temp = get_bits(dasm->opcode64, flag->f, 2); + set_field_value(dasm, vv, temp); + break; + case TMS320_FLAG_tt: + temp = get_bits(dasm->opcode64, flag->f, 2); + set_field_value(dasm, tt, temp); + break; + + case TMS320_FLAG_XSSS: + temp = get_bits(dasm->opcode64, flag->f, 4); + set_field_value(dasm, XSSS, temp); + break; + case TMS320_FLAG_XDDD: + temp = get_bits(dasm->opcode64, flag->f, 4); + set_field_value(dasm, XDDD, temp); + break; + case TMS320_FLAG_FSSS: + temp = get_bits(dasm->opcode64, flag->f, 4); + set_field_value(dasm, FSSS, temp); + break; + case TMS320_FLAG_FDDD: + temp = get_bits(dasm->opcode64, flag->f, 4); + set_field_value(dasm, FDDD, temp); + break; + + case TMS320_FLAG_SS: + temp = get_bits(dasm->opcode64, flag->f, 2); + if (!field_valid(dasm, SS)) { + set_field_value(dasm, SS, temp); + } else { + set_field_value(dasm, SS2, temp); + } + break; + case TMS320_FLAG_DD: + temp = get_bits(dasm->opcode64, flag->f, 2); + if (!field_valid(dasm, DD)) { + set_field_value(dasm, DD, temp); + } else { + set_field_value(dasm, DD2, temp); + } + break; + + case TMS320_FLAG_XXX: + temp = get_bits(dasm->opcode64, flag->f, 3); + set_field_value(dasm, Xmem_reg, temp); + break; + case TMS320_FLAG_MMM: + temp = get_bits(dasm->opcode64, flag->f, 3); + if (!field_valid(dasm, Xmem_mmm)) { + set_field_value(dasm, Xmem_mmm, temp); + } else { + set_field_value(dasm, Ymem_mmm, temp); + } + break; + case TMS320_FLAG_Y: + temp = get_bits(dasm->opcode64, flag->f, 1) << 2; + if (!field_valid(dasm, Ymem_reg)) { + set_field_value(dasm, Ymem_reg, temp); + } else { + field_value(dasm, Ymem_reg) |= temp; + } + break; + case TMS320_FLAG_YY: + temp = get_bits(dasm->opcode64, flag->f, 2) << 0; + if (!field_valid(dasm, Ymem_reg)) { + set_field_value(dasm, Ymem_reg, temp); + } else { + field_value(dasm, Ymem_reg) |= temp; + } + break; + + default: + printf("TODO: unknown opcode flag %02x\n", flag->v); + return 0; + } + } + + return 1; +} + +int run_m_list(tms320_dasm_t * dasm) +{ + insn_mask_t * mask; + + if (!dasm->insn->m_list) + return 1; + + for (mask = dasm->insn->m_list; !m_list_last(mask); mask++) { + /* match bits in range [f, f + n] with mask's value */ + if (get_bits(dasm->opcode64, mask->f, mask->n) != mask->v) + return 0; + } + + return 1; +} + +int vreplace(char * string, const char * token, const char * fmt, va_list args) +{ + char data[64]; + char * pos; + + pos = strstr(string, token); + if (!pos) + return 0; + + vsnprintf(data, sizeof(data), fmt, args); + + memmove(pos + strlen(data), pos + strlen(token), strlen(pos + strlen(token)) + 1); + memmove(pos, data, strlen(data)); + + return 1; +} + +int replace(char * string, const char * token, const char * fmt, ...) +{ + int result; + va_list args; + + va_start(args, fmt); + result = vreplace(string, token, fmt, args); + va_end(args); + + return result; +} + +void substitute(char * string, const char * token, const char * fmt, ...) +{ + int result; + va_list args; + + do { + va_start(args, fmt); + result = vreplace(string, token, fmt, args); + va_end(args); + } while (result); +} + +const char * get_xreg_str(ut8 key, char * str) +{ + static const char * table[16] = { + "AC0", "AC1", "AC2", "AC3", "XSP", "XSSP", "XDP", "XCDP", + "XAR0", "XAR1", "XAR2", "XAR3", "XAR4", "XAR5", "XAR6", "XAR7", + }; + + return table[ key & 15 ]; +} + +const char * get_freg_str(ut8 key, char * str) +{ + static const char * table[16] = { + "AC0", "AC1", "AC2", "AC3", "T0", "T1", "T2", "T3", + "AR0", "AR1", "AR2", "AR3", "AR4", "AR5", "AR6", "AR7", + }; + + return table[ key & 15 ]; +} + +const char * get_swap_str(ut8 key, char * str) +{ + strcpy(str, "invalid"); + + switch (key) { + case 0: return "SWAP AC0, AC2"; + case 1: return "SWAP AC1, AC3"; + case 4: return "SWAP T0, T2"; + case 5: return "SWAP T1, T3"; + case 8: return "SWAP AR0, AR2"; + case 9: return "SWAP AR1, AR3"; + case 12: return "SWAP AR4, T0"; + case 13: return "SWAP AR5, T1"; + case 14: return "SWAP AR6, T2"; + case 15: return "SWAP AR7, T3"; + case 16: return "SWAPP AC0, AC2"; + case 20: return "SWAPP T0, T2"; + case 24: return "SWAPP AR0, AR2"; + case 28: return "SWAPP AR4, T0"; + case 30: return "SWAPP AR6, T2"; + case 44: return "SWAP4 AR4, T0"; + case 56: return "SWAP AR0, AR1"; + } + + return str; +} + +const char * get_relop_str(ut8 key, char * str) +{ + static const char * table[] = { + "==", "<", ">=", "!=" + }; + + return table[ key & 3 ]; +} + +const char * get_cond_str(ut8 key, char * str) +{ + strcpy(str, "reserved"); + + /* 000 FSSS ... 101 FSSS */ + if ((key >> 4) >= 0 && (key >> 4) <= 5) { + static const char * op[6] = { "==", "!=", "<", "<=", ">", ">=" }; + sprintf(str, "%s %s #0", get_freg_str(key & 15, NULL), op[(key >> 4) & 7]); + return str; + } + + /* 110 00SS */ + if ((key >> 2) == 0x18) { + sprintf(str, "overflow(AC%d)", key & 3); + return str; + } + + /* 111 00SS */ + if ((key >> 2) == 0x1C) { + sprintf(str, "!overflow(AC%d)", key & 3); + return str; + } + + switch (key) { + case 0x64: return "TC1"; + case 0x65: return "TC2"; + case 0x66: return "CARRY"; + case 0x74: return "!TC1"; + case 0x75: return "!TC2"; + case 0x76: return "!CARRY"; + /* "&" operation */ + case 0x68: return "TC1 & TC2"; + case 0x69: return "TC1 & !TC2"; + case 0x6A: return "!TC1 & TC2"; + case 0x6B: return "!TC1 & !TC2"; + /* "|" operation */ + case 0x78: return "TC1 | TC2"; + case 0x79: return "TC1 | !TC2"; + case 0x7A: return "!TC1 | TC2"; + case 0x7B: return "!TC1 | !TC2"; + /* "^" operation */ + case 0x7C: return "TC1 ^ TC2"; + case 0x7D: return "TC1 ^ !TC2"; + case 0x7E: return "!TC1 ^ TC2"; + case 0x7F: return "!TC1 ^ !TC2"; + } + + return str; +} + +const char * get_v_str(ut8 key, char * str) +{ + static const char * table[2] = { + "CARRY", "TC2", + }; + + return table[ key & 1 ]; +} + +const char * get_t_str(ut8 key, char * str) +{ + static const char * table[2] = { + "TC1", "TC2", + }; + + return table[ key & 1 ]; +} + +const char * get_cmem_str(ut8 key, char * str) +{ + static const char * table[4] = { + "*CDP", "*CDP+", "*CDP-", "*(CDP+T0)", + }; + + return table[ key & 3 ]; +} + +const char * get_smem_str(ut8 key, char * str) +{ + strcpy(str, "invalid"); + + // direct memory + if ((key & 0x01) == 0) { +#ifdef IDA_COMPATIBLE_MODE + sprintf(str, "*SP(#%Xh)", key >> 1); +#else + sprintf(str, "@%Xh", key >> 1); +#endif + return str; + } + + // indirect memory + + switch (key) { + case 0x11: return "ABS16(#k16)"; + case 0x31: return "*(#k23)"; + case 0x51: return "port(#k16)"; + case 0x71: return "*CDP"; + case 0x91: return "*CDP+"; + case 0xB1: return "*CDP−"; + case 0xD1: return "*CDP(#K16)"; + case 0xF1: return "*+CDP(#K16)"; + } + + switch (key & 0x1F) { + case 0x01: return "*ARn"; + case 0x03: return "*ARn+"; + case 0x05: return "*ARn−"; + // TODO: + // C54CM:0 => *(ARn + T0) + // C54CM:1 => *(ARn + AR0) + case 0x07: return "*(ARn + T0)"; + // TODO: + // C54CM:0 => *(ARn – T0) + // C54CM:1 => *(ARn – AR0) + case 0x09: return "*(ARn – T0)"; + // TODO: + // C54CM:0 => *ARn(T0) + // C54CM:1 => *ARn(AR0) + case 0x0B: return "*ARn(T0)"; + case 0x0D: return "*ARn(#K16)"; + case 0x0F: return "*+ARn(#K16)"; + // TODO: + // ARMS:0 => *(ARn + T1) + // ARMS:1 => *ARn(short(#1)) + case 0x13: return "*(ARn + T1)"; + // TODO: + // ARMS:0 => *(ARn - T1) + // ARMS:1 => *ARn(short(#2)) + case 0x15: return "*(ARn - T1)"; + // TODO: + // ARMS:0 => *ARn(T1) + // ARMS:1 => *ARn(short(#3)) + case 0x17: return "*ARn(T1)"; + // TODO: + // ARMS:0 => *+ARn + // ARMS:1 => *ARn(short(#4)) + case 0x19: return "*+ARn"; + // TODO: + // ARMS:0 => *-ARn + // ARMS:1 => *ARn(short(#5)) + case 0x1B: return "*-ARn"; + // TODO: + // ARMS:0 => *(ARn + T0B) + // ARMS:1 => *ARn(short(#6)) + case 0x1D: return "*(ARn + T0B)"; + // TODO: + // ARMS:0 => *(ARn - T0B) + // ARMS:1 => *ARn(short(#7)) + case 0x1F: return "*(ARn - T0B)"; + } + + return str; +} + +const char * get_mmm_str(ut8 key, char * str) +{ + switch (key & 7) { + default: + case 0x00: return "*ARn"; + case 0x01: return "*ARn+"; + case 0x02: return "*ARn−"; + // TODO: + // C54CM:0 => *(ARn + T0) + // C54CM:1 => *(ARn + AR0) + case 0x03: return "*(ARn + T0)"; + case 0x04: return "*(ARn + T1)"; + // TODO: + // C54CM:0 => *(ARn - T0) + // C54CM:1 => *(ARn - AR0) + case 0x05: return "*(ARn - T0)"; + case 0x06: return "*(ARn - T1)"; + // TODO: + // C54CM:0 => *ARn(T0) + // C54CM:1 => *ARn(AR0) + case 0x07: return "*ARn(T0)"; + }; +} + +/* + * syntax decoders + */ + +void decode_bits(tms320_dasm_t * dasm) +{ + // rounding + if (field_valid(dasm, R)) + substitute(dasm->syntax, "[R]", "%s", field_value(dasm, R) ? "R" : ""); + + // unsigned + if (field_valid(dasm, u)) + substitute(dasm->syntax, "[U]", "%s", field_value(dasm, u) ? "U" : ""); + + // 40 keyword + if (field_valid(dasm, g)) + substitute(dasm->syntax, "[40]", "%s", field_value(dasm, g) ? "40" : ""); + + // T3 update + if (field_valid(dasm, U)) + substitute(dasm->syntax, "[T3 = ]", "%s", field_value(dasm, U) ? "T3=" : ""); +} + +void decode_braces(tms320_dasm_t * dasm) +{ + char * pos; + + pos = strstr(dasm->syntax, "[(saturate]"); + if (pos) { + replace(pos, "[)", ")["); + replace(dasm->syntax, "[(saturate]", "%s", "(saturate"); + } + + if (field_valid(dasm, R)) { + pos = strstr(dasm->syntax, "[rnd(]"); + if (pos) { + replace(pos, "[)", "%s", field_value(dasm, R) ? ")[" : "["); + replace(dasm->syntax, "[rnd(]", "%s", field_value(dasm, R) ? "rnd(" : ""); + } + } + + if (field_valid(dasm, u)) { + pos = strstr(dasm->syntax, "[uns(]"); + if (pos) { + replace(pos, "[)", "%s", field_value(dasm, u) ? ")[" : "["); + replace(dasm->syntax, "[uns(]", "%s", field_value(dasm, u) ? "uns(" : ""); + } + } + + if (field_valid(dasm, uu)) { + // first + replace(dasm->syntax, "[uns(]", "%s", field_value(dasm, uu) & 1 ? "uns(" : ""); + replace(dasm->syntax, "[)]", "%s", field_value(dasm, uu) & 1 ? ")" : ""); + + replace(dasm->syntax, "[uns(]", "%s", field_value(dasm, uu) & 2 ? "uns(" : ""); + replace(dasm->syntax, "[)]", "%s", field_value(dasm, uu) & 2 ? ")" : ""); + + // second + replace(dasm->syntax, "[uns(]", "%s", field_value(dasm, uu) & 1 ? "uns(" : ""); + replace(dasm->syntax, "[)]", "%s", field_value(dasm, uu) & 1 ? ")" : ""); + + replace(dasm->syntax, "[uns(]", "%s", field_value(dasm, uu) & 2 ? "uns(" : ""); + replace(dasm->syntax, "[)]", "%s", field_value(dasm, uu) & 2 ? ")" : ""); + } + + // remove rudiments + + substitute(dasm->syntax, "[]", "%s", ""); +} + +void decode_constants(tms320_dasm_t * dasm) +{ + // signed constant + + if (field_valid(dasm, K8)) + substitute(dasm->syntax, "K8", "#%2Xh", field_value(dasm, K8)); + if (field_valid(dasm, K16)) + substitute(dasm->syntax, "K16", "#%Xh", be16(field_value(dasm, K16))); + + // unsigned constant + + if (field_valid(dasm, k4)) + substitute(dasm->syntax, "k4", "#%Xh", field_value(dasm, k4)); + if (field_valid(dasm, k5)) + substitute(dasm->syntax, "k5", "#%Xh", field_value(dasm, k5)); + if (field_valid(dasm, k8)) + substitute(dasm->syntax, "k8", "#%Xh", field_value(dasm, k8)); + + if (field_valid(dasm, k12)) + substitute(dasm->syntax, "k12", "#%Xh", be16(field_value(dasm, k12))); + if (field_valid(dasm, k16)) + substitute(dasm->syntax, "k16", "#%Xh", be16(field_value(dasm, k16))); + + if (field_valid(dasm, k4) && field_valid(dasm, k3)) + substitute(dasm->syntax, "k7", "#%Xh", (field_value(dasm, k3) << 4) | field_value(dasm, k4)); + if (field_valid(dasm, k4) && field_valid(dasm, k5)) + substitute(dasm->syntax, "k9", "#%Xh", (field_value(dasm, k5) << 4) | field_value(dasm, k4)); + + // dasm address label + + if (field_valid(dasm, D16)) + substitute(dasm->syntax, "D16", "%Xh", be16(field_value(dasm, D16))); + + // immediate shift value + + if (field_valid(dasm, SHFT)) + substitute(dasm->syntax, "SHFT", "%Xh", field_value(dasm, SHFT)); + if (field_valid(dasm, SHIFTW)) + substitute(dasm->syntax, "SHIFTW", "%Xh", field_value(dasm, SHIFTW)); +} + +void decode_addresses(tms320_dasm_t * dasm) +{ + // program address label + + if (field_valid(dasm, L7)) + substitute(dasm->syntax, "L7", "%Xh", field_value(dasm, L7)); + if (field_valid(dasm, L8)) + substitute(dasm->syntax, "L8", "%Xh", field_value(dasm, L8)); + if (field_valid(dasm, L16)) + substitute(dasm->syntax, "L16", "%Xh", be16(field_value(dasm, L16))); + + // program address label + + if (field_valid(dasm, l1) && field_valid(dasm, l3)) + substitute(dasm->syntax, "l4", "%Xh", (field_value(dasm, l3) << 1) | field_value(dasm, l1)); + + // program memory address + + if (field_valid(dasm, l7)) + substitute(dasm->syntax, "pmad", "%Xh", field_value(dasm, l7)); + if (field_valid(dasm, l16)) + substitute(dasm->syntax, "pmad", "%Xh", be16(field_value(dasm, l16))); + + // program or dasm address label + + if (field_valid(dasm, P8)) + substitute(dasm->syntax, "P8", "%Xh", field_value(dasm, P8)); + if (field_valid(dasm, P24)) + substitute(dasm->syntax, "P24", "%Xh", be24(field_value(dasm, P24))); +} + +void decode_swap(tms320_dasm_t * dasm) +{ + char tmp[64]; + + if (field_valid(dasm, k6)) + substitute(dasm->syntax, "SWAP ( )", get_swap_str(field_value(dasm, k6), tmp)); +} + +void decode_relop(tms320_dasm_t * dasm) +{ + if (field_valid(dasm, cc)) + substitute(dasm->syntax, "RELOP", get_relop_str(field_value(dasm, cc), NULL)); +} + +void decode_cond(tms320_dasm_t * dasm) +{ + char tmp[64]; + + if (field_valid(dasm, CCCCCCC)) + substitute(dasm->syntax, "cond", "%s", get_cond_str(field_value(dasm, CCCCCCC), tmp)); +} + +void decode_registers(tms320_dasm_t * dasm) +{ + ut8 code = 0; + + // transition register + + if (field_valid(dasm, r)) + substitute(dasm->syntax, "TRNx", "TRN%d", field_value(dasm, r)); + + // source and destination temporary registers + + if (field_valid(dasm, ss)) + substitute(dasm->syntax, "Tx", "T%d", field_value(dasm, ss)); + + if (field_valid(dasm, dd)) + substitute(dasm->syntax, "Tx", "T%d", field_value(dasm, dd)); + + // shifted in/out bit values + + if (field_valid(dasm, vv)) { + substitute(dasm->syntax, "BitIn", "%s", get_v_str(field_value(dasm, vv) >> 1, NULL)); + substitute(dasm->syntax, "BitOut", "%s", get_v_str(field_value(dasm, vv) >> 0, NULL)); + } + + // source and destination of CRC instruction + + if (field_valid(dasm, t)) + substitute(dasm->syntax, "TCx", "%s", get_t_str(field_value(dasm, t), NULL)); + + if (field_valid(dasm, tt)) { + substitute(dasm->syntax, "TCx", "%s", get_t_str(field_value(dasm, tt) >> 0, NULL)); + substitute(dasm->syntax, "TCy", "%s", get_t_str(field_value(dasm, tt) >> 1, NULL)); + } + + // source or destination accumulator or extended register + + if (field_valid(dasm, XSSS)) { + substitute(dasm->syntax, "xsrc", "%s", get_xreg_str(field_value(dasm, XSSS), NULL)); + substitute(dasm->syntax, "XAsrc", "%s", get_xreg_str(field_value(dasm, XSSS), NULL)); + } + + if (field_valid(dasm, XDDD)) { + substitute(dasm->syntax, "xdst", "%s", get_xreg_str(field_value(dasm, XDDD), NULL)); + substitute(dasm->syntax, "XAdst", "%s", get_xreg_str(field_value(dasm, XDDD), NULL)); + } + + // source or destination accumulator, auxiliary or temporary register + + if (field_valid(dasm, FSSS) && field_valid(dasm, FDDD)) { + if (field_value(dasm, FSSS) == field_value(dasm, FDDD)) + substitute(dasm->syntax, "[src,] dst", "dst"); + else + substitute(dasm->syntax, "[src,] dst", "src, dst"); + } + + if (field_valid(dasm, FSSS)) { + substitute(dasm->syntax, "src1", "%s", get_freg_str(field_value(dasm, FSSS), NULL)); + substitute(dasm->syntax, "src", "%s", get_freg_str(field_value(dasm, FSSS), NULL)); + substitute(dasm->syntax, "TAy", "%s", get_freg_str(field_value(dasm, FSSS), NULL)); + } + + if (field_valid(dasm, FDDD)) { + substitute(dasm->syntax, "dst1", "%s", get_freg_str(field_value(dasm, FDDD), NULL)); + substitute(dasm->syntax, "dst", "%s", get_freg_str(field_value(dasm, FDDD), NULL)); + substitute(dasm->syntax, "TAx", "%s", get_freg_str(field_value(dasm, FDDD), NULL)); + } + + // source and destination accumulator registers + + code |= field_valid(dasm, SS) ? 0x01 : 0x00; + code |= field_valid(dasm, SS2) ? 0x02 : 0x00; + code |= field_valid(dasm, DD) ? 0x10 : 0x00; + code |= field_valid(dasm, DD2) ? 0x20 : 0x00; + + switch (code) { + case 0x01: // SS + substitute(dasm->syntax, "ACx", "AC%d", field_value(dasm, SS)); + break; + case 0x03: // SSSS + substitute(dasm->syntax, "ACx", "AC%d", field_value(dasm, SS)); + substitute(dasm->syntax, "ACy", "AC%d", field_value(dasm, SS2)); + break; + case 0x11: // SS DD + if (field_value(dasm, SS) == field_value(dasm, DD)) { + substitute(dasm->syntax, "[ACx,] ACy", "AC%d", field_value(dasm, SS)); + } else { + substitute(dasm->syntax, "[ACx,] ACy", "AC%d, AC%d", field_value(dasm, SS), field_value(dasm, DD)); + } + break; + case 0x33: // SSSS DDDD + substitute(dasm->syntax, "ACx", "AC%d", field_value(dasm, SS)); + substitute(dasm->syntax, "ACy", "AC%d", field_value(dasm, SS2)); + substitute(dasm->syntax, "ACz", "AC%d", field_value(dasm, DD)); + substitute(dasm->syntax, "ACw", "AC%d", field_value(dasm, DD2)); + break; + case 0x10: // DD + substitute(dasm->syntax, "ACx", "AC%d", field_value(dasm, DD)); + break; + case 0x30: // DDDD + substitute(dasm->syntax, "ACx", "AC%d", field_value(dasm, DD)); + substitute(dasm->syntax, "ACy", "AC%d", field_value(dasm, DD2)); + break; + } +} + +void decode_addressing_modes(tms320_dasm_t * dasm) +{ + // Cmem + + if (field_valid(dasm, mm)) + substitute(dasm->syntax, "Cmem", "%s", get_cmem_str(field_value(dasm, mm), NULL)); + + // Xmem and Ymem + + if (field_valid(dasm, Xmem_reg) && field_valid(dasm, Xmem_mmm)) { + substitute(dasm->syntax, "Xmem", "%s", get_mmm_str(field_value(dasm, Xmem_mmm), NULL)); + substitute(dasm->syntax, "ARn", "AR%d", field_value(dasm, Xmem_reg)); + } + + if (field_valid(dasm, Ymem_reg) && field_valid(dasm, Ymem_mmm)) { + substitute(dasm->syntax, "Ymem", "%s", get_mmm_str(field_value(dasm, Ymem_mmm), NULL)); + substitute(dasm->syntax, "ARn", "AR%d", field_value(dasm, Ymem_reg)); + } + + // Lmem and Smem + + if (field_valid(dasm, AAAAAAAI)) { + char str[64], tmp[64]; + + snprintf(tmp, sizeof(tmp), "%s", get_smem_str(field_value(dasm, AAAAAAAI), str)); + + if (field_value(dasm, AAAAAAAI) & 1) { + if (strstr(tmp, "k16")) { + substitute(tmp, "k16", "%X", be16(*(ut16 *)(dasm->stream + dasm->length))); + dasm->length += 2; + } else if (strstr(tmp, "k23")) { + substitute(tmp, "k23", "%X", be24(*(ut32 *)(dasm->stream + dasm->length) & 0x7FFFFF)); + dasm->length += 3; + } else if (strstr(tmp, "K16")) { + substitute(tmp, "K16", "%X", be16(*(ut16 *)(dasm->stream + dasm->length))); + dasm->length += 2; + } + + substitute(tmp, "ARn", "AR%d", field_value(dasm, AAAAAAAI) >> 5); + } + + substitute(dasm->syntax, "Smem", "%s", tmp); + substitute(dasm->syntax, "Lmem", "%s", tmp); + } +} + +void decode_qualifiers(tms320_dasm_t * dasm) +{ + switch (dasm->stream[dasm->length]) { + case 0x98: + // 1001 1000 - mmap + break; + + case 0x99: + // 1001 1001 - port(Smem) + break; + case 0x9a: + // 1001 1010 - port(Smem) + break; + + case 0x9c: + // 1001 1100 - .LR + break; + case 0x9d: + // 1001 1101 - .CR + break; + } +} + +insn_item_t * decode_insn(tms320_dasm_t * dasm) +{ + dasm->length = dasm->head->size; + + snprintf(dasm->syntax, sizeof(dasm->syntax), \ + field_valid(dasm, E) && field_value(dasm, E) ? "|| %s" : "%s", dasm->insn->syntax); + + decode_bits(dasm); + decode_braces(dasm); + decode_qualifiers(dasm); + + decode_constants(dasm); + decode_addresses(dasm); + + decode_swap(dasm); + decode_relop(dasm); + decode_cond(dasm); + + decode_registers(dasm); + decode_addressing_modes(dasm); + + // cleanup rudiments + + substitute(dasm->syntax, " ", "%s", " "); // spaces + + return dasm->insn; +} + +insn_item_t * decode_insn_head(tms320_dasm_t * dasm) +{ + run_f_list(dasm); + + if (dasm->insn->i_list) { + dasm->insn = dasm->insn->i_list; + while (!i_list_last(dasm->insn)) { + if (run_m_list(dasm) && run_f_list(dasm)) + break; + dasm->insn++; + } + } + + if (!i_list_last(dasm->insn)) + return decode_insn(dasm); + + return NULL; +} + +insn_head_t * lookup_insn_head(tms320_dasm_t * dasm) +{ + int i = 0; + + static ut8 e_list[] = { + 0xF8, 0x60, /* 0110 0lll */ + 0xF0, 0xA0, /* 1010 FDDD */ + 0xFC, 0xB0, /* 1011 00DD */ + 0xF0, 0xC0, /* 1100 FSSS */ + 0xFC, 0xBC, /* 1011 11SS */ + }; + + /* handle some exceptions */ + + for (i = 0; i < ARRAY_SIZE(e_list); i += 2) { + if ((dasm->opcode & e_list[i]) == e_list[i + 1]) { + dasm->head = ht_(lookup)(dasm->map, e_list[i + 1]); + break; + } + } + + if (!dasm->head) { + dasm->head = ht_(lookup)(dasm->map, dasm->opcode); + if (!dasm->head) + dasm->head = ht_(lookup)(dasm->map_e, dasm->opcode & 0xFE); + } + + dasm->insn = dasm->head ? &dasm->head->insn : NULL; + + return dasm->head; +} + +static void init_dasm(tms320_dasm_t * dasm, const ut8 * stream, int len) +{ + strcpy(dasm->syntax, "invalid"); + memcpy(dasm->stream, stream, min(sizeof(dasm->stream), len)); + + memset(&dasm->f, 0, sizeof(dasm->f)); + + dasm->head = NULL; + dasm->insn = NULL; +} + +/* + * TMS320 disassembly engine public interface + */ + +int tms320_dasm(tms320_dasm_t * dasm, const ut8 * stream, int len) +{ + init_dasm(dasm, stream, len); + + if (lookup_insn_head(dasm)) { + if (decode_insn_head(dasm)) { + if (dasm->length <= len) + return dasm->length; + } + } + + return 0; +} + +static insn_head_t c55x_list[] = { +# include "c55x/table.h" +}; + +static insn_head_t c55x_list_e[] = { +# include "c55x/table_e.h" +}; + +int tms320_dasm_init(tms320_dasm_t * dasm) +{ + int i = 0; + + dasm->map = ht_(new)(); + dasm->map_e = ht_(new)(); + + for (i = 0; i < ARRAY_SIZE(c55x_list); i++) + ht_(insert)(dasm->map, c55x_list[i].byte, &c55x_list[i]); + + for (i = 0; i < ARRAY_SIZE(c55x_list_e); i++) + ht_(insert)(dasm->map_e, c55x_list_e[i].byte, &c55x_list_e[i]); + + return 0; +} + +int tms320_dasm_fini(tms320_dasm_t * dasm) +{ + ht_(free)(dasm->map_e); + ht_(free)(dasm->map); + + return 0; +} diff --git a/libr/asm/arch/tms320/tms320_dasm.h b/libr/asm/arch/tms320/tms320_dasm.h new file mode 100644 index 0000000000..2e0291b8d2 --- /dev/null +++ b/libr/asm/arch/tms320/tms320_dasm.h @@ -0,0 +1,223 @@ +#ifndef __TMS320_DASM_H__ +#define __TMS320_DASM_H__ + +#define IDA_COMPATIBLE_MODE 1 + +/* forward declarations */ + +struct tms320_instruction; +typedef struct tms320_instruction insn_item_t; + +struct tms320_instruction_mask; +typedef struct tms320_instruction_mask insn_mask_t; + +struct tms320_instruction_flag; +typedef struct tms320_instruction_flag insn_flag_t; + +struct tms320_instruction_head; +typedef struct tms320_instruction_head insn_head_t; + +typedef enum { + TMS320_FLAG_E = 0x10, + TMS320_FLAG_R, + TMS320_FLAG_U, + TMS320_FLAG_u, + TMS320_FLAG_g, + TMS320_FLAG_r, + TMS320_FLAG_t, + + TMS320_FLAG_uu, + TMS320_FLAG_mm, + TMS320_FLAG_cc, + TMS320_FLAG_tt, + TMS320_FLAG_vv, + TMS320_FLAG_ss, + TMS320_FLAG_dd, + TMS320_FLAG_SS, + TMS320_FLAG_DD, + + TMS320_FLAG_k3, + TMS320_FLAG_k4, + TMS320_FLAG_k5, + TMS320_FLAG_k6, + TMS320_FLAG_k8, + TMS320_FLAG_k12, + TMS320_FLAG_k16, + + TMS320_FLAG_K8, + TMS320_FLAG_K16, + + TMS320_FLAG_l1, + TMS320_FLAG_l3, + TMS320_FLAG_l7, + TMS320_FLAG_l16, + + TMS320_FLAG_L7, + TMS320_FLAG_L8, + TMS320_FLAG_L16, + + TMS320_FLAG_P8, + TMS320_FLAG_P24, + TMS320_FLAG_D16, + + TMS320_FLAG_SHFT, + TMS320_FLAG_SHIFTW, + TMS320_FLAG_CCCCCCC, + TMS320_FLAG_AAAAAAAI, + + TMS320_FLAG_FSSS, + TMS320_FLAG_FDDD, + TMS320_FLAG_XSSS, + TMS320_FLAG_XDDD, + TMS320_FLAG_XACS, + TMS320_FLAG_XACD, + + TMS320_FLAG_XXX, + TMS320_FLAG_MMM, + TMS320_FLAG_Y, + TMS320_FLAG_YY, +} insn_flag_e; + +struct tms320_instruction { +#define i_list_last(x) !(((x)->i_list || (x)->m_list || (x)->f_list || (x)->syntax)) + insn_item_t * i_list; + + insn_mask_t * m_list; + insn_flag_t * f_list; + + char * syntax; +}; + +struct tms320_instruction_mask { +#define m_list_last(x) !(((x)->f || (x)->n || (x)->v)) + ut8 f, n, v; /* from, number, value */ +}; + +struct tms320_instruction_flag { +#define f_list_last(x) !(((x)->f || (x)->v)) + ut8 f, v; /* from, value */ +}; + +struct tms320_instruction_head { + ut8 byte; + ut8 size; + insn_item_t insn; +}; + +/* + * TMS320 dasm instance + */ + +typedef struct { + insn_head_t * head; + insn_item_t * insn; + + union { + ut8 opcode; + ut8 stream[8]; + ut64 opcode64; + }; + + ut8 length; + char syntax[1024]; + +#define def_field(name, size) \ + unsigned int bf_##name##_valid:1; \ + unsigned int bf_##name##_value:size; + + struct { + def_field (E, 1); + def_field (R, 1); + def_field (U, 1); + def_field (u, 1); + def_field (g, 1); + def_field (r, 1); + def_field (t, 1); + + def_field (k3, 3); + def_field (k4, 4); + def_field (k5, 5); + def_field (k6, 6); + def_field (k8, 8); + def_field (k12, 12); + def_field (k16, 16); + + def_field (l1, 1); + def_field (l3, 3); + def_field (l7, 7); + def_field (l16, 16); + + def_field (K8, 8); + def_field (K16, 16); + + def_field (L7, 7); + def_field (L8, 8); + def_field (L16, 16); + + def_field (P8, 8); + def_field (P24, 24); + + def_field (D16, 16); + + def_field (SHFT, 4); + def_field (SHIFTW, 6); + + def_field (ss, 2); + def_field (dd, 2); + + def_field (uu, 2); + def_field (cc, 2); + def_field (mm, 2); + def_field (vv, 2); + def_field (tt, 2); + + def_field (FSSS, 4); + def_field (FDDD, 4); + def_field (XSSS, 4); + def_field (XDDD, 4); + + def_field (CCCCCCC, 7); + def_field (AAAAAAAI, 8); + + def_field (SS, 2); + def_field (SS2, 2); + def_field (DD, 2); + def_field (DD2, 2); + + // aggregates + + def_field (Xmem_mmm, 3); + def_field (Xmem_reg, 3); + + def_field (Ymem_mmm, 3); + def_field (Ymem_reg, 3); + + } f; + + RHashTable * map; + RHashTable * map_e; +} tms320_dasm_t;; + +#define field_valid(d, name) \ + (d)->f.bf_##name##_valid +#define field_value(d, name) \ + (d)->f.bf_##name##_value + +#define set_field_value(d, name, value) \ +({ \ + field_valid(d, name) = 1; \ + field_value(d, name) = value; \ +}) + +#define LIST_END { 0 } + +#define INSN_MASK(af, an, av) { .f = af, .n = an, .v = av } +#define INSN_FLAG(af, av) { .f = af, .v = TMS320_FLAG_##av } +#define INSN_SYNTAX(arg...) (char *)#arg + +extern int tms320_dasm(tms320_dasm_t *, const ut8 *, int); + +extern int tms320_dasm_init(tms320_dasm_t *); +extern int tms320_dasm_fini(tms320_dasm_t *); + +#endif /* __TMS320_DASM_H__ */ diff --git a/libr/asm/arch/tms320/tms320_p.h b/libr/asm/arch/tms320/tms320_p.h new file mode 100644 index 0000000000..f018cfb469 --- /dev/null +++ b/libr/asm/arch/tms320/tms320_p.h @@ -0,0 +1,76 @@ +#ifndef __TMS320_P_H__ +#define __TMS320_P_H__ + +#ifndef min +# define min(a,b) ((a) < (b) ? (a) : (b)) +#endif + +#ifndef ARRAY_SIZE +# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif + +#ifndef get_bits +# define get_bits(av, af, an) (((av) >> (af)) & ((2 << (an - 1)) - 1)) +#endif + +static inline ut16 le16(ut16 v) +{ + ut16 value = v; +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ + ut8 * pv = (void *)&v; + value = (pv[0] << 8) | pv[1]; +#endif + return value; +} + +static inline ut32 le24(ut32 v) +{ + ut32 value = v; +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ + ut8 * pv = (void *)&v; + value = (pv[0] << 16) | (pv[1] << 8) | pv[2]; +#endif + return value; +} + +static inline ut32 le32(ut32 v) +{ + ut32 value = v; +#if __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__ + ut8 * pv = (void *)&v; + value = (pv[0] << 24) | (pv[1] << 16) | (pv[2] << 8) | pv[3]; +#endif + return value; +} + +static inline ut16 be16(ut16 v) +{ + ut16 value = v; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + ut8 * pv = (void *)&v; + value = (pv[0] << 8) | pv[1]; +#endif + return value; +} + +static inline ut32 be24(ut32 v) +{ + ut32 value = v; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + ut8 * pv = (void *)&v; + value = (pv[0] << 16) | (pv[1] << 8) | pv[2]; +#endif + return value; +} + +static inline ut32 be32(ut32 v) +{ + ut32 value = v; +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + ut8 * pv = (void *)&v; + value = (pv[0] << 24) | (pv[1] << 16) | (pv[2] << 8) | pv[3]; +#endif + return value; +} + +#endif /* __TMS320_P_H__ */ diff --git a/libr/asm/p/Makefile b/libr/asm/p/Makefile index 1deacb8f71..1b591f42fd 100644 --- a/libr/asm/p/Makefile +++ b/libr/asm/p/Makefile @@ -13,7 +13,7 @@ ALL_TARGETS= # TODO: rename to enabled plugins ARCHS=mips.mk sparc.mk java.mk bf.mk arm.mk dalvik.mk x86_as.mk x86_nz.mk ARCHS+=ppc.mk x86_olly.mk x86.mk csr.mk x86_nasm.mk psosvm.mk avr.mk -ARCHS+=msil.mk sh.mk arm_winedbg.mk c55plus.mk gb.mk snes.mk ebc.mk malbolge.mk ws.mk +ARCHS+=msil.mk sh.mk arm_winedbg.mk c55plus.mk tms320.mk gb.mk snes.mk ebc.mk malbolge.mk ws.mk include $(ARCHS) all: ${ALL_TARGETS} diff --git a/libr/asm/p/asm_tms320.c b/libr/asm/p/asm_tms320.c new file mode 100644 index 0000000000..ebd8c1280c --- /dev/null +++ b/libr/asm/p/asm_tms320.c @@ -0,0 +1,67 @@ +/* + * TMS320 disassembly engine + * + * Written by Ilya V. Matveychikov + * + * Distributed under LGPLv3 + */ + +#include + +#include +#include +#include + +#include "../arch/tms320/tms320_dasm.h" + +static tms320_dasm_t engine = { }; + +static int tms320_disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) { + int ret = 1; + + ret = tms320_dasm(&engine, buf, len); + + snprintf(op->buf_asm, R_ASM_BUFSIZE, \ + "%s", ret < 0 ? "invalid" : engine.syntax); + + return (op->size = ret); +} + +static int tms320_set_subarch(RAsm *a, const char * name) +{ + if (strcmp(name, "C55X") == 0) { + fprintf(stderr, "C55X requested\n"); + return 1; + } + + return 0; +} + +static int tms320_init(void * user) +{ + return tms320_dasm_init(&engine); +} + +static int tms320_fini(void * user) +{ + return tms320_dasm_fini(&engine); +} + +RAsmPlugin r_asm_plugin_tms320 = { + .name = "tms320", + .arch = "tms320", + .desc = "TMS320 DSP family disassembly plugin", + .license = "LGPLv3", + .bits = 32|64, + .init = tms320_init, + .fini = tms320_fini, + .disassemble = tms320_disassemble, + .set_subarch = tms320_set_subarch, +}; + +#ifndef CORELIB +struct r_lib_struct_t radare_plugin = { + .type = R_LIB_TYPE_ASM, + .data = &r_asm_plugin_tms320 +}; +#endif diff --git a/libr/asm/p/tms320.mk b/libr/asm/p/tms320.mk new file mode 100644 index 0000000000..05940f8180 --- /dev/null +++ b/libr/asm/p/tms320.mk @@ -0,0 +1,10 @@ +OBJ_TMS320=asm_tms320.o +OBJ_TMS320+=../arch/tms320/tms320_dasm.o + +STATIC_OBJ+=${OBJ_TMS320} +TARGET_TMS320=asm_tms320.${EXT_SO} + +ALL_TARGETS+=${TARGET_TMS320} + +${TARGET_TMS320}: ${OBJ_TMS320} + ${CC} $(call libname,asm_tms320) ${LDFLAGS} ${CFLAGS} ${OBJ_TMS320} diff --git a/libr/include/r_asm.h b/libr/include/r_asm.h index 68f9c66406..ea6d15d08a 100644 --- a/libr/include/r_asm.h +++ b/libr/include/r_asm.h @@ -182,6 +182,7 @@ extern RAsmPlugin r_asm_plugin_rar; extern RAsmPlugin r_asm_plugin_dcpu16; extern RAsmPlugin r_asm_plugin_8051; extern RAsmPlugin r_asm_plugin_c55plus; +extern RAsmPlugin r_asm_plugin_tms320; extern RAsmPlugin r_asm_plugin_gb; extern RAsmPlugin r_asm_plugin_snes; extern RAsmPlugin r_asm_plugin_ebc; diff --git a/plugins.def.cfg b/plugins.def.cfg index 8089cc47f5..0926e93817 100644 --- a/plugins.def.cfg +++ b/plugins.def.cfg @@ -30,6 +30,7 @@ asm.i8080 asm.8051 asm.msil asm.c55plus +asm.tms320 asm.gb asm.snes asm.ebc