[PATCH] D145765: Add __builtin_set_flt_rounds

xiongji90 via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 12 22:00:29 PDT 2023


xiongji90 marked an inline comment as done.
xiongji90 added inline comments.


================
Comment at: clang/test/CodeGen/builtin_set_flt_rounds.c:5-7
+void test_builtin_set_flt_rounds() {
+  __builtin_set_flt_rounds(1);
+  // CHECK: call void @llvm.set.rounding(i32 1)
----------------
aaron.ballman wrote:
> I think you should also add some Sema tests for correct and misuse of the builtin:
> ```
> __builtin_set_flt_rounds(1); // OK
> 
> struct S { int a; } s;
> __builtin_set_flt_rounds(s); // This should diagnose, right?
> 
> __builtin_set_flt_rounds(1.0f); // Should this implicitly convert or is this an error?
> ```
> and that sema test can additionally test what happens when you call the builtin on an unsupported architecture.
Hi, @aaron.ballman 
I added a new test in test/Sema to check the builtin on platforms unsupported.
Thanks very much.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145765/new/

https://reviews.llvm.org/D145765



More information about the cfe-commits mailing list