0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

insns.dat: add MOVSX -> CBW/CWDE/CDQE optimiztion; add MOVZX[D]

Add MOVSX[D] -> CBW/CWDE/CDQE optimization patterns when the suitable
form of the AX register are referenced.

Add MOVZX reg64,rm32 pattern which converts to a 32-bit MOV.

Add MOVZXD reg64,rm32 alias pattern for consistency.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2024-08-04 16:21:52 -07:00
parent de84c3dcc0
commit 19a6fca486
2 changed files with 40 additions and 1 deletions

33
test/movszx.asm Normal file
View File

@@ -0,0 +1,33 @@
bits 64
movsx ax,al
movsx eax,al
movsx eax,ax
movsx rax,al
movsx rax,ax
movsx rax,eax
movsxd rax,eax
movsx cx,cl
movsx ecx,cl
movsx ecx,cx
movsx rcx,cl
movsx rcx,cx
movsx rcx,ecx
movsxd rcx,ecx
movzx ax,al
movzx eax,al
movzx eax,ax
movzx rax,al
movzx rax,ax
movzx rax,eax
movzxd rax,eax
movzx cx,cl
movzx ecx,cl
movzx ecx,cx
movzx rcx,cl
movzx rcx,cx
movzx rcx,ecx
movzxd rcx,ecx