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
152 DEF_ASM(movsbl)152 DEF_ASM(movsbl)
153 DEF_ASM(movswl)153 DEF_ASM(movswl)
154#ifdef TCC_TARGET_X86_64154#ifdef TCC_TARGET_X86_64
155 DEF_ASM(movsbq)
156 DEF_ASM(movswq)
157 DEF_ASM(movzwq)
155 DEF_ASM(movslq)158 DEF_ASM(movslq)
156#endif159#endif
157 160
tests/asmtest.S+7−0
@@ -86,6 +86,13 @@ movl %ebx, %fs · 85 unmodified lines
86 movzb 0x1000, %eax86 movzb 0x1000, %eax
87 movzb 0x1000, %ax87 movzb 0x1000, %ax
88 88
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
89 96
90#ifdef __i386__97#ifdef __i386__
91 pushl %eax98 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
114ALT(DEF_ASM_OP2(movw, 0x0f22, 0, OPC_MODRM | OPC_WLQ, OPT_REG64, OPT_CR))114ALT(DEF_ASM_OP2(movw, 0x0f22, 0, OPC_MODRM | OPC_WLQ, OPT_REG64, OPT_CR))
115ALT(DEF_ASM_OP2(movw, 0x0f23, 0, OPC_MODRM | OPC_WLQ, OPT_REG64, OPT_DB))115ALT(DEF_ASM_OP2(movw, 0x0f23, 0, OPC_MODRM | OPC_WLQ, OPT_REG64, OPT_DB))
116 116
117ALT(DEF_ASM_OP2(movsbl, 0x0fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REG32))
118ALT(DEF_ASM_OP2(movsbw, 0x0fbe, 0, OPC_MODRM | OPC_D16, OPT_REG8 | OPT_EA, OPT_REG16))117ALT(DEF_ASM_OP2(movsbw, 0x0fbe, 0, OPC_MODRM | OPC_D16, OPT_REG8 | OPT_EA, OPT_REG16))
118ALT(DEF_ASM_OP2(movsbl, 0x0fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REG32))
119ALT(DEF_ASM_OP2(movsbq, 0x0fbe, 0, OPC_MODRM, OPT_REG8 | OPT_EA, OPT_REGW))
119ALT(DEF_ASM_OP2(movswl, 0x0fbf, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG32))120ALT(DEF_ASM_OP2(movswl, 0x0fbf, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG32))
121ALT(DEF_ASM_OP2(movswq, 0x0fbf, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG))
120ALT(DEF_ASM_OP2(movslq, 0x4863, 0, OPC_MODRM, OPT_REG32 | OPT_EA, OPT_REG))122ALT(DEF_ASM_OP2(movslq, 0x4863, 0, OPC_MODRM, OPT_REG32 | OPT_EA, OPT_REG))
121ALT(DEF_ASM_OP2(movzbw, 0x0fb6, 0, OPC_MODRM | OPC_WLQ, OPT_REG8 | OPT_EA, OPT_REGW))123ALT(DEF_ASM_OP2(movzbw, 0x0fb6, 0, OPC_MODRM | OPC_WLQ, OPT_REG8 | OPT_EA, OPT_REGW))
122ALT(DEF_ASM_OP2(movzwl, 0x0fb7, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG32))124ALT(DEF_ASM_OP2(movzwl, 0x0fb7, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG32))
125ALT(DEF_ASM_OP2(movzwq, 0x0fb7, 0, OPC_MODRM, OPT_REG16 | OPT_EA, OPT_REG))
123 126
124ALT(DEF_ASM_OP1(pushq, 0x6a, 0, 0, OPT_IM8S))127ALT(DEF_ASM_OP1(pushq, 0x6a, 0, 0, OPT_IM8S))
125ALT(DEF_ASM_OP1(push, 0x6a, 0, 0, OPT_IM8S))128ALT(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