Skip to content

Commit 0fb0d27

Browse files
authored
[SYCL] Make foffload-fp32-prec-div/sqrt CL compatible options. (#16993)
1 parent 90fd252 commit 0fb0d27

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,17 +1169,17 @@ defm cx_fortran_rules: BoolOptionWithoutMarshalling<"f", "cx-fortran-rules",
11691169

11701170
defm offload_fp32_prec_div: BoolOption<"f", "offload-fp32-prec-div",
11711171
LangOpts<"OffloadFP32PrecDiv">, DefaultTrue,
1172-
PosFlag<SetTrue, [], [ClangOption, CC1Option], "fdiv operations in offload device "
1172+
PosFlag<SetTrue, [], [ClangOption, CLOption, CC1Option], "fdiv operations in offload device "
11731173
"code are required to return correctly rounded results.">,
1174-
NegFlag<SetFalse, [], [ClangOption, CC1Option], "fdiv operations in offload device "
1174+
NegFlag<SetFalse, [], [ClangOption, CLOption, CC1Option], "fdiv operations in offload device "
11751175
"code are not required to return correctly rounded results.">>,
11761176
Group<f_Group>;
11771177

11781178
defm offload_fp32_prec_sqrt: BoolOption<"f", "offload-fp32-prec-sqrt",
11791179
LangOpts<"OffloadFP32PrecSqrt">, DefaultTrue,
1180-
PosFlag<SetTrue, [], [ClangOption, CC1Option], "sqrt operations in offload device "
1180+
PosFlag<SetTrue, [], [ClangOption, CLOption, CC1Option], "sqrt operations in offload device "
11811181
"code are required to return correctly rounded results.">,
1182-
NegFlag<SetFalse, [], [ClangOption, CC1Option], "sqrt operations in offload device "
1182+
NegFlag<SetFalse, [], [ClangOption, CLOption, CC1Option], "sqrt operations in offload device "
11831183
"code are not required to return correctly rounded results.">>,
11841184
Group<f_Group>;
11851185

clang/test/Driver/offload-fp32-div-sqrt.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,29 @@
7777
// RUN: %clang -c -fsycl -ffp-model=fast -foffload-fp32-prec-sqrt -### %s 2>&1 \
7878
// RUN: | FileCheck --check-prefix=NO_PREC_DIV %s
7979

80+
// RUN: %clang_cl -c -fsycl -foffload-fp32-prec-div -### %s 2>&1 | FileCheck %s
81+
// RUN: %clang_cl -c -fsycl -foffload-fp32-prec-sqrt -### %s 2>&1 | FileCheck %s
82+
83+
// RUN: %clang_cl -c -fsycl -foffload-fp32-prec-div \
84+
// RUN: -foffload-fp32-prec-sqrt -### %s 2>&1 | FileCheck %s
85+
86+
// RUN: %clang_cl -c -fsycl -foffload-fp32-prec-sqrt -foffload-fp32-prec-div \
87+
// RUN: -### %s 2>&1 | FileCheck %s
88+
89+
// RUN: %clang_cl -c -fsycl -fno-offload-fp32-prec-div -### %s 2>&1 \
90+
// RUN: | FileCheck --check-prefix=NO_PREC_DIV %s
91+
92+
// RUN: %clang_cl -c -fsycl -fno-offload-fp32-prec-sqrt -### %s 2>&1 \
93+
// RUN: | FileCheck --check-prefix=NO_PREC_SQRT %s
94+
95+
// RUN: %clang_cl -c -fsycl -fno-offload-fp32-prec-div \
96+
// RUN: -fno-offload-fp32-prec-sqrt -### %s 2>&1 \
97+
// RUN: | FileCheck --check-prefix=FAST %s
98+
99+
// RUN: %clang_cl -c -fsycl -fno-offload-fp32-prec-sqrt \
100+
// RUN: -fno-offload-fp32-prec-div -### %s 2>&1 \
101+
// RUN: | FileCheck --check-prefix=FAST %s
102+
80103
// WARN-HIGH-DIV: floating point accuracy control 'high' conflicts with explicit target precision option '-fno-offload-fp32-prec-div'
81104

82105
// WARN-HIGH-DIV-ONLY: floating point accuracy control 'high:fdiv' conflicts with explicit target precision option '-fno-offload-fp32-prec-div'

0 commit comments

Comments
 (0)