Fixes $$set_rounding_mode builtin.

This commit is contained in:
Dmitry Atamanov
2023-09-06 23:05:43 +05:00
committed by Christoffer Lerno
parent 51f76c69c4
commit 40d5ce0937
2 changed files with 3 additions and 1 deletions

View File

@@ -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:

View File

@@ -29,6 +29,8 @@ fn void main()
double[<2>] vd9 = $$round(vd);
double[<2>] vd10 = $$roundeven(vd);
$$set_rounding_mode(0);
return;
}
@@ -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)