Skip to content

Commit

Permalink
Fixes $$set_rounding_mode builtin.
Browse files Browse the repository at this point in the history
  • Loading branch information
data-man committed Sep 6, 2023
1 parent 50e99b5 commit 0b546b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/compiler/sema_builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ bool sema_expr_analyse_builtin_call(SemaContext *context, Expr *expr)
case BUILTIN_SET_ROUNDING_MODE:
assert(arg_count == 1);
if (!sema_check_builtin_args(args, (BuiltinArg[]) { BA_INTEGER }, 1)) return false;
if (!sema_check_builtin_args_match(args, 1)) return false;
rtype = type_void;
break;
case BUILTIN_SYSCALL:
Expand Down
3 changes: 3 additions & 0 deletions test/test_suite/builtins/rounding_builtins.c3t
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ fn void main()
double[<2>] vd9 = $$round(vd);
double[<2>] vd10 = $$roundeven(vd);

$$set_rounding_mode(0);

return;
}

Expand All @@ -46,3 +48,4 @@ fn void main()
%19 = call <2 x double> @llvm.rint.v2f64(<2 x double> %18)
%21 = call <2 x double> @llvm.round.v2f64(<2 x double> %20)
%23 = call <2 x double> @llvm.roundeven.v2f64(<2 x double> %22)
call void @llvm.set.rounding(i32 0)

0 comments on commit 0b546b2

Please sign in to comment.