[clang] [clang] handle fp options in __builtin_convertvector (PR #125522)

Jakub Ficek via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 4 08:34:50 PST 2025


================
@@ -248,4 +248,16 @@ __attribute__((optnone)) T func_22(T x, T y) {
 
 float func_23(float x, float y) {
   return func_22(x, y);
-}
\ No newline at end of file
+}
+
+// CHECK-LABEL: FunctionDecl {{.*}} func_24 'vector2float (vector2double)'
+// CHECK:         CompoundStmt {{.*}} FPContractMode=2 ConstRoundingMode=towardzero
+// CHECK:           ReturnStmt
+// CHECK:             ConvertVectorExpr {{.*}} FPContractMode=2 ConstRoundingMode=towardzero
+
+typedef double vector2double __attribute__((__vector_size__(16)));
+typedef float  vector2float  __attribute__((__vector_size__(8)));
+#pragma STDC FENV_ROUND FE_TOWARDZERO
----------------
ficol wrote:

added in https://github.com/llvm/llvm-project/pull/125522/commits/f517b49df4b58677a060426fe2f82937d2de2e59. I moved it to the beginning of the file due to FP pragmas outside function scopes.

https://github.com/llvm/llvm-project/pull/125522


More information about the cfe-commits mailing list