Added recompiled versions of FABS, FCHS, FSQRT and FTST.
This commit is contained in:
parent
856f0b4471
commit
07035c97c8
16 changed files with 424 additions and 4 deletions
|
|
@ -619,6 +619,71 @@ static int codegen_CMP_JZ_DEST(codeblock_t *block, uop_t *uop)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int codegen_FABS(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg_a = HOST_REG_GET(uop->src_reg_a_real);
|
||||
int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real), src_size_a = IREG_GET_SIZE(uop->src_reg_a_real);
|
||||
|
||||
if (REG_IS_D(dest_size) && REG_IS_D(src_size_a))
|
||||
{
|
||||
host_arm64_FABS_D(block, dest_reg, src_reg_a);
|
||||
}
|
||||
else
|
||||
fatal("codegen_FABS %02x %02x %02x\n", uop->dest_reg_a_real, uop->src_reg_a_real);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int codegen_FCHS(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg_a = HOST_REG_GET(uop->src_reg_a_real);
|
||||
int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real), src_size_a = IREG_GET_SIZE(uop->src_reg_a_real);
|
||||
|
||||
if (REG_IS_D(dest_size) && REG_IS_D(src_size_a))
|
||||
{
|
||||
host_arm64_FNEG_D(block, dest_reg, src_reg_a);
|
||||
}
|
||||
else
|
||||
fatal("codegen_FCHS %02x %02x %02x\n", uop->dest_reg_a_real, uop->src_reg_a_real);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int codegen_FSQRT(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg_a = HOST_REG_GET(uop->src_reg_a_real);
|
||||
int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real), src_size_a = IREG_GET_SIZE(uop->src_reg_a_real);
|
||||
|
||||
if (REG_IS_D(dest_size) && REG_IS_D(src_size_a))
|
||||
{
|
||||
host_arm64_FSQRT_D(block, dest_reg, src_reg_a);
|
||||
}
|
||||
else
|
||||
fatal("codegen_FSQRT %02x %02x %02x\n", uop->dest_reg_a_real, uop->src_reg_a_real);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static int codegen_FTST(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg_a = HOST_REG_GET(uop->src_reg_a_real);
|
||||
int dest_size = IREG_GET_SIZE(uop->dest_reg_a_real), src_size_a = IREG_GET_SIZE(uop->src_reg_a_real);
|
||||
|
||||
if (REG_IS_W(dest_size) && REG_IS_D(src_size_a))
|
||||
{
|
||||
host_arm64_FSUB_D(block, REG_V_TEMP, REG_V_TEMP, REG_V_TEMP);
|
||||
host_arm64_MOVZ_IMM(block, dest_reg, 0);
|
||||
host_arm64_FCMP_D(block, src_reg_a, REG_V_TEMP);
|
||||
host_arm64_ORR_IMM(block, REG_TEMP, dest_reg, C3);
|
||||
host_arm64_ORR_IMM(block, REG_TEMP2, dest_reg, C0);
|
||||
host_arm64_CSEL_EQ(block, dest_reg, REG_TEMP, dest_reg);
|
||||
host_arm64_ORR_IMM(block, REG_TEMP, dest_reg, C0|C2|C3);
|
||||
host_arm64_CSEL_CC(block, dest_reg, REG_TEMP2, dest_reg);
|
||||
host_arm64_CSEL_VS(block, dest_reg, REG_TEMP, dest_reg);
|
||||
}
|
||||
else
|
||||
fatal("codegen_FTST %02x %02x %02x\n", uop->dest_reg_a_real, uop->src_reg_a_real, uop->src_reg_b_real);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int codegen_FADD(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
int dest_reg = HOST_REG_GET(uop->dest_reg_a_real), src_reg_a = HOST_REG_GET(uop->src_reg_a_real), src_reg_b = HOST_REG_GET(uop->src_reg_b_real);
|
||||
|
|
@ -2540,6 +2605,11 @@ const uOpFn uop_handlers[UOP_MAX] =
|
|||
[UOP_FMUL & UOP_MASK] = codegen_FMUL,
|
||||
[UOP_FSUB & UOP_MASK] = codegen_FSUB,
|
||||
|
||||
[UOP_FABS & UOP_MASK] = codegen_FABS,
|
||||
[UOP_FCHS & UOP_MASK] = codegen_FCHS,
|
||||
[UOP_FSQRT & UOP_MASK] = codegen_FSQRT,
|
||||
[UOP_FTST & UOP_MASK] = codegen_FTST,
|
||||
|
||||
[UOP_PACKSSWB & UOP_MASK] = codegen_PACKSSWB,
|
||||
[UOP_PACKSSDW & UOP_MASK] = codegen_PACKSSDW,
|
||||
[UOP_PACKUSWB & UOP_MASK] = codegen_PACKUSWB,
|
||||
|
|
|
|||
Loading…
Reference in a new issue