* Add encodings for i8 and i16 copy, spill, fill, ireduce.i8.i16
Also adds legalization for srem, irsub_imm, {u,s}extend.i16.i8
Fixes #477 cc #466
* Legalize popcnt, clz and ctz for i8 and i16
* Fix bug in call_memset
26 lines
654 B
Plaintext
26 lines
654 B
Plaintext
test compile
|
|
target x86_64
|
|
|
|
; regex: V=v\d+
|
|
|
|
function u0:0(i8) -> i8, i8 fast {
|
|
ebb0(v0: i8):
|
|
v1 = clz v0
|
|
; check: v3 = uextend.i32 v0
|
|
; nextln: v6 = iconst.i32 -1
|
|
; nextln: v7 = iconst.i32 31
|
|
; nextln: v8, v9 = x86_bsr v3
|
|
; nextln: v10 = selectif.i32 eq v9, v6, v8
|
|
; nextln: v4 = isub v7, v10
|
|
; nextln: v5 = iadd_imm v4, -24
|
|
; nextln: v1 = ireduce.i8 v5
|
|
v2 = ctz v0
|
|
; nextln: v11 = uextend.i32 v0
|
|
; nextln: v12 = bor_imm v11, 256
|
|
; nextln: v14 = iconst.i32 32
|
|
; nextln: v15, v16 = x86_bsf v12
|
|
; nextln: v13 = selectif.i32 eq v16, v14, v15
|
|
; nextln: v2 = ireduce.i8 v13
|
|
return v1, v2
|
|
}
|