riscv64: improve unordered comparison generated code (#5636)

Improve the generated code for unordered floating point comparisons by negating the comparison and inveritng the branches. This allows us to pick the unordered versions, which generate significantly better code.
This commit is contained in:
Trevor Elliott
2023-01-25 17:28:28 -08:00
committed by GitHub
parent 4ad86752de
commit 7926808e8e
4 changed files with 71 additions and 6 deletions

View File

@@ -616,6 +616,18 @@ macro_rules! isle_common_prelude_methods {
cc.inverse()
}
fn floatcc_unordered(&mut self, cc: &FloatCC) -> bool {
match *cc {
FloatCC::Unordered
| FloatCC::UnorderedOrEqual
| FloatCC::UnorderedOrLessThan
| FloatCC::UnorderedOrLessThanOrEqual
| FloatCC::UnorderedOrGreaterThan
| FloatCC::UnorderedOrGreaterThanOrEqual => true,
_ => false,
}
}
#[inline]
fn unpack_value_array_2(&mut self, arr: &ValueArray2) -> (Value, Value) {
let [a, b] = *arr;