Skip to content

Commit

Permalink
target/ppc: Implement PLFS, PLFD, PSTFS and PSTFD instructions
Browse files Browse the repository at this point in the history
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fernando Eckhardt Valle <fernando.valle@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20211029202424.175401-5-matheus.ferst@eldorado.org.br>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
pherde authored and dgibson committed Nov 8, 2021
1 parent fbd2e60 commit dcb4e5b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions target/ppc/insn64.decode
Expand Up @@ -56,6 +56,17 @@ PSTD 000001 00 0--.-- .................. \
PADDI 000001 10 0--.-- .................. \
001110 ..... ..... ................ @PLS_D

### Float-Point Load and Store Instructions

PLFS 000001 10 0--.-- .................. \
110000 ..... ..... ................ @PLS_D
PLFD 000001 10 0--.-- .................. \
110010 ..... ..... ................ @PLS_D
PSTFS 000001 10 0--.-- .................. \
110100 ..... ..... ................ @PLS_D
PSTFD 000001 10 0--.-- .................. \
110110 ..... ..... ................ @PLS_D

### Prefixed No-operation Instruction

@PNOP 000001 11 0000-- 000000000000000000 \
Expand Down
14 changes: 14 additions & 0 deletions target/ppc/translate/fp-impl.c.inc
Expand Up @@ -1342,6 +1342,16 @@ static bool do_lsfp_D(DisasContext *ctx, arg_D *a, bool update, bool store,
single);
}

static bool do_lsfp_PLS_D(DisasContext *ctx, arg_PLS_D *a, bool update,
bool store, bool single)
{
arg_D d;
if (!resolve_PLS_D(ctx, &d, a)) {
return true;
}
return do_lsfp_D(ctx, &d, update, store, single);
}

static bool do_lsfp_X(DisasContext *ctx, arg_X *a, bool update,
bool store, bool single)
{
Expand All @@ -1352,21 +1362,25 @@ TRANS(LFS, do_lsfp_D, false, false, true)
TRANS(LFSU, do_lsfp_D, true, false, true)
TRANS(LFSX, do_lsfp_X, false, false, true)
TRANS(LFSUX, do_lsfp_X, true, false, true)
TRANS(PLFS, do_lsfp_PLS_D, false, false, true)

TRANS(LFD, do_lsfp_D, false, false, false)
TRANS(LFDU, do_lsfp_D, true, false, false)
TRANS(LFDX, do_lsfp_X, false, false, false)
TRANS(LFDUX, do_lsfp_X, true, false, false)
TRANS(PLFD, do_lsfp_PLS_D, false, false, false)

TRANS(STFS, do_lsfp_D, false, true, true)
TRANS(STFSU, do_lsfp_D, true, true, true)
TRANS(STFSX, do_lsfp_X, false, true, true)
TRANS(STFSUX, do_lsfp_X, true, true, true)
TRANS(PSTFS, do_lsfp_PLS_D, false, true, true)

TRANS(STFD, do_lsfp_D, false, true, false)
TRANS(STFDU, do_lsfp_D, true, true, false)
TRANS(STFDX, do_lsfp_X, false, true, false)
TRANS(STFDUX, do_lsfp_X, true, true, false)
TRANS(PSTFD, do_lsfp_PLS_D, false, true, false)

#undef _GEN_FLOAT_ACB
#undef GEN_FLOAT_ACB
Expand Down

0 comments on commit dcb4e5b

Please sign in to comment.