Commit Graph

2 Commits

Author SHA1 Message Date
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