-
Notifications
You must be signed in to change notification settings - Fork 102
Add copysignf16
, copysignf128
, fabsf16
, and fabsf128
#320
Conversation
eb24e93
to
965cf5a
Compare
Using traits blocks us from using functions in |
It would indeed prevent us from making any of the public functions I have some more details here if you are interested #310 |
Who has decided this? |
It has been a goal for a while to make the float math functions available in The existing implementations aren't going away either. Generic methods just make it easier to support |
9e343ff
to
87f0631
Compare
copysignf16
, copysignf128
, fabsf16
, and fabsf128
87f0631
to
733b768
Compare
1351a39
to
5c3a925
Compare
874a9ed
to
44bf8aa
Compare
5dfa781
to
5e1b9d7
Compare
In preparation of adding routines from these two types, duplicate the `compiler-builtins` configuration here.
Add generic versions of `abs` and `copysign`. Make use of it for the `f32` and `f64` versions of these functions.
Use the generic algorithm to make these two functions available whenever `f16_enabled` or `f128_enabled` are true. These require the `unstable` feature.
5e1b9d7
to
c808fe6
Compare
Superseded by a handful of PRs, including #386. |
Add generic versions of
abs
andcopysign
, which is used to implementf16
andf128
versions of these functions. These currently aren't tested because the builtinmusl
tests don't provide a reference, but the implementations are straightforward and we will be able to test against #311 once it lands. (Technically musl on aarch64 hasfabsl
andcopysignl
asf128
, but I don't think it is worth updating the serialization tests).The second commit ("Add float and integer traits...") just copies the exact trait implementations that we use in
compiler-builtins
, with the assumption that we will use it more in the future and for testing.The third commit ("Add f16 and f128 configuration...") copies the logic from
compiler-builtins
for settingenable_f16
andenable_f128
with the exception that here, theunstable
feature must also be enabled. This will probably need to be tweaked a bit in the future so it isn't tied to other behavior enabled byunstable
, but this is enough to get us started.