Implement shift-immediate encodings for x86 (#283)
* add x86 encodings for shift-immediate instructions implements encodings for ishl_imm, sshr_imm, and ushr_imm. uses 8-bit immediates. added tests for the encodings to intel/binary64.cton. Canonical versions come from llvm-mc. * translate test to use shift-immediates * shift immediate encodings: use enc_i32_i64 and note why the regular shift encodings cant use it above * add additional encoding tests for shift immediates this covers 32 bit mode, and 64 bit operations in 64 bit mode.
This commit is contained in:
@@ -403,6 +403,13 @@ ebb0:
|
||||
; asm: addl $-2147483648, %esp
|
||||
adjust_sp_imm -2147483648 ; bin: 81 c4 80000000
|
||||
|
||||
; Shift immediates
|
||||
; asm: shll $2, %esi
|
||||
[-,%rsi] v513 = ishl_imm v2, 2 ; bin: c1 e6 02
|
||||
; asm: sarl $5, %esi
|
||||
[-,%rsi] v514 = sshr_imm v2, 5 ; bin: c1 fe 05
|
||||
; asm: shrl $8, %esi
|
||||
[-,%rsi] v515 = ushr_imm v2, 8 ; bin: c1 ee 08
|
||||
|
||||
; asm: testl %ecx, %ecx
|
||||
; asm: je ebb1
|
||||
|
||||
Reference in New Issue
Block a user