llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[mc] s_mulk_i32 to check that immediate operand fits into 16 bits

Open llvmbot opened this issue 10 years ago • 3 comments

Bugzilla Link 30827
Resolution FIXED
Resolved on Apr 26, 2017 09:29
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @atamazov,@dpreobra

Extended Description

If immediate operand doesn't fit into instruction assembler just silently truncates it. For example: s_mulk_i32 s2, 0x8000 * 4

Assembler will produce following isa without any warning or error: s_mulk_i32 s2, 0x0000 // 00000000077C: B7820000

We need to check such cases and show appropriate message (error).

llvmbot avatar Oct 28 '16 20:10 llvmbot

closed by commit r301418

dpreobra avatar Apr 26 '17 16:04 dpreobra

Another example (only last 16 bit of immediate get encoded):

s_cmpk_ge_u32 s0, 280123 ^ .text s_cmpk_ge_u32 s0, 0x4463b ; encoding: [0x3b,0x46,0x80,0xb5] ; <MCInst #​3882 S_CMPK_GE_U32_vi ; ; >

llvmbot avatar Apr 17 '17 15:04 llvmbot

assigned to @dpreobra

llvmbot avatar Oct 28 '16 20:10 llvmbot