zahiraam updated this revision to Diff 512108. zahiraam marked an inline comment as done.
CHANGES SINCE LAST ACTION https://reviews.llvm.org/D147733/new/ https://reviews.llvm.org/D147733 Files: clang/lib/Sema/SemaAttr.cpp clang/test/CodeGen/pragma-fenv_access.c Index: clang/test/CodeGen/pragma-fenv_access.c =================================================================== --- clang/test/CodeGen/pragma-fenv_access.c +++ clang/test/CodeGen/pragma-fenv_access.c @@ -224,3 +224,17 @@ // STRICT: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict") // DEFAULT: fadd float +#pragma STDC FENV_ACCESS ON +float func_19(float x, float y) { + return x + y; +} +// CHECK-LABEL: @func_19 +// STRICT: call float @llvm.experimental.constrained.fadd.f32(float %0, float %1, metadata !"round.dynamic", metadata !"fpexcept.strict") + +#pragma STDC FENV_ACCESS OFF +float func_20(float x, float y) { + return x + y; +} +// CHECK-LABEL: @func_20 +// STRICT: call float @llvm.experimental.constrained.fadd.f32(float %0, float %1, metadata !"round.tonearest", metadata !"fpexcept.strict") +// DEFAULT: fadd float Index: clang/lib/Sema/SemaAttr.cpp =================================================================== --- clang/lib/Sema/SemaAttr.cpp +++ clang/lib/Sema/SemaAttr.cpp @@ -1336,6 +1336,7 @@ Diag(Loc, diag::err_pragma_fenv_requires_precise); } NewFPFeatures.setAllowFEnvAccessOverride(IsEnabled); + NewFPFeatures.setRoundingMathOverride(IsEnabled); FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewFPFeatures); CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts()); }
Index: clang/test/CodeGen/pragma-fenv_access.c =================================================================== --- clang/test/CodeGen/pragma-fenv_access.c +++ clang/test/CodeGen/pragma-fenv_access.c @@ -224,3 +224,17 @@ // STRICT: call float @llvm.experimental.constrained.fadd.f32(float {{.*}}, float {{.*}}, metadata !"round.tonearest", metadata !"fpexcept.strict") // DEFAULT: fadd float +#pragma STDC FENV_ACCESS ON +float func_19(float x, float y) { + return x + y; +} +// CHECK-LABEL: @func_19 +// STRICT: call float @llvm.experimental.constrained.fadd.f32(float %0, float %1, metadata !"round.dynamic", metadata !"fpexcept.strict") + +#pragma STDC FENV_ACCESS OFF +float func_20(float x, float y) { + return x + y; +} +// CHECK-LABEL: @func_20 +// STRICT: call float @llvm.experimental.constrained.fadd.f32(float %0, float %1, metadata !"round.tonearest", metadata !"fpexcept.strict") +// DEFAULT: fadd float Index: clang/lib/Sema/SemaAttr.cpp =================================================================== --- clang/lib/Sema/SemaAttr.cpp +++ clang/lib/Sema/SemaAttr.cpp @@ -1336,6 +1336,7 @@ Diag(Loc, diag::err_pragma_fenv_requires_precise); } NewFPFeatures.setAllowFEnvAccessOverride(IsEnabled); + NewFPFeatures.setRoundingMathOverride(IsEnabled); FpPragmaStack.Act(Loc, PSK_Set, StringRef(), NewFPFeatures); CurFPFeatures = NewFPFeatures.applyOverrides(getLangOpts()); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits