History

x86-64-asm: Add mov[sz]xq opcodes

This adds the zero/sign-extending opcodes with 64bit destinations.

Michael Matz committed 10 years ago

Commit 6bd8c931 parent b9f01df3 files · +14 −1Browse files

Unified · Split

3 files
  1. i386-tok.h +3 −0
  2. tests/asmtest.S +7 −0
  3. x86_64-asm.h +4 −1
i386-tok.h+3−0
@@ -152,6 +152,9 @@ · 151 unmodified lines
152152 DEF_ASM(movsbl)
153153 DEF_ASM(movswl)
154154 #ifdef TCC_TARGET_X86_64
155+ DEF_ASM(movsbq)
156+ DEF_ASM(movswq)
157+ DEF_ASM(movzwq)
155158 DEF_ASM(movslq)
156159 #endif
157160
tests/asmtest.S+7−0
@@ -86,6 +86,13 @@ movl %ebx, %fs · 85 unmodified lines
8686 movzb 0x1000, %eax
8787 movzb 0x1000, %ax
8888
89+#ifdef __x86_64__
90+ movzb 0x1000, %rax
91+ movzbq 0x1000, %rbx
92+ movsbq 0x1000, %rdx
93+ movzwq 0x1000, %rdi
94+ movswq 0x1000, %rdx
95+#endif
8996
9097 #ifdef __i386__
9198 pushl %eax
x86_64-asm.h+4−1
@@ -114,12 +114,15 @@ ALT(DEF_ASM_OP2(movw, 0x0f21, 0, OPC_MODRM | OPC_WLQ, OPT_DB, OPT_REG64)) · 113 unmodified lines
114114 ALT(DEF_ASM_OP2(movw, 0x0f22, 0, OPC_MODRM | OPC_WLQ, OPT_REG64, OPT_CR))
115115 ALT(DEF_ASM_OP2(movw, 0x0f23, 0, OPC_MODRM | OPC_WLQ, OPT_REG64, OPT_DB))
116116
117−ALT(DEF_ASM_OP2(movsbl, 0x0fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REG32))
118117 ALT(DEF_ASM_OP2(movsbw, 0x0fbe, 0, OPC_MODRM | OPC_D16, OPT_REG8 | OPT_EA, OPT_REG16))
118+ALT(DEF_ASM_OP2(movsbl, 0x0fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REG32))
119+ALT(DEF_ASM_OP2(movsbq, 0x0fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REGW))
119120 ALT(DEF_ASM_OP2(movswl, 0x0fbf, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG32))
121+ALT(DEF_ASM_OP2(movswq, 0x0fbf, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG))
120122 ALT(DEF_ASM_OP2(movslq, 0x4863, 0, OPC_MODRM, OPT_REG32 | OPT_EA, OPT_REG))
121123 ALT(DEF_ASM_OP2(movzbw, 0x0fb6, 0, OPC_MODRM | OPC_WLQ, OPT_REG8 | OPT_EA, OPT_REGW))
122124 ALT(DEF_ASM_OP2(movzwl, 0x0fb7, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG32))
125+ALT(DEF_ASM_OP2(movzwq, 0x0fb7, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG))
123126
124127 ALT(DEF_ASM_OP1(pushq, 0x6a, 0, 0, OPT_IM8S))
125128 ALT(DEF_ASM_OP1(push, 0x6a, 0, 0, OPT_IM8S))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t