Skip to content

Bit operations on float #388

Open
Open
@TechPizzaDev

Description

@TechPizzaDev

Is there reason behind float SIMD not implementing bitwise operations?
I could not find much on this topic other than this comment.

This is severely annoying when it comes to porting algorithms that rely on bit manipulation of float values, like XOR for signs, or AND for masking off bits.

Is it because Simd<f32, N> is modelling the f32 primitive? Even then, I feel like this should be reconsidered. The workaround is messy (from_bits(lhs.to_bits() op rhs.to_bits())) and writing generic code that uses bitwise operators is not feasible since you can't implement operators for external crates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: a feature request, i.e. not implemented / a PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions