Add Intel legalization for fmin and fmax.

The native x86_fmin and x86_fmax instructions don't behave correctly for
NaN inputs and when comparing +0.0 to -0.0, so we need separate branches
for those cases.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-27 11:02:57 -07:00
parent 384b04b411
commit b6b474a8c9
5 changed files with 136 additions and 5 deletions

View File

@@ -82,8 +82,17 @@ ebb0(v0: f64, v1: f64):
return v2
}
; function %f64_min(f64, f64) -> f64
; function %f64_max(f64, f64) -> f64
function %f64_min(f64, f64) -> f64 {
ebb0(v0: f64, v1: f64):
v2 = fmin v0, v1
return v2
}
function %f64_max(f64, f64) -> f64 {
ebb0(v0: f64, v1: f64):
v2 = fmax v0, v1
return v2
}
function %f64_copysign(f64, f64) -> f64 {
ebb0(v0: f64, v1: f64):