[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 07/10] target-ppc: emulate lfiwax instruction
From: |
Aurelien Jarno |
Subject: |
[Qemu-ppc] [PATCH 07/10] target-ppc: emulate lfiwax instruction |
Date: |
Sat, 13 Apr 2013 14:47:28 +0200 |
Needed for Power ISA version 2.05 compliance.
Cc: Alexander Graf <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
---
target-ppc/translate.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index e928f6b..647c31f 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -2526,7 +2526,6 @@ static inline void gen_qemu_ld32u(DisasContext *ctx, TCGv
arg1, TCGv arg2)
}
}
-#if defined(TARGET_PPC64)
static inline void gen_qemu_ld32s(DisasContext *ctx, TCGv arg1, TCGv arg2)
{
if (unlikely(ctx->le_mode)) {
@@ -2536,7 +2535,6 @@ static inline void gen_qemu_ld32s(DisasContext *ctx, TCGv
arg1, TCGv arg2)
} else
tcg_gen_qemu_ld32s(arg1, arg2, ctx->mem_idx);
}
-#endif
static inline void gen_qemu_ld64(DisasContext *ctx, TCGv_i64 arg1, TCGv arg2)
{
@@ -3295,6 +3293,21 @@ GEN_LDFS(lfd, ld64, 0x12, PPC_FLOAT);
/* lfs lfsu lfsux lfsx */
GEN_LDFS(lfs, ld32fs, 0x10, PPC_FLOAT);
+/* lfiwax */
+static void gen_lfiwax(DisasContext *ctx)
+{
+ TCGv EA;
+ if (unlikely(!ctx->fpu_enabled)) {
+ gen_exception(ctx, POWERPC_EXCP_FPU);
+ return;
+ }
+ gen_set_access_type(ctx, ACCESS_FLOAT);
+ EA = tcg_temp_new();
+ gen_addr_reg_index(ctx, EA);
+ gen_qemu_ld32s(ctx, cpu_fpr[rD(ctx->opcode)], EA);
+ tcg_temp_free(EA);
+}
+
/*** Floating-point store ***/
#define GEN_STF(name, stop, opc, type) \
static void glue(gen_, name)(DisasContext *ctx)
\
@@ -9009,6 +9022,7 @@ GEN_LDXF(name, ldop, 0x17, op | 0x00, type)
GEN_LDFS(lfd, ld64, 0x12, PPC_FLOAT)
GEN_LDFS(lfs, ld32fs, 0x10, PPC_FLOAT)
+GEN_HANDLER_E(lfiwax, 0x1f, 0x17, 0x1a, 0x00000001, PPC_NONE, PPC2_ISA205),
#undef GEN_STF
#undef GEN_STUF
--
1.7.10.4
- [Qemu-ppc] [PATCH 00/10] target-ppc: emulate Power ISA 2.05 instructions, Aurelien Jarno, 2013/04/13
- [Qemu-ppc] [PATCH 09/10] target-ppc: emulate store doubleword pair instructions, Aurelien Jarno, 2013/04/13
- [Qemu-ppc] [PATCH 07/10] target-ppc: emulate lfiwax instruction,
Aurelien Jarno <=
- [Qemu-ppc] [PATCH 08/10] target-ppc: emulate load doubleword pair instructions, Aurelien Jarno, 2013/04/13
- [Qemu-ppc] [PATCH 04/10] target-ppc: emulate cmpb instruction, Aurelien Jarno, 2013/04/13
- [Qemu-ppc] [PATCH 06/10] target-ppc: emulate fcpsgn instruction, Aurelien Jarno, 2013/04/13
- [Qemu-ppc] [PATCH 05/10] target-ppc: emulate prtyw and prtyd instructions, Aurelien Jarno, 2013/04/13
- [Qemu-ppc] [PATCH 03/10] target-ppc: add instruction flags for Book I 2.05, Aurelien Jarno, 2013/04/13