Legalize fcvt_to_sint and fcvt_to_uint for Intel64.
We need to generate traps on NaN and overflow.
This commit is contained in:
@@ -22,14 +22,53 @@ ebb0(v0: i32):
|
||||
return v1
|
||||
}
|
||||
|
||||
; function %i32_trunc_s_f32(f32) -> i32
|
||||
; function %i32_trunc_u_f32(f32) -> i32
|
||||
; function %i32_trunc_s_f64(f64) -> i32
|
||||
; function %i32_trunc_u_f64(f64) -> i32
|
||||
; function %i64_trunc_s_f32(f32) -> i64
|
||||
; function %i64_trunc_u_f32(f32) -> i64
|
||||
; function %i64_trunc_s_f64(f64) -> i64
|
||||
; function %i64_trunc_u_f64(f64) -> i64
|
||||
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):
|
||||
|
||||
Reference in New Issue
Block a user