Add __builtin_set_flt_rounds
authorjinge90 <ge.jin@intel.com>
Wed, 15 Mar 2023 03:09:25 +0000 (11:09 +0800)
committerjinge90 <ge.jin@intel.com>
Wed, 15 Mar 2023 03:13:55 +0000 (11:13 +0800)
commitb38aa297171134cee3fbec3c9e1e4d64b2ec3e22
tree05cddac9aed469b86de9009634576de8ac9ff6d1
parentf3b9912026894ecca8925c974dd7ca16b0f1e265
Add __builtin_set_flt_rounds

This builtin will be converted to llvm.set.rounding intrinsic
in IR level and should be work with "#pragma STDC FENV_ACCESS ON"
since it changes default FP environment. Users can change rounding
mode via this builtin without introducing libc dependency.

Reviewed by: andrew.w.kaylor, rjmccall, sepavloff, aaron.ballman
Differential Revision: https://reviews.llvm.org/D145765
Signed-off-by: jinge90 <ge.jin@intel.com>
clang/docs/ReleaseNotes.rst
clang/include/clang/Basic/Builtins.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtin_set_flt_rounds.c [new file with mode: 0644]
clang/test/Sema/builtin_set_flt_rounds.c [new file with mode: 0644]