[PATCH] D86398: [X86] Enable constexpr on _cast fp<-> uint intrinsics (PR31446)

Simon Pilgrim via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 22 07:30:30 PDT 2020


RKSimon created this revision.
RKSimon added reviewers: rsmith, craig.topper, erichkeane.
Herald added a project: clang.
RKSimon requested review of this revision.

As suggested by @rsmith on PR47267, by replacing the __builtin_memcpy bitcast pattern with __builtin_bit_cast we can use _castf32_u32, _castu32_f32, _castf64_u64 and _castu64_f64 inside constant expresssions (constexpr). Although __builtin_bit_cast was added for c++20 it works on all clang c/c++ modes.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86398

Files:
  clang/docs/ReleaseNotes.rst
  clang/lib/Headers/ia32intrin.h
  clang/test/CodeGen/x86-builtins.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86398.287190.patch
Type: text/x-patch
Size: 6538 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200822/ec794637/attachment-0001.bin>


More information about the cfe-commits mailing list