[PATCH] D140639: clang: Fix handling of __builtin_elementwise_copysign

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 23 15:13:45 PST 2022


arsenm created this revision.
arsenm added a reviewer: fhahn.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.

  I realized the handling of copysign made no sense at all.
  Only the type of the first operand should really matter, and
  it should not perform a conversion between them.


Also fixes misleading errors and producing broken IR for
integers.

      

We could accept different FP types for the sign argument,
if the intrinsic permitted different types like the DAG node.
As it is we would need to insert a cast, which could have
other effects (like trapping on snan) which should not happen
for a copysign.


https://reviews.llvm.org/D140639

Files:
  clang/lib/Sema/SemaChecking.cpp
  clang/test/CodeGen/builtins-elementwise-math.c
  clang/test/Sema/builtins-elementwise-math.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140639.485162.patch
Type: text/x-patch
Size: 12080 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221223/91ffd1ab/attachment.bin>


More information about the cfe-commits mailing list