Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kq9jt-0006Hy-KZ for qemu-devel@nongnu.org; Wed, 15 Oct 2008 13:00:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kq9jr-0006HX-TC for qemu-devel@nongnu.org; Wed, 15 Oct 2008 13:00:49 -0400 Received: from [199.232.76.173] (port=54483 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kq9jr-0006HQ-Ms for qemu-devel@nongnu.org; Wed, 15 Oct 2008 13:00:47 -0400 Received: from savannah.gnu.org ([199.232.41.3]:52179 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kq9jr-0006Aq-4J for qemu-devel@nongnu.org; Wed, 15 Oct 2008 13:00:47 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kq9jq-0006x5-Cc for qemu-devel@nongnu.org; Wed, 15 Oct 2008 17:00:46 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kq9jp-0006x0-Vr for qemu-devel@nongnu.org; Wed, 15 Oct 2008 17:00:46 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Wed, 15 Oct 2008 17:00:46 +0000 Subject: [Qemu-devel] [5494] PPC: convert SPE logical instructions to TCG Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5494 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5494 Author: aurel32 Date: 2008-10-15 17:00:45 +0000 (Wed, 15 Oct 2008) Log Message: ----------- PPC: convert SPE logical instructions to TCG (Nathan Froyd) Modified Paths: -------------- trunk/target-ppc/op.c trunk/target-ppc/translate.c Modified: trunk/target-ppc/op.c =================================================================== --- trunk/target-ppc/op.c 2008-10-15 17:00:37 UTC (rev 5493) +++ trunk/target-ppc/op.c 2008-10-15 17:00:45 UTC (rev 5494) @@ -2507,54 +2507,6 @@ RETURN(); } -void OPPROTO op_evand (void) -{ - T0_64 &= T1_64; - RETURN(); -} - -void OPPROTO op_evandc (void) -{ - T0_64 &= ~T1_64; - RETURN(); -} - -void OPPROTO op_evor (void) -{ - T0_64 |= T1_64; - RETURN(); -} - -void OPPROTO op_evxor (void) -{ - T0_64 ^= T1_64; - RETURN(); -} - -void OPPROTO op_eveqv (void) -{ - T0_64 = ~(T0_64 ^ T1_64); - RETURN(); -} - -void OPPROTO op_evnor (void) -{ - T0_64 = ~(T0_64 | T1_64); - RETURN(); -} - -void OPPROTO op_evorc (void) -{ - T0_64 |= ~T1_64; - RETURN(); -} - -void OPPROTO op_evnand (void) -{ - T0_64 = ~(T0_64 & T1_64); - RETURN(); -} - void OPPROTO op_evsrws (void) { do_evsrws(); Modified: trunk/target-ppc/translate.c =================================================================== --- trunk/target-ppc/translate.c 2008-10-15 17:00:37 UTC (rev 5493) +++ trunk/target-ppc/translate.c 2008-10-15 17:00:45 UTC (rev 5494) @@ -5723,6 +5723,23 @@ gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); \ } +#define GEN_SPEOP_TCG_ARITH2(name) \ +static always_inline void gen_##name (DisasContext *ctx) \ +{ \ + if (unlikely(!ctx->spe_enabled)) { \ + GEN_EXCP_NO_AP(ctx); \ + return; \ + } \ + TCGv t0 = tcg_temp_new(TCG_TYPE_I64); \ + TCGv t1 = tcg_temp_new(TCG_TYPE_I64); \ + gen_load_gpr64(t0, rA(ctx->opcode)); \ + gen_load_gpr64(t1, rB(ctx->opcode)); \ + gen_op_##name(t0, t1); \ + gen_store_gpr64(rD(ctx->opcode), t0); \ + tcg_temp_free(t0); \ + tcg_temp_free(t1); \ +} + #define GEN_SPEOP_ARITH1(name) \ static always_inline void gen_##name (DisasContext *ctx) \ { \ @@ -5749,14 +5766,59 @@ } /* Logical */ -GEN_SPEOP_ARITH2(evand); -GEN_SPEOP_ARITH2(evandc); -GEN_SPEOP_ARITH2(evxor); -GEN_SPEOP_ARITH2(evor); -GEN_SPEOP_ARITH2(evnor); -GEN_SPEOP_ARITH2(eveqv); -GEN_SPEOP_ARITH2(evorc); -GEN_SPEOP_ARITH2(evnand); +static always_inline void gen_op_evand (TCGv t0, TCGv t1) +{ + tcg_gen_and_i64(t0, t0, t1); +} + +static always_inline void gen_op_evandc (TCGv t0, TCGv t1) +{ + tcg_gen_not_i64(t1, t1); + tcg_gen_and_i64(t0, t0, t1); +} + +static always_inline void gen_op_evxor (TCGv t0, TCGv t1) +{ + tcg_gen_xor_i64(t0, t0, t1); +} + +static always_inline void gen_op_evor (TCGv t0, TCGv t1) +{ + tcg_gen_or_i64(t0, t0, t1); +} + +static always_inline void gen_op_evnor (TCGv t0, TCGv t1) +{ + tcg_gen_or_i64(t0, t0, t1); + tcg_gen_not_i64(t0, t0); +} + +static always_inline void gen_op_eveqv (TCGv t0, TCGv t1) +{ + tcg_gen_xor_i64(t0, t0, t1); + tcg_gen_not_i64(t0, t0); +} + +static always_inline void gen_op_evorc (TCGv t0, TCGv t1) +{ + tcg_gen_not_i64(t1, t1); + tcg_gen_or_i64(t0, t0, t1); +} + +static always_inline void gen_op_evnand (TCGv t0, TCGv t1) +{ + tcg_gen_and_i64(t0, t0, t1); + tcg_gen_not_i64(t0, t0); +} + +GEN_SPEOP_TCG_ARITH2(evand); +GEN_SPEOP_TCG_ARITH2(evandc); +GEN_SPEOP_TCG_ARITH2(evxor); +GEN_SPEOP_TCG_ARITH2(evor); +GEN_SPEOP_TCG_ARITH2(evnor); +GEN_SPEOP_TCG_ARITH2(eveqv); +GEN_SPEOP_TCG_ARITH2(evorc); +GEN_SPEOP_TCG_ARITH2(evnand); GEN_SPEOP_ARITH2(evsrwu); GEN_SPEOP_ARITH2(evsrws); GEN_SPEOP_ARITH2(evslw);