wasm codegen: fix lowering of 32/64 float rt calls

This commit is contained in:
Andrew Kelley
2024-12-15 16:02:44 -08:00
parent 55773aee3f
commit 098e0b1906
2 changed files with 35 additions and 8 deletions

View File

@@ -2747,25 +2747,33 @@ const FloatOp = enum {
},
inline .ceil,
.cos,
.exp,
.exp2,
.fabs,
.floor,
.fma,
.fmax,
.fmin,
.round,
.sqrt,
.trunc,
=> |ct_op| switch (bits) {
inline 16, 80, 128 => |ct_bits| @field(
Mir.Intrinsic,
libcFloatPrefix(ct_bits) ++ @tagName(ct_op) ++ libcFloatSuffix(ct_bits),
),
else => unreachable,
},
inline .cos,
.exp,
.exp2,
.fma,
.fmod,
.log,
.log10,
.log2,
.round,
.sin,
.sqrt,
.tan,
.trunc,
=> |ct_op| switch (bits) {
inline 16, 80, 128 => |ct_bits| @field(
inline 16, 32, 64, 80, 128 => |ct_bits| @field(
Mir.Intrinsic,
libcFloatPrefix(ct_bits) ++ @tagName(ct_op) ++ libcFloatSuffix(ct_bits),
),

View File

@@ -853,11 +853,18 @@ pub const Intrinsic = enum(u32) {
__udivti3,
__umodti3,
ceilq,
cos,
cosf,
cosq,
exp,
exp2,
exp2f,
exp2q,
expf,
expq,
fabsq,
floorq,
fma,
fmaf,
fmaq,
fmax,
@@ -866,13 +873,25 @@ pub const Intrinsic = enum(u32) {
fmin,
fminf,
fminq,
fmod,
fmodf,
fmodq,
log,
log10,
log10f,
log10q,
log2,
log2f,
log2q,
logf,
logq,
roundq,
sin,
sinf,
sinq,
sqrtq,
tan,
tanf,
tanq,
truncq,
};