aarch64: Fix i128 of/nof implementations (#4403)

@yuyang-ok reported via zulip that i128 overflow tests were:
1. different from the interpreter implementation
2. wrong on some of the test cases

This fixes both the tests and the aarch64 implementation and adds the
interpreter to the testsuite.
This commit is contained in:
Afonso Bordado
2022-07-07 19:00:58 +01:00
committed by GitHub
parent 6a5fe20956
commit e9727b9d4b
4 changed files with 95 additions and 43 deletions

View File

@@ -158,9 +158,12 @@ block0(v0: i128, v1: i128):
}
; block0:
; adds xzr, x0, x2
; adcs xzr, x1, x3
; cset x0, vs
; subs xzr, x0, x2
; sbcs x11, x1, x3
; eor x13, x1, x3
; eor x11, x1, x11
; ands xzr, x13, x11
; cset x0, lt
; ret
function %icmp_nof_i128(i128, i128) -> b1 {
@@ -170,9 +173,12 @@ block0(v0: i128, v1: i128):
}
; block0:
; adds xzr, x0, x2
; adcs xzr, x1, x3
; cset x0, vc
; subs xzr, x0, x2
; sbcs x11, x1, x3
; eor x13, x1, x3
; eor x11, x1, x11
; ands xzr, x13, x11
; cset x0, ge
; ret
function %f(i64, i64) -> i64 {
@@ -510,9 +516,12 @@ block1:
}
; block0:
; adds xzr, x0, x2
; adcs xzr, x1, x3
; b.vs label1 ; b label2
; subs xzr, x0, x2
; sbcs x9, x1, x3
; eor x11, x1, x3
; eor x9, x1, x9
; ands xzr, x11, x9
; b.lt label1 ; b label2
; block1:
; b label3
; block2:
@@ -530,9 +539,12 @@ block1:
}
; block0:
; adds xzr, x0, x2
; adcs xzr, x1, x3
; b.vc label1 ; b label2
; subs xzr, x0, x2
; sbcs x9, x1, x3
; eor x11, x1, x3
; eor x9, x1, x9
; ands xzr, x11, x9
; b.ge label1 ; b label2
; block1:
; b label3
; block2: