Files
wasmtime/cranelift/filetests/wasm/conversions.cton
Dan Gohman 4e67e08efd Use the target-lexicon crate.
This switches from a custom list of architectures to use the
target-lexicon crate.

 - "set is_64bit=1; isa x86" is replaced with "target x86_64", and
   similar for other architectures, and the `is_64bit` flag is removed
   entirely.

 - The `is_compressed` flag is removed too; it's no longer being used to
   control REX prefixes on x86-64, ARM and Thumb are separate
   architectures in target-lexicon, and we can figure out how to
   select RISC-V compressed encodings when we're ready.
2018-05-30 06:13:35 -07:00

155 lines
2.6 KiB
Plaintext

; Test code generation for WebAssembly type conversion operators.
test compile
target x86_64 haswell
function %i32_wrap_i64(i64) -> i32 {
ebb0(v0: i64):
v1 = ireduce.i32 v0
return v1
}
function %i64_extend_s_i32(i32) -> i64 {
ebb0(v0: i32):
v1 = sextend.i64 v0
return v1
}
function %i64_extend_u_i32(i32) -> i64 {
ebb0(v0: i32):
v1 = uextend.i64 v0
return v1
}
function %i32_trunc_s_f32(f32) -> i32 {
ebb0(v0: f32):
v1 = fcvt_to_sint.i32 v0
return v1
}
function %i32_trunc_u_f32(f32) -> i32 {
ebb0(v0: f32):
v1 = fcvt_to_uint.i32 v0
return v1
}
function %i32_trunc_s_f64(f64) -> i32 {
ebb0(v0: f64):
v1 = fcvt_to_sint.i32 v0
return v1
}
function %i32_trunc_u_f64(f64) -> i32 {
ebb0(v0: f64):
v1 = fcvt_to_uint.i32 v0
return v1
}
function %i64_trunc_s_f32(f32) -> i64 {
ebb0(v0: f32):
v1 = fcvt_to_sint.i64 v0
return v1
}
function %i64_trunc_u_f32(f32) -> i64 {
ebb0(v0: f32):
v1 = fcvt_to_uint.i64 v0
return v1
}
function %i64_trunc_s_f64(f64) -> i64 {
ebb0(v0: f64):
v1 = fcvt_to_sint.i64 v0
return v1
}
function %i64_trunc_u_f64(f64) -> i64 {
ebb0(v0: f64):
v1 = fcvt_to_uint.i64 v0
return v1
}
function %f32_trunc_f64(f64) -> f32 {
ebb0(v0: f64):
v1 = fdemote.f32 v0
return v1
}
function %f64_promote_f32(f32) -> f64 {
ebb0(v0: f32):
v1 = fpromote.f64 v0
return v1
}
function %f32_convert_s_i32(i32) -> f32 {
ebb0(v0: i32):
v1 = fcvt_from_sint.f32 v0
return v1
}
function %f32_convert_u_i32(i32) -> f32 {
ebb0(v0: i32):
v1 = fcvt_from_uint.f32 v0
return v1
}
function %f64_convert_s_i32(i32) -> f64 {
ebb0(v0: i32):
v1 = fcvt_from_sint.f64 v0
return v1
}
function %f64_convert_u_i32(i32) -> f64 {
ebb0(v0: i32):
v1 = fcvt_from_uint.f64 v0
return v1
}
function %f32_convert_s_i64(i64) -> f32 {
ebb0(v0: i64):
v1 = fcvt_from_sint.f32 v0
return v1
}
function %f32_convert_u_i64(i64) -> f32 {
ebb0(v0: i64):
v1 = fcvt_from_uint.f32 v0
return v1
}
function %f64_convert_s_i64(i64) -> f64 {
ebb0(v0: i64):
v1 = fcvt_from_sint.f64 v0
return v1
}
function %f64_convert_u_i64(i64) -> f64 {
ebb0(v0: i64):
v1 = fcvt_from_uint.f64 v0
return v1
}
function %i32_reinterpret_f32(f32) -> i32 {
ebb0(v0: f32):
v1 = bitcast.i32 v0
return v1
}
function %f32_reinterpret_i32(i32) -> f32 {
ebb0(v0: i32):
v1 = bitcast.f32 v0
return v1
}
function %i64_reinterpret_f64(f64) -> i64 {
ebb0(v0: f64):
v1 = bitcast.i64 v0
return v1
}
function %f64_reinterpret_i64(i64) -> f64 {
ebb0(v0: i64):
v1 = bitcast.f64 v0
return v1
}