mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fixes $$get_rounding_mode() for LLVM > 15.
This commit is contained in:
committed by
Christoffer Lerno
parent
4330740cf8
commit
8390655d79
@@ -641,11 +641,15 @@ static void llvm_codegen_setup()
|
||||
intrinsic_id.exp2 = lookup_intrinsic("llvm.exp2");
|
||||
intrinsic_id.fabs = lookup_intrinsic("llvm.fabs");
|
||||
intrinsic_id.floor = lookup_intrinsic("llvm.floor");
|
||||
intrinsic_id.flt_rounds = lookup_intrinsic("llvm.flt.rounds");
|
||||
intrinsic_id.fma = lookup_intrinsic("llvm.fma");
|
||||
intrinsic_id.frameaddress = lookup_intrinsic("llvm.frameaddress");
|
||||
intrinsic_id.fshl = lookup_intrinsic("llvm.fshl");
|
||||
intrinsic_id.fshr = lookup_intrinsic("llvm.fshr");
|
||||
#if LLVM_VERSION_MAJOR < 16
|
||||
intrinsic_id.get_rounding = lookup_intrinsic("llvm.flt.rounds");
|
||||
#else
|
||||
intrinsic_id.get_rounding = lookup_intrinsic("llvm.get.rounding");
|
||||
#endif
|
||||
intrinsic_id.lifetime_end = lookup_intrinsic("llvm.lifetime.end");
|
||||
intrinsic_id.lifetime_start = lookup_intrinsic("llvm.lifetime.start");
|
||||
intrinsic_id.llrint = lookup_intrinsic("llvm.llrint");
|
||||
|
||||
@@ -688,7 +688,7 @@ void llvm_emit_builtin_call(GenContext *c, BEValue *result_value, Expr *expr)
|
||||
llvm_emit_simple_builtin(c, result_value, expr, intrinsic_id.fshr);
|
||||
return;
|
||||
case BUILTIN_GET_ROUNDING_MODE:
|
||||
llvm_value_set(result_value, llvm_emit_call_intrinsic(c, intrinsic_id.flt_rounds, NULL, 0, NULL, 0), expr->type);
|
||||
llvm_value_set(result_value, llvm_emit_call_intrinsic(c, intrinsic_id.get_rounding, NULL, 0, NULL, 0), expr->type);
|
||||
return;
|
||||
case BUILTIN_LOG:
|
||||
llvm_emit_simple_builtin(c, result_value, expr, intrinsic_id.log);
|
||||
|
||||
@@ -133,12 +133,12 @@ typedef struct
|
||||
unsigned exp2;
|
||||
unsigned fabs;
|
||||
unsigned floor;
|
||||
unsigned flt_rounds;
|
||||
unsigned fma;
|
||||
unsigned fmuladd;
|
||||
unsigned frameaddress;
|
||||
unsigned fshl;
|
||||
unsigned fshr;
|
||||
unsigned get_rounding;
|
||||
unsigned lifetime_end;
|
||||
unsigned lifetime_start;
|
||||
unsigned llrint;
|
||||
|
||||
Reference in New Issue
Block a user