-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[clang] handle fp options in __builtin_convertvector #125522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,17 @@ | |
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \ | ||
// RUN: | FileCheck --strict-whitespace %s | ||
|
||
// CHECK-LABEL: FunctionDecl {{.*}} no_fpfeatures_func_01 'vector2float (vector2double)' | ||
// CHECK: CompoundStmt {{.*\>$}} | ||
// CHECK: ReturnStmt | ||
// CHECK: ConvertVectorExpr {{.*}} 'vector2float':'__attribute__((__vector_size__(2 * sizeof(float)))) float'{{$}} | ||
|
||
typedef double vector2double __attribute__((__vector_size__(16))); | ||
typedef float vector2float __attribute__((__vector_size__(8))); | ||
vector2float no_fpfeatures_func_01(vector2double x) { | ||
return __builtin_convertvector(x, vector2float); | ||
} | ||
|
||
float func_01(float x); | ||
|
||
template <typename T> | ||
|
@@ -248,4 +259,14 @@ __attribute__((optnone)) T func_22(T x, T y) { | |
|
||
float func_23(float x, float y) { | ||
return func_22(x, y); | ||
} | ||
} | ||
|
||
// CHECK-LABEL: FunctionDecl {{.*}} func_24 'vector2float (vector2double)' | ||
// CHECK: CompoundStmt {{.*}} FPContractMode=2 ConstRoundingMode=towardzero | ||
// CHECK: ReturnStmt | ||
// CHECK: ConvertVectorExpr {{.*}} FPContractMode=2 ConstRoundingMode=towardzero | ||
|
||
#pragma STDC FENV_ROUND FE_TOWARDZERO | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see other tests doing this but we should test also the absence of FP options in the AST as well when nothing is set. This would test that we are not incorrectly identifying that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added in f517b49. I moved it to the beginning of the file due to FP pragmas outside function scopes. |
||
vector2float func_24(vector2double x) { | ||
return __builtin_convertvector(x, vector2float); | ||
} |
Uh oh!
There was an error while loading. Please reload this page.