Add commutative addition cases

This commit is contained in:
Alex Crichton
2021-11-19 07:00:04 -08:00
parent 7412461b7b
commit 98ce029bbd
4 changed files with 168 additions and 44 deletions

View File

@@ -10,8 +10,19 @@ block0(v0: i8):
return v3
}
; check: movz x1, #42
; nextln: add x0, x1, x0, SXTB
; check: sxtb x0, w0
; nextln: add x0, x0, #42
; nextln: ret
function %f2(i8, i64) -> i64 {
block0(v0: i8, v1: i64):
v2 = sextend.i64 v0
v3 = iadd.i64 v2, v1
return v3
}
; check: add x0, x1, x0, SXTB
; nextln: ret