Skip to content

Commit

Permalink
Faster f64 equality (#3060)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Nov 9, 2022
1 parent 8d75101 commit 6b3a0a2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arrow-array/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ macro_rules! native_type_float_op {
}

fn is_eq(self, rhs: Self) -> bool {
self.total_cmp(&rhs).is_eq()
// Equivalent to `self.total_cmp(&rhs).is_eq()`
// but LLVM isn't able to realise this is bitwise equality
// https://rust.godbolt.org/z/347nWGxoW
self.to_bits() == rhs.to_bits()
}

fn is_ne(self, rhs: Self) -> bool {
Expand Down

0 comments on commit 6b3a0a2

Please sign in to comment.