[PATCH] D153233: clang: Add __builtin_elementwise_rint and nearbyint

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 19 03:50:18 PDT 2023


arsenm added inline comments.


================
Comment at: clang/test/CodeGen/strictfp-elementwise-bulitins.cpp:13-14
+// CHECK-NEXT:    [[ADD:%.*]] = tail call <2 x float> @llvm.experimental.constrained.fadd.v2f32(<2 x float> [[TMP0]], <2 x float> [[TMP1]], metadata !"round.dynamic", metadata !"fpexcept.strict") #[[ATTR4:[0-9]+]]
+// CHECK-NEXT:    [[TMP2:%.*]] = bitcast <2 x float> [[ADD]] to double
+// CHECK-NEXT:    ret double [[TMP2]]
+//
----------------
sepavloff wrote:
> Why vector type is bitcasted to scalar? The function must return <2 x float>, no?
I assume this is some ABI thing. It doesn't happen for other targets and  the actual code is correct. I've avoided it by using float4 instead 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D153233/new/

https://reviews.llvm.org/D153233



More information about the cfe-commits mailing list