llvm-project
llvm-project copied to clipboard
[mc] s_mulk_i32 to check that immediate operand fits into 16 bits
| 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).
closed by commit r301418
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
;
assigned to @dpreobra