Fix a type error in the legalizer patterns.

The carry and borrow values are boolean, so we have to convert them to
an integer type with bint(c) before we can add them to the result.

Also tweak the default legalizer action for unsupported types: Only
attempt a narrowing pattern for lane types > 32 bits.

This was found by @angusholder's new type checks in the verifier.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-29 14:40:12 -07:00
parent a5d4839002
commit 62641d4553
4 changed files with 19 additions and 9 deletions

View File

@@ -96,7 +96,7 @@ ebb0(v0: i64x4):
; check: $(v0d=$V) = iconcat $v0dl, $v0dh
; check: $(v0cd=$V) = vconcat $v0c, $v0d
; check: $(v0abcd=$V) = vconcat $v0ab, $v0cd
v1 = iadd v0, v0
v1 = bxor v0, v0
; check: $(v1ab=$V), $(v1cd=$V) = vsplit
; check: $(v1a=$V), $(v1b=$V) = vsplit $v1ab
; check: $(v1al=$V), $(v1ah=$V) = isplit $v1a

View File

@@ -57,8 +57,8 @@ ebb0(v1: i64, v2: i64):
; check: $(c=$V) = icmp ult, $v3l, $v1l
; check: [R#0c
; sameln: $(v3h1=$V) = iadd $v1h, $v2h
; TODO: This doesn't typecheck. We need to convert the b1 result to i32.
; check: $(c_int=$V) = bint.i32 $c
; check: [R#0c
; sameln: $(v3h=$V) = iadd $v3h1, $c
; sameln: $(v3h=$V) = iadd $v3h1, $c_int
; check: $v3 = iconcat $v3l, $v3h
; check: return $v3l, $v3h