Skip to content

Commit 5e84cf8

Browse files
authored
Implement opcode f32.copysign and f64.copysign (#1216)
Implement opcode f32.copysign and f64.copysign for fast jit
1 parent d11bfdf commit 5e84cf8

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

core/iwasm/fast-jit/fe/jit_emit_numberic.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,11 +1573,39 @@ jit_compile_op_f64_arithmetic(JitCompContext *cc, FloatArithmetic arith_op)
15731573
bool
15741574
jit_compile_op_f32_copysign(JitCompContext *cc)
15751575
{
1576+
JitReg res;
1577+
JitReg args[2] = { 0 };
1578+
1579+
POP_F32(args[1]);
1580+
POP_F32(args[0]);
1581+
1582+
res = jit_cc_new_reg_F32(cc);
1583+
if (!jit_emit_callnative(cc, copysignf, res, args, 2))
1584+
goto fail;
1585+
1586+
PUSH_F32(res);
1587+
1588+
return true;
1589+
fail:
15761590
return false;
15771591
}
15781592

15791593
bool
15801594
jit_compile_op_f64_copysign(JitCompContext *cc)
15811595
{
1596+
JitReg res;
1597+
JitReg args[2] = { 0 };
1598+
1599+
POP_F64(args[1]);
1600+
POP_F64(args[0]);
1601+
1602+
res = jit_cc_new_reg_F64(cc);
1603+
if (!jit_emit_callnative(cc, copysign, res, args, 2))
1604+
goto fail;
1605+
1606+
PUSH_F64(res);
1607+
1608+
return true;
1609+
fail:
15821610
return false;
15831611
}

0 commit comments

Comments
 (0)