Check for invalid special type constraints.

The extend and reduce instructions have additional type constraints.

Stop inserting sextend instructions after ctz, clz, and popcnt when
translating from WebAssembly. The Cretonne instructions have the same
signature as the WebAssembly equivalents.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-28 16:22:04 -07:00
parent 2888ff5bf3
commit 53404a9387
3 changed files with 74 additions and 16 deletions

View File

@@ -95,3 +95,17 @@ function %jump_args2() {
ebb1(v10: i64, v11: i16):
return
}
function %bad_extend() {
ebb0:
v0 = iconst.i32 10
v1 = uextend.i16 v0 ; error: input i32 must be smaller than output i16
return
}
function %bad_reduce() {
ebb0:
v0 = iconst.i32 10
v1 = ireduce.i64 v0 ; error: input i32 must be larger than output i64
return
}