Commit Graph

4 Commits

Author SHA1 Message Date
Oliver Stannard 28d2edad5b Add ARM RTABI aliases for half-precision conversions
The ARM RTABI defines these functions as __aeabi_h2f, __aeabi_f2h and
__aeabi_d2h, so we need aliases for them.

llvm-svn: 249559
2015-10-07 16:15:22 +00:00
Saleem Abdulrasool e6f9652a22 builtins: Use MSVC-equivalents of attributes
This allows us to build the builtins using MSVC.  NFC.

Patch by Tee Hao Wei!

llvm-svn: 249375
2015-10-06 04:33:05 +00:00
Ahmed Bougacha 9a43d5be2f [Builtins] Implement f2h/h2f by jumping to trunc/extend.
Follow-up to r237161; seems like we can't use aliases, but we
can do better than duplicating the bodies, especially when that
body, after inlining, isn't as small as it looks.

Better approaches welcome.  Perhaps the best thing is just to have
an #ifndef __APPLE__ over the GNUEABI names, since they're not used
there.

llvm-svn: 237323
2015-05-14 00:50:28 +00:00
Ahmed Bougacha f1ac850e77 [Builtins] Implement half-precision conversions.
Mostly uninteresting, except:
- in __extendXfYf2, when checking if the number is normal, the old
  code relied on the unsignedness of src_rep_t, which is a problem
  when sizeof(src_rep_t) < sizeof(int): the result gets promoted to
  int, the signedness of which breaks the comparison.
  I added an explicit cast; it shouldn't affect other types.
- we can't pass __fp16, so src_t and src_rep_t are the same.
- the gnu_*_ieee symbols are simply duplicated definitions, as aliases
  are problematic on mach-o (where only weak aliases are supported;
  that's not what we want).

Differential Revision: http://reviews.llvm.org/D9693

llvm-svn: 237161
2015-05-12 18:33:42 +00:00