floats iter 4.3: codegen Float comparison arms (fcmp olt/ole/ogt/oge/UNE) + lower_eq Float
This commit is contained in:
@@ -281,6 +281,15 @@ pub(crate) fn builtin_binop_typed(
|
||||
("<=", true, _) => Some(("icmp sle", "i64", "i1")),
|
||||
(">", true, _) => Some(("icmp sgt", "i64", "i1")),
|
||||
(">=", true, _) => Some(("icmp sge", "i64", "i1")),
|
||||
// Float comparison arms (Floats iter 4.3). Note: `!=` Float
|
||||
// uses `fcmp une` ("unordered or not equal") — NOT `one`
|
||||
// ("ordered and not equal"), which would return `false` for
|
||||
// `nan != nan` and violate IEEE / spec A5.
|
||||
("!=", _, true) => Some(("fcmp une", "double", "i1")),
|
||||
("<", _, true) => Some(("fcmp olt", "double", "i1")),
|
||||
("<=", _, true) => Some(("fcmp ole", "double", "i1")),
|
||||
(">", _, true) => Some(("fcmp ogt", "double", "i1")),
|
||||
(">=", _, true) => Some(("fcmp oge", "double", "i1")),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user