From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5831] target-ppc: convert external load/store instructions to TCG
Date: Sun, 30 Nov 2008 16:24:47 +0000 [thread overview]
Message-ID: <E1L6p6F-00060k-NC@cvs.savannah.gnu.org> (raw)
Revision: 5831
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5831
Author: aurel32
Date: 2008-11-30 16:24:47 +0000 (Sun, 30 Nov 2008)
Log Message:
-----------
target-ppc: convert external load/store instructions to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Modified Paths:
--------------
trunk/target-ppc/op.c
trunk/target-ppc/translate.c
Removed Paths:
-------------
trunk/target-ppc/op_mem.h
Modified: trunk/target-ppc/op.c
===================================================================
--- trunk/target-ppc/op.c 2008-11-30 16:24:39 UTC (rev 5830)
+++ trunk/target-ppc/op.c 2008-11-30 16:24:47 UTC (rev 5831)
@@ -257,22 +257,6 @@
RETURN();
}
-/* Load and store */
-#define MEMSUFFIX _raw
-#include "op_helper.h"
-#include "op_mem.h"
-#if !defined(CONFIG_USER_ONLY)
-#define MEMSUFFIX _user
-#include "op_helper.h"
-#include "op_mem.h"
-#define MEMSUFFIX _kernel
-#include "op_helper.h"
-#include "op_mem.h"
-#define MEMSUFFIX _hypv
-#include "op_helper.h"
-#include "op_mem.h"
-#endif
-
/* Return from interrupt */
#if !defined(CONFIG_USER_ONLY)
void OPPROTO op_rfi (void)
Deleted: trunk/target-ppc/op_mem.h
===================================================================
--- trunk/target-ppc/op_mem.h 2008-11-30 16:24:39 UTC (rev 5830)
+++ trunk/target-ppc/op_mem.h 2008-11-30 16:24:47 UTC (rev 5831)
@@ -1,80 +0,0 @@
-/*
- * PowerPC emulation micro-operations for qemu.
- *
- * Copyright (c) 2003-2007 Jocelyn Mayer
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "op_mem_access.h"
-
-/* External access */
-void OPPROTO glue(op_eciwx, MEMSUFFIX) (void)
-{
- T1 = glue(ldu32, MEMSUFFIX)((uint32_t)T0);
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO glue(op_eciwx_64, MEMSUFFIX) (void)
-{
- T1 = glue(ldu32, MEMSUFFIX)((uint64_t)T0);
- RETURN();
-}
-#endif
-
-void OPPROTO glue(op_ecowx, MEMSUFFIX) (void)
-{
- glue(st32, MEMSUFFIX)((uint32_t)T0, T1);
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO glue(op_ecowx_64, MEMSUFFIX) (void)
-{
- glue(st32, MEMSUFFIX)((uint64_t)T0, T1);
- RETURN();
-}
-#endif
-
-void OPPROTO glue(op_eciwx_le, MEMSUFFIX) (void)
-{
- T1 = glue(ldu32r, MEMSUFFIX)((uint32_t)T0);
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO glue(op_eciwx_le_64, MEMSUFFIX) (void)
-{
- T1 = glue(ldu32r, MEMSUFFIX)((uint64_t)T0);
- RETURN();
-}
-#endif
-
-void OPPROTO glue(op_ecowx_le, MEMSUFFIX) (void)
-{
- glue(st32r, MEMSUFFIX)((uint32_t)T0, T1);
- RETURN();
-}
-
-#if defined(TARGET_PPC64)
-void OPPROTO glue(op_ecowx_le_64, MEMSUFFIX) (void)
-{
- glue(st32r, MEMSUFFIX)((uint64_t)T0, T1);
- RETURN();
-}
-#endif
-
-#undef MEMSUFFIX
Modified: trunk/target-ppc/translate.c
===================================================================
--- trunk/target-ppc/translate.c 2008-11-30 16:24:39 UTC (rev 5830)
+++ trunk/target-ppc/translate.c 2008-11-30 16:24:47 UTC (rev 5831)
@@ -2490,37 +2490,6 @@
tcg_temp_free(t0);
}
-#if defined(TARGET_PPC64)
-#define _GEN_MEM_FUNCS(name, mode) \
- &gen_op_##name##_##mode, \
- &gen_op_##name##_le_##mode, \
- &gen_op_##name##_64_##mode, \
- &gen_op_##name##_le_64_##mode
-#else
-#define _GEN_MEM_FUNCS(name, mode) \
- &gen_op_##name##_##mode, \
- &gen_op_##name##_le_##mode
-#endif
-#if defined(CONFIG_USER_ONLY)
-#if defined(TARGET_PPC64)
-#define NB_MEM_FUNCS 4
-#else
-#define NB_MEM_FUNCS 2
-#endif
-#define GEN_MEM_FUNCS(name) \
- _GEN_MEM_FUNCS(name, raw)
-#else
-#if defined(TARGET_PPC64)
-#define NB_MEM_FUNCS 12
-#else
-#define NB_MEM_FUNCS 6
-#endif
-#define GEN_MEM_FUNCS(name) \
- _GEN_MEM_FUNCS(name, user), \
- _GEN_MEM_FUNCS(name, kernel), \
- _GEN_MEM_FUNCS(name, hypv)
-#endif
-
/*** Integer load ***/
#if defined(TARGET_PPC64)
#define GEN_QEMU_LD_PPC64(width) \
@@ -4427,32 +4396,28 @@
/*** External control ***/
/* Optional: */
-#define op_eciwx() (*gen_op_eciwx[ctx->mem_idx])()
-#define op_ecowx() (*gen_op_ecowx[ctx->mem_idx])()
-static GenOpFunc *gen_op_eciwx[NB_MEM_FUNCS] = {
- GEN_MEM_FUNCS(eciwx),
-};
-static GenOpFunc *gen_op_ecowx[NB_MEM_FUNCS] = {
- GEN_MEM_FUNCS(ecowx),
-};
-
/* eciwx */
GEN_HANDLER(eciwx, 0x1F, 0x16, 0x0D, 0x00000001, PPC_EXTERN)
{
- /* Should check EAR[E] & alignment ! */
+ /* Should check EAR[E] ! */
+ TCGv t0 = tcg_temp_new();
gen_set_access_type(ACCESS_RES);
- gen_addr_reg_index(cpu_T[0], ctx);
- op_eciwx();
- tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]);
+ gen_addr_reg_index(t0, ctx);
+ gen_check_align(ctx, t0, 0x03);
+ gen_qemu_ld32u(cpu_gpr[rD(ctx->opcode)], t0, ctx->mem_idx);
+ tcg_temp_free(t0);
}
/* ecowx */
GEN_HANDLER(ecowx, 0x1F, 0x16, 0x09, 0x00000001, PPC_EXTERN)
{
- /* Should check EAR[E] & alignment ! */
- gen_addr_reg_index(cpu_T[0], ctx);
- tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]);
- op_ecowx();
+ /* Should check EAR[E] ! */
+ TCGv t0 = tcg_temp_new();
+ gen_set_access_type(ACCESS_RES);
+ gen_addr_reg_index(t0, ctx);
+ gen_check_align(ctx, t0, 0x03);
+ gen_qemu_st32(cpu_gpr[rD(ctx->opcode)], t0, ctx->mem_idx);
+ tcg_temp_free(t0);
}
/* PowerPC 601 specific instructions */
reply other threads:[~2008-11-30 16:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1L6p6F-00060k-NC@cvs.savannah.gnu.org \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).