From patchwork Fri Feb 15 10:00:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158489 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp517500jaa; Fri, 15 Feb 2019 02:06:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IYx/HDmvWIwL8ZDEW/ZbUj0DchD4W02sMmbf1Au+vYFc5OX7BhaDhMedXKd/b2NmQKSFHsz X-Received: by 2002:a81:1282:: with SMTP id 124mr7309970yws.154.1550225180785; Fri, 15 Feb 2019 02:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225180; cv=none; d=google.com; s=arc-20160816; b=BF4p5oPaloZsWScBQkh8cWxyyaOjxjNxUuN5QmuuCwX5Vagc20ewKFVHonBhBpF8M2 v6qlKqhBLeU36cDqT1j2mTfryZcowZ3UUjVx1ZDRXwuD9jkHo9QL/ictPe4Q42vHlqn4 pC7GLvM4BGzEjaR6AMQBON8ZyJWx1oAFJb4ElLYI2pp2JZtTV4JmHnZuj3NOc5sh084X GWQHf48gACcfKN/xKYMz/jxEO1kAG5aC/M22pOJPWYWJ6f0UbvFDqftiDxCtNFAItD7A tT0z5mG9I0c5qme5usDGeIQiDYnbdtFbIeLNp4CfLzxum1ZYffxDWAD0XSv3bIbygg5E iUTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=7w8Zpq45HQbH5nKUE/UAn06lB5crmHwLLdpiz5+e7bw=; b=qLytCm6bvxhDD3KFOY55O+RXogkwSoe7m+kPzf7exVegmh5K9qV0RK8EqE1vVmsp/k 02IzTqlCprkyyi5nluV/JyW5dW6Ubv2M089zpY2h/qgXxPhU+cxRYqtzZxpgWzcbNZM1 3XCc1XsfFZtshYOCHfJKBYN9021WPWk6fZk7BgUSEpmXsRsd44LQG9NkqhXeuccj9jAf IPrL0Ob31o4HD3Bg7VVP5RmVbRGxbe5LE0eS899VxyHoVM/Qu4pypbAAXIc/ZikMLHyW 1TJKBSkYsJ5bbmrdBlMLfBa1vF66BmZO23E9NI2dxz/zTxIgH3AhP1yfOAeph9FH1th6 LRJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p133si2979446ybb.449.2019.02.15.02.06.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:06:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaNw-0001E1-7Y for patch@linaro.org; Fri, 15 Feb 2019 05:06:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJq-0006mp-2m for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000PO-CS for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:04 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38774 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJg-0008JV-JF; Fri, 15 Feb 2019 05:01:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJO-00027S-Bi; Fri, 15 Feb 2019 10:01:39 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:44 +0000 Message-Id: <20190215100058.20015-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 03/17] target/ppc: convert vspltis[bhw] to use vector operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson --- target/ppc/helper.h | 3 --- target/ppc/int_helper.c | 15 --------------- target/ppc/translate/vmx-impl.inc.c | 36 ++++++++---------------------------- 3 files changed, 8 insertions(+), 46 deletions(-) -- 2.11.0 diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 553ff500c8..2aa60e5d36 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -246,9 +246,6 @@ DEF_HELPER_3(vrld, void, avr, avr, avr) DEF_HELPER_3(vsl, void, avr, avr, avr) DEF_HELPER_3(vsr, void, avr, avr, avr) DEF_HELPER_4(vsldoi, void, avr, avr, avr, i32) -DEF_HELPER_2(vspltisb, void, avr, i32) -DEF_HELPER_2(vspltish, void, avr, i32) -DEF_HELPER_2(vspltisw, void, avr, i32) DEF_HELPER_3(vspltb, void, avr, avr, i32) DEF_HELPER_3(vsplth, void, avr, avr, i32) DEF_HELPER_3(vspltw, void, avr, avr, i32) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index ffccda8b9b..2f793a3543 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1998,21 +1998,6 @@ VNEG(vnegw, s32) VNEG(vnegd, s64) #undef VNEG -#define VSPLTI(suffix, element, splat_type) \ - void helper_vspltis##suffix(ppc_avr_t *r, uint32_t splat) \ - { \ - splat_type x = (int8_t)(splat << 3) >> 3; \ - int i; \ - \ - for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ - r->element[i] = x; \ - } \ - } -VSPLTI(b, s8, int8_t) -VSPLTI(h, s16, int16_t) -VSPLTI(w, s32, int32_t) -#undef VSPLTI - #define VSR(suffix, element, mask) \ void helper_vsr##suffix(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ { \ diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index b104c6e38e..c26c342e16 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -704,25 +704,21 @@ GEN_VXRFORM_DUAL(vcmpbfp, PPC_ALTIVEC, PPC_NONE, \ GEN_VXRFORM_DUAL(vcmpgtfp, PPC_ALTIVEC, PPC_NONE, \ vcmpgtud, PPC_NONE, PPC2_ALTIVEC_207) -#define GEN_VXFORM_SIMM(name, opc2, opc3) \ +#define GEN_VXFORM_DUPI(name, tcg_op, opc2, opc3) \ static void glue(gen_, name)(DisasContext *ctx) \ { \ - TCGv_ptr rd; \ - TCGv_i32 simm; \ + int simm; \ if (unlikely(!ctx->altivec_enabled)) { \ gen_exception(ctx, POWERPC_EXCP_VPU); \ return; \ } \ - simm = tcg_const_i32(SIMM5(ctx->opcode)); \ - rd = gen_avr_ptr(rD(ctx->opcode)); \ - gen_helper_##name (rd, simm); \ - tcg_temp_free_i32(simm); \ - tcg_temp_free_ptr(rd); \ + simm = SIMM5(ctx->opcode); \ + tcg_op(avr64_offset(rD(ctx->opcode), true), 16, 16, simm); \ } -GEN_VXFORM_SIMM(vspltisb, 6, 12); -GEN_VXFORM_SIMM(vspltish, 6, 13); -GEN_VXFORM_SIMM(vspltisw, 6, 14); +GEN_VXFORM_DUPI(vspltisb, tcg_gen_gvec_dup8i, 6, 12); +GEN_VXFORM_DUPI(vspltish, tcg_gen_gvec_dup16i, 6, 13); +GEN_VXFORM_DUPI(vspltisw, tcg_gen_gvec_dup32i, 6, 14); #define GEN_VXFORM_NOA(name, opc2, opc3) \ static void glue(gen_, name)(DisasContext *ctx) \ @@ -802,22 +798,6 @@ GEN_VXFORM_NOA(vprtybw, 1, 24); GEN_VXFORM_NOA(vprtybd, 1, 24); GEN_VXFORM_NOA(vprtybq, 1, 24); -#define GEN_VXFORM_SIMM(name, opc2, opc3) \ -static void glue(gen_, name)(DisasContext *ctx) \ - { \ - TCGv_ptr rd; \ - TCGv_i32 simm; \ - if (unlikely(!ctx->altivec_enabled)) { \ - gen_exception(ctx, POWERPC_EXCP_VPU); \ - return; \ - } \ - simm = tcg_const_i32(SIMM5(ctx->opcode)); \ - rd = gen_avr_ptr(rD(ctx->opcode)); \ - gen_helper_##name (rd, simm); \ - tcg_temp_free_i32(simm); \ - tcg_temp_free_ptr(rd); \ - } - #define GEN_VXFORM_UIMM(name, opc2, opc3) \ static void glue(gen_, name)(DisasContext *ctx) \ { \ @@ -1240,7 +1220,7 @@ GEN_VXFORM_DUAL(vsldoi, PPC_ALTIVEC, PPC_NONE, #undef GEN_VXRFORM_DUAL #undef GEN_VXRFORM1 #undef GEN_VXRFORM -#undef GEN_VXFORM_SIMM +#undef GEN_VXFORM_DUPI #undef GEN_VXFORM_NOA #undef GEN_VXFORM_UIMM #undef GEN_VAFORM_PAIRED From patchwork Fri Feb 15 10:00:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158487 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp517126jaa; Fri, 15 Feb 2019 02:05:55 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia0n8gbzGP1FYuVEK58pzUrPyJWxAletMvpsgO1M8mjS7InEIjtb31/t/GzThEe8Ltl4fYb X-Received: by 2002:a81:480d:: with SMTP id v13mr439697ywa.240.1550225155433; Fri, 15 Feb 2019 02:05:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225155; cv=none; d=google.com; s=arc-20160816; b=y2wFcAUVsGL7toR91Y3/D2gszTDtBDKHw18+P4a6wO5by7SO8Ps77Adm4qL8R52ZSi 5K0olc+OTcnUQAueKXkXNcqQzjCzVfMLtV8kONi9dE9CTg+GyLsp15qbtaTaFyJfqTb5 r7AyBtw5yJZP7jT0aEQMLF/y2McZ9luL2VmolCnGsRJ1HYzV7ufSuxubkNf1Zgp2+nRO /VAaAbw8Ab3Rnpwi2VK72xk+QepCOIUMv/mIk6r1eLCWWhZTDcvTUnwi/t7e1MWxUFpl JDL4cWVnRIKttMJ6djcwfKErvCXm6caUgb/TRnnYjvhW+r/D5ZWrFN5fiODZhb+2uipc 9Bow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=9B/JYCxItYHEp6rt6c0RO0FmJisM47iNmyA5Buf+qdU=; b=YyN9Nh1eD+maGeKFLnQZy2OmG68D0pcvpRTp2allmCYqF0dnWM5KjIENa/u68LIviB 2FWqm9VSosxSn0ayXO9r75jYHdaT8SqM8V0dN3uE9MjZX2GxtIHng9YIxd2V0jSFCeQq YL6vjDDGY4SIMS+AlmieeMYfEOcXwd16h7bAGmrks/SROF5uZzbAAc0zM7MYP4WrR/9p 0kTKqrXZ9breREc+4X64c2OlXLSbV3lB8OQ6FZCke7UvwUKnI4WlMLUeOxKbdcNKDugn RCWH4ySkDjsX/uV3PDhYkqLsjPkqGnrnkNOgZZGej4ppDVc8yvtPtRZ8E4dmI/GzG4gu PNpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k123si3002654ywd.218.2019.02.15.02.05.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:05:55 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaNW-0000st-QN for patch@linaro.org; Fri, 15 Feb 2019 05:05:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJq-0006mo-2A for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000Oi-9E for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:04 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38770 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJg-0008JC-JP; Fri, 15 Feb 2019 05:01:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJQ-00027S-3G; Fri, 15 Feb 2019 10:01:41 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:45 +0000 Message-Id: <20190215100058.20015-5-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 04/17] target/ppc: convert vsplt[bhw] to use vector operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/helper.h | 3 --- target/ppc/int_helper.c | 19 --------------- target/ppc/translate/vmx-impl.inc.c | 46 ++++++++++++++++++++++--------------- 3 files changed, 27 insertions(+), 41 deletions(-) -- 2.11.0 diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 2aa60e5d36..069daa9883 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -246,9 +246,6 @@ DEF_HELPER_3(vrld, void, avr, avr, avr) DEF_HELPER_3(vsl, void, avr, avr, avr) DEF_HELPER_3(vsr, void, avr, avr, avr) DEF_HELPER_4(vsldoi, void, avr, avr, avr, i32) -DEF_HELPER_3(vspltb, void, avr, avr, i32) -DEF_HELPER_3(vsplth, void, avr, avr, i32) -DEF_HELPER_3(vspltw, void, avr, avr, i32) DEF_HELPER_3(vextractub, void, avr, avr, i32) DEF_HELPER_3(vextractuh, void, avr, avr, i32) DEF_HELPER_3(vextractuw, void, avr, avr, i32) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 2f793a3543..5c9623e952 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1869,25 +1869,6 @@ void helper_vslo(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) #endif } -/* Experimental testing shows that hardware masks the immediate. */ -#define _SPLAT_MASKED(element) (splat & (ARRAY_SIZE(r->element) - 1)) -#define SPLAT_ELEMENT(element) _SPLAT_MASKED(element) -#define VSPLT(suffix, element, access) \ - void helper_vsplt##suffix(ppc_avr_t *r, ppc_avr_t *b, uint32_t splat) \ - { \ - uint32_t s = b->access(SPLAT_ELEMENT(element)); \ - int i; \ - \ - for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ - r->access(i) = s; \ - } \ - } -VSPLT(b, u8, VsrB) -VSPLT(h, u16, VsrH) -VSPLT(w, u32, VsrW) -#undef VSPLT -#undef SPLAT_ELEMENT -#undef _SPLAT_MASKED #if defined(HOST_WORDS_BIGENDIAN) #define VINSERT(suffix, element) \ void helper_vinsert##suffix(ppc_avr_t *r, ppc_avr_t *b, uint32_t index) \ diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index c26c342e16..41ddbd879f 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -798,24 +798,32 @@ GEN_VXFORM_NOA(vprtybw, 1, 24); GEN_VXFORM_NOA(vprtybd, 1, 24); GEN_VXFORM_NOA(vprtybq, 1, 24); -#define GEN_VXFORM_UIMM(name, opc2, opc3) \ -static void glue(gen_, name)(DisasContext *ctx) \ - { \ - TCGv_ptr rb, rd; \ - TCGv_i32 uimm; \ - if (unlikely(!ctx->altivec_enabled)) { \ - gen_exception(ctx, POWERPC_EXCP_VPU); \ - return; \ - } \ - uimm = tcg_const_i32(UIMM5(ctx->opcode)); \ - rb = gen_avr_ptr(rB(ctx->opcode)); \ - rd = gen_avr_ptr(rD(ctx->opcode)); \ - gen_helper_##name (rd, rb, uimm); \ - tcg_temp_free_i32(uimm); \ - tcg_temp_free_ptr(rb); \ - tcg_temp_free_ptr(rd); \ +static void gen_vsplt(DisasContext *ctx, int vece) +{ + int uimm, dofs, bofs; + + if (unlikely(!ctx->altivec_enabled)) { + gen_exception(ctx, POWERPC_EXCP_VPU); + return; } + uimm = UIMM5(ctx->opcode); + bofs = avr64_offset(rB(ctx->opcode), true); + dofs = avr64_offset(rD(ctx->opcode), true); + + /* Experimental testing shows that hardware masks the immediate. */ + bofs += (uimm << vece) & 15; +#ifndef HOST_WORDS_BIGENDIAN + bofs ^= 15; + bofs &= ~((1 << vece) - 1); +#endif + + tcg_gen_gvec_dup_mem(vece, dofs, bofs, 16, 16); +} + +#define GEN_VXFORM_VSPLT(name, vece, opc2, opc3) \ +static void glue(gen_, name)(DisasContext *ctx) { gen_vsplt(ctx, vece); } + #define GEN_VXFORM_UIMM_ENV(name, opc2, opc3) \ static void glue(gen_, name)(DisasContext *ctx) \ { \ @@ -858,9 +866,9 @@ static void glue(gen_, name)(DisasContext *ctx) \ tcg_temp_free_ptr(rd); \ } -GEN_VXFORM_UIMM(vspltb, 6, 8); -GEN_VXFORM_UIMM(vsplth, 6, 9); -GEN_VXFORM_UIMM(vspltw, 6, 10); +GEN_VXFORM_VSPLT(vspltb, MO_8, 6, 8); +GEN_VXFORM_VSPLT(vsplth, MO_16, 6, 9); +GEN_VXFORM_VSPLT(vspltw, MO_32, 6, 10); GEN_VXFORM_UIMM_SPLAT(vextractub, 6, 8, 15); GEN_VXFORM_UIMM_SPLAT(vextractuh, 6, 9, 14); GEN_VXFORM_UIMM_SPLAT(vextractuw, 6, 10, 12); From patchwork Fri Feb 15 10:00:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158490 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp519602jaa; Fri, 15 Feb 2019 02:08:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IbysjPpWEIiLqAhTx96rjm0zXltiFKzjLATqkauLmWdaT4hW2B86CbMJT6acekF/AevIoAQ X-Received: by 2002:a81:a743:: with SMTP id e64mr7162653ywh.167.1550225319025; Fri, 15 Feb 2019 02:08:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225319; cv=none; d=google.com; s=arc-20160816; b=ImwifXppiymjN3QGPAXBxtYq6kQo2UqD28v/71nhLk+ZKXGHKYnrBuqyt33qI22LgA 4phry12b9+Dm2khguLbEPumvmvdonZrxEfnzeNJvvvxyLDBzTIJ5s1xaZ4nZAzMzf6tv TZWVpIAZA/zNc4T6hh0JrdVCeTz1GhYsNzxH+IYBJJUUqTURgb7aUWj5qtPV1rhzo+XI xHNhzWmi8+QVrnjrKLi3uCZDjrSC2vjFgsRHIhMe4B22+IaSfG/j33NYuDRYWGS2p+FS A0XvaDqtthQdhgzRwu7R8BcIPizEAiLWBblV9cwEDe7dAmtTkCR05ZuuxBW3d/qSi7eq C6vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=r4h3daKOhS098dOJUOpSBMpgdfwv9SVHIwJQOJ4jtvk=; b=fwH8D/8Yeh2E+7ZXkDEueQfsbGUSWl/LB9mSk72trcjzXAUeYTBzf+MQ/bZ93h4oRr 7SNg4UJUSBmIIj/NWehJIbB1PUCvwqG/Je+Bz5A1+6cKo/SZQnLWagk86JHcF5H33J/c 4ba+HkqNxcBhE2QSReHQr/0gqR8K9T4uE6lKpYd0pPqxtaiR+sViCwlQg9jy58ejB5bA avA39T0eMyxFYJGpGqLdqgAl/Da4SMk3VjgVXVogH12Ov7+WrMJv55NdpnEPpkTDlUUt 6S6k5MoI9pEMbS87elZlSoCt2o0N+yfbBKmPFQFzzKVfbKmB5mV2EqrkYbun2RvfPmjY oCWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h189si2981972ywe.165.2019.02.15.02.08.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:08:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaQA-000335-El for patch@linaro.org; Fri, 15 Feb 2019 05:08:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJs-0006nD-Bg for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000P1-9W for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:08 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38777 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJg-0008LM-JT; Fri, 15 Feb 2019 05:01:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJR-00027S-T7; Fri, 15 Feb 2019 10:01:43 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:46 +0000 Message-Id: <20190215100058.20015-6-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 05/17] target/ppc: convert VSX logical operations to vector operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 43 +++++++++++++++---------------------- 1 file changed, 17 insertions(+), 26 deletions(-) -- 2.11.0 diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c index ed4fdceacf..2576d81ac5 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -10,6 +10,11 @@ static inline void set_vsr(int n, TCGv_i64 src) tcg_gen_st_i64(src, cpu_env, offsetof(CPUPPCState, vsr[n].u64[1])); } +static inline int vsr_full_offset(int n) +{ + return offsetof(CPUPPCState, vsr[n].u64[0]); +} + static inline void get_cpu_vsrh(TCGv_i64 dst, int n) { if (n < 32) { @@ -1255,40 +1260,26 @@ static void gen_xxbrw(DisasContext *ctx) tcg_temp_free_i64(xbl); } -#define VSX_LOGICAL(name, tcg_op) \ +#define VSX_LOGICAL(name, vece, tcg_op) \ static void glue(gen_, name)(DisasContext * ctx) \ { \ - TCGv_i64 t0; \ - TCGv_i64 t1; \ - TCGv_i64 t2; \ if (unlikely(!ctx->vsx_enabled)) { \ gen_exception(ctx, POWERPC_EXCP_VSXU); \ return; \ } \ - t0 = tcg_temp_new_i64(); \ - t1 = tcg_temp_new_i64(); \ - t2 = tcg_temp_new_i64(); \ - get_cpu_vsrh(t0, xA(ctx->opcode)); \ - get_cpu_vsrh(t1, xB(ctx->opcode)); \ - tcg_op(t2, t0, t1); \ - set_cpu_vsrh(xT(ctx->opcode), t2); \ - get_cpu_vsrl(t0, xA(ctx->opcode)); \ - get_cpu_vsrl(t1, xB(ctx->opcode)); \ - tcg_op(t2, t0, t1); \ - set_cpu_vsrl(xT(ctx->opcode), t2); \ - tcg_temp_free_i64(t0); \ - tcg_temp_free_i64(t1); \ - tcg_temp_free_i64(t2); \ + tcg_op(vece, vsr_full_offset(xT(ctx->opcode)), \ + vsr_full_offset(xA(ctx->opcode)), \ + vsr_full_offset(xB(ctx->opcode)), 16, 16); \ } -VSX_LOGICAL(xxland, tcg_gen_and_i64) -VSX_LOGICAL(xxlandc, tcg_gen_andc_i64) -VSX_LOGICAL(xxlor, tcg_gen_or_i64) -VSX_LOGICAL(xxlxor, tcg_gen_xor_i64) -VSX_LOGICAL(xxlnor, tcg_gen_nor_i64) -VSX_LOGICAL(xxleqv, tcg_gen_eqv_i64) -VSX_LOGICAL(xxlnand, tcg_gen_nand_i64) -VSX_LOGICAL(xxlorc, tcg_gen_orc_i64) +VSX_LOGICAL(xxland, MO_64, tcg_gen_gvec_and) +VSX_LOGICAL(xxlandc, MO_64, tcg_gen_gvec_andc) +VSX_LOGICAL(xxlor, MO_64, tcg_gen_gvec_or) +VSX_LOGICAL(xxlxor, MO_64, tcg_gen_gvec_xor) +VSX_LOGICAL(xxlnor, MO_64, tcg_gen_gvec_nor) +VSX_LOGICAL(xxleqv, MO_64, tcg_gen_gvec_eqv) +VSX_LOGICAL(xxlnand, MO_64, tcg_gen_gvec_nand) +VSX_LOGICAL(xxlorc, MO_64, tcg_gen_gvec_orc) #define VSX_XXMRG(name, high) \ static void glue(gen_, name)(DisasContext * ctx) \ From patchwork Fri Feb 15 10:00:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158491 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp523670jaa; Fri, 15 Feb 2019 02:12:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IYtDbs9nBmAatdcbI85GwZfyKF5AO4sF2WlDT7wvRlz1/+qVp2vWsY5W286bL3NzTDg+0Af X-Received: by 2002:a25:6c88:: with SMTP id h130mr7249552ybc.240.1550225559740; Fri, 15 Feb 2019 02:12:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225559; cv=none; d=google.com; s=arc-20160816; b=cIQ5BFsNOzl8zIQGxnp9hwlaF3BUViWp/7Wb9gTMIZzLEzlo++6Am6zOl4CuycCVCH g8FbxK6N6JItKPlJ+DC/YwbBFG/icbkfoEJ0SVa6i03RXtJBLv2riMui9E6MsIvy1TlZ eAgr4QOlkiVn12onpXFzeyQ+pp/STtzkQTjWXwbK3Fc75ec2+dsxXhqfqtnDOVvStCdK 9qLuTkw/lpbhp01NY/SOQUzUs4XQGLdehpA1n7K65rgBYKFduICIlAYUGpmyeb/uYaOv tndzfUzJowSXWOlvq4NK4GwHOvtSyxFsIdp2/W3oC26mshcUnvPiKCxWsWB8QxA2YeU1 GueA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=fkFZK4u/kI+YxgOBuIiSno8xnw+O6ksVg3jLEYSPIt8=; b=VIhpIPEHu6TNrDKIaxoUDy/DvZBMLVkaE59ViHcCSEGnFywknNKQBhu2VzzXzoXX/Y H7qj1TsoIYZMjvFn2uFNt8PbH3hhYjhcrPIgnA5lWAjnnCpDtJWRYqFdhPvrSeWCmR+o nc7t/XaUasXSDGJNMTBxrf9vBM+sZzY/1QBxazATFnqg7QXx2JnF545cdoPWi+yjkgCr U7BuktrlOmRhswDdIZx8PKymvoR6gpzwZW7rOOcmjIimrQlhiqvMwBrf8euZDcCOf4Fc 413NMxiN5lxepnWY0NzS6Gu1trWEjpZhjZrVP3ibR/AIS5A/8xNxDtBO1U/FrVAi7S++ ZB+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g124si3058503ywa.179.2019.02.15.02.12.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:12:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaU3-0005gt-82 for patch@linaro.org; Fri, 15 Feb 2019 05:12:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJq-0006mn-27 for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000OR-6r for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:04 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38785 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJg-0008NT-JB; Fri, 15 Feb 2019 05:01:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJT-00027S-CL; Fri, 15 Feb 2019 10:01:46 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:47 +0000 Message-Id: <20190215100058.20015-7-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 06/17] target/ppc: convert xxspltib to vector operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.11.0 diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c index 2576d81ac5..944fc0608a 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -1397,9 +1397,10 @@ static void gen_xxspltw(DisasContext *ctx) static void gen_xxspltib(DisasContext *ctx) { - unsigned char uim8 = IMM8(ctx->opcode); - TCGv_i64 vsr; - if (xS(ctx->opcode) < 32) { + uint8_t uim8 = IMM8(ctx->opcode); + int rt = xT(ctx->opcode); + + if (rt < 32) { if (unlikely(!ctx->altivec_enabled)) { gen_exception(ctx, POWERPC_EXCP_VPU); return; @@ -1410,11 +1411,7 @@ static void gen_xxspltib(DisasContext *ctx) return; } } - vsr = tcg_temp_new_i64(); - tcg_gen_movi_i64(vsr, pattern(uim8)); - set_cpu_vsrh(xT(ctx->opcode), vsr); - set_cpu_vsrl(xT(ctx->opcode), vsr); - tcg_temp_free_i64(vsr); + tcg_gen_gvec_dup8i(vsr_full_offset(rt), 16, 16, uim8); } static void gen_xxsldwi(DisasContext *ctx) From patchwork Fri Feb 15 10:00:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158485 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp513767jaa; Fri, 15 Feb 2019 02:02:35 -0800 (PST) X-Google-Smtp-Source: AHgI3IbS0XG3Ge4ro+OfG6wuzC0yulCSAQQFI+P2CLbKI3bwCK93yfGauQ+4E37GjkgCj++At1Ob X-Received: by 2002:a0d:c6c6:: with SMTP id i189mr7164691ywd.12.1550224955370; Fri, 15 Feb 2019 02:02:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550224955; cv=none; d=google.com; s=arc-20160816; b=F1176VecAbXIaWcotYLVowp09d9Xm3RMzPBoOnLgcFTGfHCYeUFDkikQgqVMKac7dR nnxGSCbHOykD/ADq0dLPkFgaqRQN3ebmw/P+hMgWvwAbOZK/PBYW5cBZF6LTZF+C5RNh R7CsYl0RbUh7bNyUNW9w+nO+PUw1NS0VLj8OZtGlBACkmPhl6LTwjkeCC+TnvywKzvzp wVQjZAzfgb2KtjoUQp3c0DymEEXYVnYb5vWWUMpJikA6VUtDFJGK8CoFbfIU0vpwNueM mqrm9MI3RxNhbz0s1/mNysLim1P6ejQjDyOTIzdTyQl/mC0SXZKPihnnG0RpDvJS8aBs kVUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=C4EaAhYnb6O2pBMgWPBuR8/YyuMozL/8T0q6q3qhaEg=; b=dkkAY3iZIfgQrVWaEXD/nVDogm/GSwsl6EwzJSEPprGYS7MBlDJnI+crvX4zSniqg4 Xey5/Ls1I1Vw63SevDmmdW4fE6bKpdSqUicFaL9sKBiLX1S0+aD47xJ5R9/Tt48JEwkj nwblz+ct4+n7m/iGPz8gIUE+ye1p5XXdncFouArR+MbYqc1RPWmytUUQqEfvm05Ea6PT 06GCS3IGzFW3xk0fZFBhHpT1Xn5roHlobkhoMTiDtj0f1tiriQEXp8695Pu1ETIhoV5d d53fg4kf66AMaAcp7LGmN9HAIb+GLYlHfl/uW2o7WXrVoqUvhEWxFcBJVJlVxP9Ct7cl 847g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p3si3064929ywh.408.2019.02.15.02.02.35 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:02:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaKI-0006n6-Tv for patch@linaro.org; Fri, 15 Feb 2019 05:02:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJq-0006mr-5t for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000PU-Bo for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:06 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38787 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJg-0008OR-JT; Fri, 15 Feb 2019 05:01:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJW-00027S-FC; Fri, 15 Feb 2019 10:01:47 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:48 +0000 Message-Id: <20190215100058.20015-8-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 07/17] target/ppc: convert xxspltw to vector operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) -- 2.11.0 diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c index 944fc0608a..0e8cecb00a 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -1359,38 +1359,24 @@ static void gen_xxsel(DisasContext * ctx) static void gen_xxspltw(DisasContext *ctx) { - TCGv_i64 b, b2; - TCGv_i64 vsr; + int rt = xT(ctx->opcode); + int rb = xB(ctx->opcode); + int uim = UIM(ctx->opcode); + int tofs, bofs; if (unlikely(!ctx->vsx_enabled)) { gen_exception(ctx, POWERPC_EXCP_VSXU); return; } - vsr = tcg_temp_new_i64(); - if (UIM(ctx->opcode) & 2) { - get_cpu_vsrl(vsr, xB(ctx->opcode)); - } else { - get_cpu_vsrh(vsr, xB(ctx->opcode)); - } - - b = tcg_temp_new_i64(); - b2 = tcg_temp_new_i64(); - - if (UIM(ctx->opcode) & 1) { - tcg_gen_ext32u_i64(b, vsr); - } else { - tcg_gen_shri_i64(b, vsr, 32); - } - - tcg_gen_shli_i64(b2, b, 32); - tcg_gen_or_i64(vsr, b, b2); - set_cpu_vsrh(xT(ctx->opcode), vsr); - set_cpu_vsrl(xT(ctx->opcode), vsr); + tofs = vsr_full_offset(rt); + bofs = vsr_full_offset(rb); + bofs += uim << MO_32; +#ifndef HOST_WORDS_BIG_ENDIAN + bofs ^= 8 | 4; +#endif - tcg_temp_free_i64(vsr); - tcg_temp_free_i64(b); - tcg_temp_free_i64(b2); + tcg_gen_gvec_dup_mem(MO_32, tofs, bofs, 16, 16); } #define pattern(x) (((x) & 0xff) * (~(uint64_t)0 / 0xff)) From patchwork Fri Feb 15 10:00:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158486 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp513884jaa; Fri, 15 Feb 2019 02:02:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IZYGbs2aPfVBxf3cwDfZ0alAY2NmJL+nPR+PYwNsuzInprCLPTBqEyHsYWtg68UMNcfjSBd X-Received: by 2002:a25:542:: with SMTP id 63mr5725911ybf.27.1550224961773; Fri, 15 Feb 2019 02:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550224961; cv=none; d=google.com; s=arc-20160816; b=q67n3rSkPN4OJai2pwnqZIJC3UtBseQmKSyl2JH52SpRblGbPLK8vQaVm39CO63eTX ddnWpkSx2+oru+Mw+2psGZI7Co63L7hbtJf2VfKKhSZbcKdpp/SZSsPObvg7CM0y7qkB VL9GdLTSyN0NfurBBClMNp23fVB3/gDRdEw8CTWAw4mgkzHZSO6Jav3pDcyBQUlsOe4u xiIJS6qPIU6eMp/trKYsZT2SUA23eeb9royJYaVaRa9FOWOcDYk4ceJCF8tM9TFfdfkW 3wg97/xAyreWBJdZIKCa+Dp3dO0eP1Qh+jdjhJ7gHa0p5hSXQAwCY9qZlX3yfPT93tRB 1BhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=Vxeu1aKyc1elSVFU6DE1QW+ZgMoxKNvRLwqZ0oorDwQ=; b=S0fKsgDb9Li2I6gwZFG9qtXpx34OWXRICOU80nNzWp4BLWupRtIiYUOnLAX+8VS5Jr mKeplljINXyB569jPAWY7w00MI9G0rqaxkOJ6ukQK/sY+k/ICEEJhZXGyHdhL7pUmXfc rFpyl/fbCYi2eEMQ4i4l0c22wV3qgDOgsNtHBQJuadnDMqPXSF8Xpx7XHg6WBhWEXxvA d21+bm+K3DWttc12MXQfXY1RTH7ElfmpBdNhUj3skSlXw7SL/axbKGF3/rbW1nv9X7pi 4OLB789cpEp+Ls3qvSkYDb8v1m0Kriz2q57eUouHWBKWVnqGdWUpDrAkKP5i2RbLnG5h meIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 138si275599ywe.381.2019.02.15.02.02.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:02:41 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaKP-0006rG-88 for patch@linaro.org; Fri, 15 Feb 2019 05:02:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJs-0006nK-GY for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000P5-Au for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:08 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38791 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJg-0008Q8-JL; Fri, 15 Feb 2019 05:01:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJX-00027S-Pq; Fri, 15 Feb 2019 10:01:48 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:49 +0000 Message-Id: <20190215100058.20015-9-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 08/17] target/ppc: convert xxsel to vector operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 55 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 28 deletions(-) -- 2.11.0 diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c index 0e8cecb00a..e73197e717 100644 --- a/target/ppc/translate/vsx-impl.inc.c +++ b/target/ppc/translate/vsx-impl.inc.c @@ -1321,40 +1321,39 @@ static void glue(gen_, name)(DisasContext * ctx) \ VSX_XXMRG(xxmrghw, 1) VSX_XXMRG(xxmrglw, 0) -static void gen_xxsel(DisasContext * ctx) +static void xxsel_i64(TCGv_i64 t, TCGv_i64 a, TCGv_i64 b, TCGv_i64 c) { - TCGv_i64 a, b, c, tmp; - if (unlikely(!ctx->vsx_enabled)) { - gen_exception(ctx, POWERPC_EXCP_VSXU); - return; - } - a = tcg_temp_new_i64(); - b = tcg_temp_new_i64(); - c = tcg_temp_new_i64(); - tmp = tcg_temp_new_i64(); - - get_cpu_vsrh(a, xA(ctx->opcode)); - get_cpu_vsrh(b, xB(ctx->opcode)); - get_cpu_vsrh(c, xC(ctx->opcode)); - tcg_gen_and_i64(b, b, c); tcg_gen_andc_i64(a, a, c); - tcg_gen_or_i64(tmp, a, b); - set_cpu_vsrh(xT(ctx->opcode), tmp); + tcg_gen_or_i64(t, a, b); +} - get_cpu_vsrl(a, xA(ctx->opcode)); - get_cpu_vsrl(b, xB(ctx->opcode)); - get_cpu_vsrl(c, xC(ctx->opcode)); +static void xxsel_vec(unsigned vece, TCGv_vec t, TCGv_vec a, + TCGv_vec b, TCGv_vec c) +{ + tcg_gen_and_vec(vece, b, b, c); + tcg_gen_andc_vec(vece, a, a, c); + tcg_gen_or_vec(vece, t, a, b); +} - tcg_gen_and_i64(b, b, c); - tcg_gen_andc_i64(a, a, c); - tcg_gen_or_i64(tmp, a, b); - set_cpu_vsrl(xT(ctx->opcode), tmp); +static void gen_xxsel(DisasContext *ctx) +{ + static const GVecGen4 g = { + .fni8 = xxsel_i64, + .fniv = xxsel_vec, + .vece = MO_64, + }; + int rt = xT(ctx->opcode); + int ra = xA(ctx->opcode); + int rb = xB(ctx->opcode); + int rc = xC(ctx->opcode); - tcg_temp_free_i64(a); - tcg_temp_free_i64(b); - tcg_temp_free_i64(c); - tcg_temp_free_i64(tmp); + if (unlikely(!ctx->vsx_enabled)) { + gen_exception(ctx, POWERPC_EXCP_VSXU); + return; + } + tcg_gen_gvec_4(vsr_full_offset(rt), vsr_full_offset(ra), + vsr_full_offset(rb), vsr_full_offset(rc), 16, 16, &g); } static void gen_xxspltw(DisasContext *ctx) From patchwork Fri Feb 15 10:00:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158488 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp517453jaa; Fri, 15 Feb 2019 02:06:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ/pAlWC2OKYQ9i7V/qAsFGPtrbxP+sQdt/UoVMhV0x86bcYyqwsThR9otGOowduib4h2Ro X-Received: by 2002:a81:28c3:: with SMTP id o186mr6908504ywo.309.1550225178164; Fri, 15 Feb 2019 02:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225178; cv=none; d=google.com; s=arc-20160816; b=0YAc7wLHOlTtaOpn3ZihE3xk3czhvTw/iUaCrPpjjXC1KZSOdlBbC/QIHdQzXvxbfB Iv5iMGkAW+SKlk985T4NFA1ATcyWDNx77KfPLvAP7uhhJDA6BM+aGLu5AZMJXGkLCKWw tkZFCMuVL9Y3TufkG6BE0WvT3Ft4zVf9A7o8nPQtEvNOGpVFXpiGbqYuLpQ6S3WjVy72 s08KckKinJz1VCgymrljGXUvRlZ+JifwdCo7qZk7Wb+AH+3XsFxZM82WMs35+EJYZia/ hmIetSfre8He/kPdA5dX3TRqLcR5MMti8OdBeI1tg17RBof3dokJdrwhSK+jJYGTdXC3 2yXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=fmSItmk2FEWtgn/2IA8DpNgyGlTSPXoB/ezSgXg5r+8=; b=LIpa5YUAOCdPVgXtaRBPMv2ymUE3Jfw35RSK633uuknvJxkW48oUGKyAz9zA7PLgrV VIZmxHoR9+fayLsGN9EMio4orFbje0OuUZAZr1JopQ7fIp7pD6+cltDUKTsT/Blfkz3B TbRSivjvq/0fyI6ETWQRSZiYnRFWdGRH8WDsziIvmZmo0Ow/SlUvIz9+P9SQNMfvKFUV 1GChitheA+LSMLL3XGEcOYi2IvKbb7gus+Wd45zv9stfCbL3t3mInuQ9/BvU8k56V08r DmSEfEYOcakDaa45lWKk1dMScsQsfwh0oUfrMjeG1Plb58oMxn3ykREX7GHBw+7ioQnZ eLwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j73si2947495ybj.39.2019.02.15.02.06.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:06:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaNt-0000LR-JC for patch@linaro.org; Fri, 15 Feb 2019 05:06:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53607) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaJs-0006n8-8n for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaJm-0000PE-AW for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:02:08 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38794 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaJg-0008SL-JS; Fri, 15 Feb 2019 05:01:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJZ-00027S-5V; Fri, 15 Feb 2019 10:01:50 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:50 +0000 Message-Id: <20190215100058.20015-10-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 09/17] target/ppc: Pass integer to helper_mtvscr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson We can re-use this helper elsewhere if we're not passing in an entire vector register. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/helper.h | 2 +- target/ppc/int_helper.c | 6 +++--- target/ppc/translate/vmx-impl.inc.c | 17 +++++++++++++---- 3 files changed, 17 insertions(+), 8 deletions(-) -- 2.11.0 diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 069daa9883..b3ffe28103 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -294,7 +294,7 @@ DEF_HELPER_5(vmsumuhs, void, env, avr, avr, avr, avr) DEF_HELPER_5(vmsumshm, void, env, avr, avr, avr, avr) DEF_HELPER_5(vmsumshs, void, env, avr, avr, avr, avr) DEF_HELPER_4(vmladduhm, void, avr, avr, avr, avr) -DEF_HELPER_2(mtvscr, void, env, avr) +DEF_HELPER_FLAGS_2(mtvscr, TCG_CALL_NO_RWG, void, env, i32) DEF_HELPER_3(lvebx, void, env, avr, tl) DEF_HELPER_3(lvehx, void, env, avr, tl) DEF_HELPER_3(lvewx, void, env, avr, tl) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 5c9623e952..aa6ad2ce7e 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -457,10 +457,10 @@ void helper_lvsr(ppc_avr_t *r, target_ulong sh) } } -void helper_mtvscr(CPUPPCState *env, ppc_avr_t *r) +void helper_mtvscr(CPUPPCState *env, uint32_t vscr) { - env->vscr = r->VsrW(3); - set_flush_to_zero(vscr_nj, &env->vec_status); + env->vscr = vscr; + set_flush_to_zero((vscr >> VSCR_NJ) & 1, &env->vec_status); } void helper_vaddcuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index 41ddbd879f..182d3fc563 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -196,14 +196,23 @@ static void gen_mfvscr(DisasContext *ctx) static void gen_mtvscr(DisasContext *ctx) { - TCGv_ptr p; + TCGv_i32 val; + int bofs; + if (unlikely(!ctx->altivec_enabled)) { gen_exception(ctx, POWERPC_EXCP_VPU); return; } - p = gen_avr_ptr(rB(ctx->opcode)); - gen_helper_mtvscr(cpu_env, p); - tcg_temp_free_ptr(p); + + val = tcg_temp_new_i32(); + bofs = avr64_offset(rB(ctx->opcode), true); +#ifdef HOST_WORDS_BIGENDIAN + bofs += 3 * 4; +#endif + + tcg_gen_ld_i32(val, cpu_env, bofs); + gen_helper_mtvscr(cpu_env, val); + tcg_temp_free_i32(val); } #define GEN_VX_VMUL10(name, add_cin, ret_carry) \ From patchwork Fri Feb 15 10:00:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158495 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp526684jaa; Fri, 15 Feb 2019 02:16:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IY2a8UQoB/dd6HvYB/KHI5+b175foLZRU1Isml1Lx3We6636+5C0zZkNklHwfAYVxm6JT6r X-Received: by 2002:a5b:784:: with SMTP id b4mr5964585ybq.89.1550225775864; Fri, 15 Feb 2019 02:16:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225775; cv=none; d=google.com; s=arc-20160816; b=dotAkjVOERFey0wLdvAF0cMW+S0LjkvoXg84E3nUDgppQmTgEQWGitGZafMlyt9N9Q v4i3zpL8VZbjoYVXZCuuQv3IRlvwparlFq1hsCx+jYraa3ro4v1fUYNSeIELx3HNX/v0 5vilEtXv0knum+mW++uoJwpPcBLfmhTJNU6ggP9L5UcJGlBAaUm7RK8NfZgPUmP3Xnqn mpzhGLeqaZdhNJqNDLVn+qO5A3BBfAEfHiIo3KOcf7UESrLP9QUogpUCKtGwwaM1e4Kr iOaT/aiFR8mb3dTUeSLN3Bv5BNUyP2VK0xeS4UKq16AomAvHXSGY1Pj6gkAKQ6glgHkv K9XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=BGbaK22LAwQ+L5u4zVySnt66swECzQkb/QRpkJov6yw=; b=bM5r1VSj4ostT4dMxyneG3DmtUQlil7HGzXaRylsW7zmpUycQzhROTjXiEYecD97eq LvlysRdkRM+5MWxufSTyJMf2Xws2ZAYT7nVXRwvXCgLP4EwfWEq6qjOE2JYtRt3zejKl 8Bn03JnXg33OL6Gm7IpZlu+j4dxN0WP5N2FA6NpmHpQ8lscf8AGK8QX8y6zH6KJyT1Xo QoPQHnCy9JjAO4+RzRFd1nh8wcO6t/SqD14o+N6DcyzXl00JPTKfWJm6YgFO5Z7+hKRZ pp83EzcJkCoTOzA7IPjuT495pjdn59qFhwjbulv5HoEsMIeKQ9hbnieGhzDIhKdrETA/ Y1gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k195si2878561ybk.422.2019.02.15.02.16.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:16:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaXX-00083w-Cs for patch@linaro.org; Fri, 15 Feb 2019 05:16:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaPb-0002tq-T8 for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaPW-0002HB-MM for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:03 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38825 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaPW-0002Fb-Bw; Fri, 15 Feb 2019 05:07:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJa-00027S-Ns; Fri, 15 Feb 2019 10:01:51 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:51 +0000 Message-Id: <20190215100058.20015-11-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 10/17] target/ppc: Use helper_mtvscr for reset and gdb X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Not setting flush_to_zero from gdb_set_avr_reg was a bug. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/translate_init.inc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index 59e0b86762..c8b2b760e5 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -601,10 +601,9 @@ static void spr_write_excp_vector(DisasContext *ctx, int sprn, int gprn) static inline void vscr_init(CPUPPCState *env, uint32_t val) { - env->vscr = val; /* Altivec always uses round-to-nearest */ set_float_rounding_mode(float_round_nearest_even, &env->vec_status); - set_flush_to_zero(vscr_nj, &env->vec_status); + helper_mtvscr(env, val); } #ifdef CONFIG_USER_ONLY @@ -9550,7 +9549,7 @@ static int gdb_set_avr_reg(CPUPPCState *env, uint8_t *mem_buf, int n) } if (n == 32) { ppc_maybe_bswap_register(env, mem_buf, 4); - env->vscr = ldl_p(mem_buf); + helper_mtvscr(env, ldl_p(mem_buf)); return 4; } if (n == 33) { From patchwork Fri Feb 15 10:00:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158494 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp526179jaa; Fri, 15 Feb 2019 02:15:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMv6z3GNvwFbZVviEUmCevRMAu6l+uRtRsvkJ6SYwmsYkxOopg36hl7qP9YF14BbzXtbLr X-Received: by 2002:a81:d008:: with SMTP id v8mr7118487ywi.464.1550225739415; Fri, 15 Feb 2019 02:15:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225739; cv=none; d=google.com; s=arc-20160816; b=nxmTdnlL6Q2wFpnGNeExzaJprFxLc3O8yo05zm/LXTUXlc3N/8cZkXZm716wPcMpYC oaf8wWO7+1qd1IREiqCss9mJbxQbuj3eI5H5aZlVJbZWZaKUt5wY7wTGPkwQ412qBWoT X5aF07fGybHfVHNN1U2hS7f1n++p5wdCqnLLxQzmIKSEMYdc5I0D4VhkvvdZ4MO+w3fP lhnaK3EslBHIR2Usb0+5uhMOp1I/V7yylyVBxEjTDzb6zqd4Agl6jFCqcIkRNMpMgCS4 rZWlrEsJUDF2tJ3xVUuJQmUCMWLDYoV6WznaiIbK+jacwhvPCRcz14aaCTFWwhFzVhdr eCug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=wG5jyMVqtOtsQOO3pIgIH+bsQhteVwNYWT2MvVxC/FQ=; b=dILeGoxYjohES0euozPczSO7zVzl48ZaQJYC+wa0NPTljS6s+r9cWQ4cRDO2DWG4Yd AGBLEt4rhtCTw4gkYmTZ2EDAlRRhYsP3cYpb5kVjohggc7lEH+px1IuxiA+Jw5sEdULd oD37FKbEiXbjmCBNzKtng1jU6WZaICf1FeexFTbCiZQccNHmd+wbtfX5e3WO9+FX84dw a04rLCVyt7PJkIeIgLEjN/fN2zG6I2lFMcvw+0ya8RsTLXAhEfPCD3Nkof5p1oLuJDrZ ryYEEHfPyjdnpM5cYrIXRG4v305lwOXzbQrtarbKyZUzRPE48LWNIslWEFacah0VTxYr XXUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f3si1141451ybn.283.2019.02.15.02.15.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:15:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaWw-00083c-UB for patch@linaro.org; Fri, 15 Feb 2019 05:15:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaPk-000323-6C for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaPf-0002SX-49 for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:08 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38831 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaPe-0002PJ-FC; Fri, 15 Feb 2019 05:08:07 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJc-00027S-4O; Fri, 15 Feb 2019 10:01:53 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:52 +0000 Message-Id: <20190215100058.20015-12-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 11/17] target/ppc: Remove vscr_nj and vscr_sat X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson These macros are no longer used. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/cpu.h | 2 -- 1 file changed, 2 deletions(-) -- 2.11.0 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 2c22292e7f..a62f628d28 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -688,8 +688,6 @@ enum { /* Vector status and control register */ #define VSCR_NJ 16 /* Vector non-java */ #define VSCR_SAT 0 /* Vector saturation */ -#define vscr_nj (((env->vscr) >> VSCR_NJ) & 0x1) -#define vscr_sat (((env->vscr) >> VSCR_SAT) & 0x1) /*****************************************************************************/ /* BookE e500 MMU registers */ From patchwork Fri Feb 15 10:00:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158493 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp524536jaa; Fri, 15 Feb 2019 02:13:39 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ9nXpBfhCGjTCh0pZrcnIgjI5kt7r7B2hKI7kE9A6WOtD/I4c8mGA0zLRyyS56vLXjRsUf X-Received: by 2002:a25:8887:: with SMTP id d7mr7087761ybl.308.1550225619830; Fri, 15 Feb 2019 02:13:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225619; cv=none; d=google.com; s=arc-20160816; b=suHl4e6suAPWs0OTpYyzbVHioySt9UGAMv+iX6GAtsuASMRiCN8mOGX4v7etEeI5Ap TAwSvEbiQFmI2NoZ2OKbRVevoAQSvznpRr/Ak1Q9k1mD1jSBB8S1bh7j7eQNJyBG6ivX bqPrkl4MsSnVnY8BQz6lRzxUT++I1JrhhoRFt+E4J0oYIkHTYSinJ1VGZWE5iPY98ZU/ 5K/hilRE8X2DDp9lIwzOGr9vZe35vY5NDJoHz9MvDV1kGztPnL/zR1OXfYqRJzHnx1dS 2QIOUb75afl256620T8GxECxijWPt23Y030ADDWGG2CHicUVo7QpbdFOaNXV/GySfmyV Inkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=5n161kFF12ncgON1ntkwshpKpvRzFIOUg5t7fTddTLE=; b=ON+kqMLvubsJd+htpeKzoTJAj+TokKB/uc2Pdk2+5J1YkJSEMVsrmqgii+6bDlqGid cMlsoYlWVpzwAEXdtY9O0/d+FEobrqv8xRrRYXANVzsAhO1/obSfuCVPtRd54CcaxXtC UVYpHUcpHK5gB02WFNg84HgBSDpkzDoNB0AfDUXnUYZa/+TEJHMSD4sOFFheWeh/czAD EM/zsBzIdHsQUB75mZEt6fBdmkpUkk5/sSKmoVL5fPClKbnr516Xr4XDdsu3genhMjPt CimUUhOtkWqwM+YTyt6o8ejZXISykGe6r5ulhFCIcHjazGxOlHss0/EUtC7lNshPJGeQ WWyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w12si1815508ybk.319.2019.02.15.02.13.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:13:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaV1-0006lN-Ck for patch@linaro.org; Fri, 15 Feb 2019 05:13:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaPb-0002ss-4B for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaPa-0002N4-5H for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:03 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38828 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaPZ-0002MC-Rx; Fri, 15 Feb 2019 05:08:02 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJd-00027S-Av; Fri, 15 Feb 2019 10:01:54 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:53 +0000 Message-Id: <20190215100058.20015-13-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 12/17] target/ppc: Add helper_mfvscr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This is required before changing the representation of the register. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/arch_dump.c | 3 ++- target/ppc/helper.h | 1 + target/ppc/int_helper.c | 5 +++++ target/ppc/translate/vmx-impl.inc.c | 2 +- target/ppc/translate_init.inc.c | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c index 3a00606d01..9ab04b2c38 100644 --- a/target/ppc/arch_dump.c +++ b/target/ppc/arch_dump.c @@ -17,6 +17,7 @@ #include "elf.h" #include "sysemu/dump.h" #include "sysemu/kvm.h" +#include "exec/helper-proto.h" #ifdef TARGET_PPC64 #define ELFCLASS ELFCLASS64 @@ -175,7 +176,7 @@ static void ppc_write_elf_vmxregset(NoteFuncArg *arg, PowerPCCPU *cpu) vmxregset->avr[i].u64[1] = avr->u64[1]; } } - vmxregset->vscr.u32[3] = cpu_to_dump32(s, cpu->env.vscr); + vmxregset->vscr.u32[3] = cpu_to_dump32(s, helper_mfvscr(&cpu->env)); } static void ppc_write_elf_vsxregset(NoteFuncArg *arg, PowerPCCPU *cpu) diff --git a/target/ppc/helper.h b/target/ppc/helper.h index b3ffe28103..7dbb08b9dd 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -295,6 +295,7 @@ DEF_HELPER_5(vmsumshm, void, env, avr, avr, avr, avr) DEF_HELPER_5(vmsumshs, void, env, avr, avr, avr, avr) DEF_HELPER_4(vmladduhm, void, avr, avr, avr, avr) DEF_HELPER_FLAGS_2(mtvscr, TCG_CALL_NO_RWG, void, env, i32) +DEF_HELPER_FLAGS_1(mfvscr, TCG_CALL_NO_RWG, i32, env) DEF_HELPER_3(lvebx, void, env, avr, tl) DEF_HELPER_3(lvehx, void, env, avr, tl) DEF_HELPER_3(lvewx, void, env, avr, tl) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index aa6ad2ce7e..ec3ef9ff3f 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -463,6 +463,11 @@ void helper_mtvscr(CPUPPCState *env, uint32_t vscr) set_flush_to_zero((vscr >> VSCR_NJ) & 1, &env->vec_status); } +uint32_t helper_mfvscr(CPUPPCState *env) +{ + return env->vscr; +} + void helper_vaddcuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i; diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index 182d3fc563..5e13edbf53 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -187,7 +187,7 @@ static void gen_mfvscr(DisasContext *ctx) tcg_gen_movi_i64(avr, 0); set_avr64(rD(ctx->opcode), avr, true); t = tcg_temp_new_i32(); - tcg_gen_ld_i32(t, cpu_env, offsetof(CPUPPCState, vscr)); + gen_helper_mfvscr(t, cpu_env); tcg_gen_extu_i32_i64(avr, t); set_avr64(rD(ctx->opcode), avr, false); tcg_temp_free_i32(t); diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index c8b2b760e5..520d3e582b 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -9520,7 +9520,7 @@ static int gdb_get_avr_reg(CPUPPCState *env, uint8_t *mem_buf, int n) return 16; } if (n == 32) { - stl_p(mem_buf, env->vscr); + stl_p(mem_buf, helper_mfvscr(env)); ppc_maybe_bswap_register(env, mem_buf, 4); return 4; } From patchwork Fri Feb 15 10:00:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158496 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp527146jaa; Fri, 15 Feb 2019 02:16:51 -0800 (PST) X-Google-Smtp-Source: AHgI3IavM+vjBP6g+Exl/8Xif4TkA7hbZpky/SkJrfcjOa2+Halo4IbV7DG7WuuxEao9mi/8T70S X-Received: by 2002:a81:5e09:: with SMTP id s9mr7249655ywb.261.1550225811088; Fri, 15 Feb 2019 02:16:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225811; cv=none; d=google.com; s=arc-20160816; b=zSLNyv0h2eWA2i9ncI23k4RmnCFHccwWFi732SA+f4kzUm/MDki/ltj1QnCdwlGi49 Pa+lRUdflU0kBLA31VQPJZHjKKlUnYSS+vPtEHDopdRHxkYjbqGu3KRsNBMXuOTjJPji pNszJO8/JMgafyd13pEW0AaCBAqXs7QYcNqpdplzqjoRngWWNiwpIYYtmLlSIUgWjlu0 4bmX2omgrhCVqekxDshjzpEQpQCqL0bwlQOa0Qk5pkKQopO/U0Ky01+bOL94i8mMZ/Ry j0CRe4NYukCHVBR4HXAiyAXI3IFUTnNgD95RRAy3iLdEUkSXsIau52f7/uGnCwSEoa8g rCxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=v+/TKRmGj0PLZfuMrTBfBNAbHvfyLfM3u02B+epjNRk=; b=sPN0N5CsoIyq2e9K9nNJ2III5QCu1FulpmRl1RSCrdkTyWQUqHIooBQP7F3a03ifuv eQSFjTbWR/sOlwOGq+ycKVdwWjfGuGgIfesAXWDPvwhVReuys9zQtuosEVj1URMlxaf/ C1sWStmMoqxKHXPUrEXGU1c4zGln7xXRpY5MoX0fOD9SZXj3w90TJ5CCi7tJWKPZkoxd +vD/RivW3RVX6xgzCJ1dm4Jof8Nf0T95OhqsLTL4jd+KwdF1z2YFRPI0eWkaoCR8k7Wa 4tEGSey2tD8Bdmx5DLVYXcJo0g5+r5jJDLZ8ggm/p2bpyo/OyCd0BIM/x1AMoxv6dHch dq2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id b32si2884335ybi.1.2019.02.15.02.16.51 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:16:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaY6-0000Q6-J0 for patch@linaro.org; Fri, 15 Feb 2019 05:16:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaPm-00034O-Na for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaPl-0002Yk-CJ for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:14 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38834 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaPk-0002VD-7O; Fri, 15 Feb 2019 05:08:12 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJf-00027S-0d; Fri, 15 Feb 2019 10:01:56 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:54 +0000 Message-Id: <20190215100058.20015-14-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 13/17] target/ppc: Use mtvscr/mfvscr for vmstate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This is required before changing the representation of the register. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/machine.c | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/target/ppc/machine.c b/target/ppc/machine.c index eff30053b0..756b6d2971 100644 --- a/target/ppc/machine.c +++ b/target/ppc/machine.c @@ -10,6 +10,7 @@ #include "migration/cpu.h" #include "qapi/error.h" #include "kvm_ppc.h" +#include "exec/helper-proto.h" static int cpu_load_old(QEMUFile *f, void *opaque, int version_id) { @@ -17,7 +18,7 @@ static int cpu_load_old(QEMUFile *f, void *opaque, int version_id) CPUPPCState *env = &cpu->env; unsigned int i, j; target_ulong sdr1; - uint32_t fpscr; + uint32_t fpscr, vscr; #if defined(TARGET_PPC64) int32_t slb_nr; #endif @@ -84,7 +85,8 @@ static int cpu_load_old(QEMUFile *f, void *opaque, int version_id) if (!cpu->vhyp) { ppc_store_sdr1(env, sdr1); } - qemu_get_be32s(f, &env->vscr); + qemu_get_be32s(f, &vscr); + helper_mtvscr(env, vscr); qemu_get_be64s(f, &env->spe_acc); qemu_get_be32s(f, &env->spe_fscr); qemu_get_betls(f, &env->msr_mask); @@ -429,6 +431,28 @@ static bool altivec_needed(void *opaque) return (cpu->env.insns_flags & PPC_ALTIVEC); } +static int get_vscr(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field) +{ + PowerPCCPU *cpu = opaque; + helper_mtvscr(&cpu->env, qemu_get_be32(f)); + return 0; +} + +static int put_vscr(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field, QJSON *vmdesc) +{ + PowerPCCPU *cpu = opaque; + qemu_put_be32(f, helper_mfvscr(&cpu->env)); + return 0; +} + +static const VMStateInfo vmstate_vscr = { + .name = "cpu/altivec/vscr", + .get = get_vscr, + .put = put_vscr, +}; + static const VMStateDescription vmstate_altivec = { .name = "cpu/altivec", .version_id = 1, @@ -436,7 +460,21 @@ static const VMStateDescription vmstate_altivec = { .needed = altivec_needed, .fields = (VMStateField[]) { VMSTATE_AVR_ARRAY(env.vsr, PowerPCCPU, 32), - VMSTATE_UINT32(env.vscr, PowerPCCPU), + /* + * Save the architecture value of the vscr, not the internally + * expanded version. Since this architecture value does not + * exist in memory to be stored, this requires a but of hoop + * jumping. We want OFFSET=0 so that we effectively pass CPU + * to the helper functions. + */ + { + .name = "vscr", + .version_id = 0, + .size = sizeof(uint32_t), + .info = &vmstate_vscr, + .flags = VMS_SINGLE, + .offset = 0 + }, VMSTATE_END_OF_LIST() }, }; From patchwork Fri Feb 15 10:00:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158500 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp532863jaa; Fri, 15 Feb 2019 02:24:15 -0800 (PST) X-Google-Smtp-Source: AHgI3Iac5hQmbV+jjBsh9axsZk0+coVOcw9eJZWXufkVx4FWHsFqsW5Ore7PvbuKSznCPjH3lHC2 X-Received: by 2002:a81:208a:: with SMTP id g132mr7245021ywg.230.1550226255180; Fri, 15 Feb 2019 02:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550226255; cv=none; d=google.com; s=arc-20160816; b=rScqy5MPdGSWfRET9hshRb7bWAsHcWCk/RsjViw1zQIENYZ0wdaLBwkDqZoSAbGbzj NWT3L5lzWUTbXuL+8xu0pt+wIjkU0Pz3bNsj0yQLh955S6TVW70jRR4e/hkk+68FGXqp quj0TrEWmMau3RpqFQTaxpk1sw/n1iBneJ/6AMwfU4kbFRUbkLJPAqFfXIJ9938YhZ3x pJRZfVG6lkyTrFUjjluw4XKJ8JhW9CseoyvN7QOvQWGnm9CxR7WHse0OEicZSMD7+geF ZmKUTwmQJ/2wRPETI1Z2TYSqAXvse0NAn92Ir/NF/LOMby9GpHt7I2FOAokjwfJqLtxv 0Bug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=ndH4aOUQ/a3rjxToBVDb4A/fT0IlLUiNNhhS65wKcC8=; b=D6gA6e04QJFOWOpNaBbG8BMV4wLHup9/HXqiDNl/buB5Tk2iGmr8QHyaDur7Zeb5Rx CsM8xwR35GMOsJPqjFI+cZdqI2aOuWsbbxn0NOPd+RufvcEtb+YZeLEtbkQNMfQD5gp3 RQG36BPI/p0jXcj0wiAU4ymCghVfD+gXZZgBHkTvZP6e4je92ewvPceBnFVTZe4INlaR up/JyTn/NKCtO5FKttzClfR7+1PaR6ZioWARa/gHF+dUTSixzMF7UOVy9Pdf+PC9JB5m Y8f69uO0r/Uvvfx/UrSbqBmHU89YLppGqmllNRC2IcnV628zlUmGhJ/WAzHvQ6frY3HP 1Vsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r19si2950681ybg.452.2019.02.15.02.24.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:24:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:36085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guafG-0004kG-N2 for patch@linaro.org; Fri, 15 Feb 2019 05:24:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaQW-0003f2-He for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:09:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaQU-0003Pi-U3 for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:59 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38849 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaQS-0003Kn-Tf; Fri, 15 Feb 2019 05:08:58 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJg-00027S-Jy; Fri, 15 Feb 2019 10:01:58 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:55 +0000 Message-Id: <20190215100058.20015-15-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 14/17] target/ppc: Add set_vscr_sat X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This is required before changing the representation of the register. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/int_helper.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) -- 2.11.0 diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index ec3ef9ff3f..1d8a4b530b 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -468,6 +468,11 @@ uint32_t helper_mfvscr(CPUPPCState *env) return env->vscr; } +static inline void set_vscr_sat(CPUPPCState *env) +{ + env->vscr |= 1 << VSCR_SAT; +} + void helper_vaddcuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i; @@ -581,7 +586,7 @@ VARITHFPFMA(nmsubfp, float_muladd_negate_result | float_muladd_negate_c); } \ } \ if (sat) { \ - env->vscr |= (1 << VSCR_SAT); \ + set_vscr_sat(env); \ } \ } #define VARITHSAT_SIGNED(suffix, element, optype, cvt) \ @@ -853,7 +858,7 @@ void helper_vcmpbfp_dot(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } \ } \ if (sat) { \ - env->vscr |= (1 << VSCR_SAT); \ + set_vscr_sat(env); \ } \ } VCT(uxs, cvtsduw, u32) @@ -900,7 +905,7 @@ void helper_vmhaddshs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -917,7 +922,7 @@ void helper_vmhraddshs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -1029,7 +1034,7 @@ void helper_vmsumshs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -1082,7 +1087,7 @@ void helper_vmsumuhs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -1599,7 +1604,7 @@ void helper_vpkpx(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } \ *r = result; \ if (dosat && sat) { \ - env->vscr |= (1 << VSCR_SAT); \ + set_vscr_sat(env); \ } \ } #define I(x, y) (x) @@ -2043,7 +2048,7 @@ void helper_vsumsws(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) *r = result; if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -2066,7 +2071,7 @@ void helper_vsum2sws(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) *r = result; if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -2085,7 +2090,7 @@ void helper_vsum4sbs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -2102,7 +2107,7 @@ void helper_vsum4shs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } @@ -2121,7 +2126,7 @@ void helper_vsum4ubs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } if (sat) { - env->vscr |= (1 << VSCR_SAT); + set_vscr_sat(env); } } From patchwork Fri Feb 15 10:00:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158497 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp528811jaa; Fri, 15 Feb 2019 02:19:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IY0T9zUpavzZq945X1OGIxKALpatWcgUYDHWAaeTeEc4smzMje30A5HAmPDZ/+9XgWEADnP X-Received: by 2002:a81:7a04:: with SMTP id v4mr7318142ywc.410.1550225942065; Fri, 15 Feb 2019 02:19:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225942; cv=none; d=google.com; s=arc-20160816; b=qlxMNoqRmr18Oq5hFVvJMq0/YJ23AGsJDQWRVBnOfyF8GXg1l9dCK9o1szQYI2JPeC WqT5YBiehp+s6tCLmXHJPeqp43xpLuxVQKlyyT0MH3fQodf4oO1srlQrwIhoZVZDKpCB qnAOUBLA9HrRO0/Ph+ToILjhUXQDwHZS3y6CXQQYkoqn2QxNOYuwBOxKLZb4tsObFs+a bdOD3zo0HO7DL02O4IHj3I0sf+e4+Mnc+oK7X6xg8XNIGODXvFqQEsCZZonACLuKqv83 4LW0tGHceTvrDbptC/GZ1JzdInvQ2kyrMvGWgcA5QDLmIrl/W+jtjjoU94iwTGCWQ6x6 64kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=w8UlEYpdVYvFofe6kq0yKsJDJhMNPjmobr2hyMXrmSs=; b=alrvG8HP6dXyMlyX+AZ4PZI5bNUD+usAbvzy81TFwCMZ3Ela9LM5FpIsXYpsnPFJk1 q1QanhiyFzz2zlIE2Cu12sEIdUuZL1StAmC8zPT+K6M4rNpRuPk9JmW+NzwvW/u6nGAp c1s6GnqEocZ+uqZRT25D/BQI0sHo0+5dF/GUW5l2QkCFhvJa7/Z5Z58obgqrnq6wCB1B DTAQPzqQEeghVVlnvNzqO8rtWt+w8D/p4Q46horOCE79DUP9QrZViwNby437AZqSEMnV jS65nWPPMzkp93EL6cnSyAXyhZ83DvOj/xKTqpcHbHgXO+qcyL8RLn1hs4upK2RhDfwt Gliw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r62si2962153ywf.326.2019.02.15.02.19.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:19:02 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:36012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaaD-0001eg-DR for patch@linaro.org; Fri, 15 Feb 2019 05:19:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaPo-00036A-HI for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaPm-0002aL-TE for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:16 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38837 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaPm-0002ZC-NL; Fri, 15 Feb 2019 05:08:14 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJi-00027S-8o; Fri, 15 Feb 2019 10:01:59 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:56 +0000 Message-Id: <20190215100058.20015-16-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 15/17] target/ppc: Split out VSCR_SAT to a vector field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Change the representation of VSCR_SAT such that it is easy to set from vector code. Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/cpu.h | 4 +++- target/ppc/int_helper.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) -- 2.11.0 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index a62f628d28..171ec9739d 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1051,10 +1051,12 @@ struct CPUPPCState { /* Special purpose registers */ target_ulong spr[1024]; ppc_spr_t spr_cb[1024]; - /* Vector status and control register */ + /* Vector status and control register, minus VSCR_SAT. */ uint32_t vscr; /* VSX registers (including FP and AVR) */ ppc_vsr_t vsr[64] QEMU_ALIGNED(16); + /* Non-zero if and only if VSCR_SAT should be set. */ + ppc_vsr_t vscr_sat QEMU_ALIGNED(16); /* SPE registers */ uint64_t spe_acc; uint32_t spe_fscr; diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 1d8a4b530b..6ad596a08b 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -459,18 +459,23 @@ void helper_lvsr(ppc_avr_t *r, target_ulong sh) void helper_mtvscr(CPUPPCState *env, uint32_t vscr) { - env->vscr = vscr; + env->vscr = vscr & ~(1u << VSCR_SAT); + /* Which bit we set is completely arbitrary, but clear the rest. */ + env->vscr_sat.u64[0] = vscr & (1u << VSCR_SAT); + env->vscr_sat.u64[1] = 0; set_flush_to_zero((vscr >> VSCR_NJ) & 1, &env->vec_status); } uint32_t helper_mfvscr(CPUPPCState *env) { - return env->vscr; + uint32_t sat = (env->vscr_sat.u64[0] | env->vscr_sat.u64[1]) != 0; + return env->vscr | (sat << VSCR_SAT); } static inline void set_vscr_sat(CPUPPCState *env) { - env->vscr |= 1 << VSCR_SAT; + /* The choice of non-zero value is arbitrary. */ + env->vscr_sat.u32[0] = 1; } void helper_vaddcuw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) From patchwork Fri Feb 15 10:00:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158499 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp530266jaa; Fri, 15 Feb 2019 02:20:52 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib4CptQu/mptTPD95JLNCXSAOVfy5mNh3Bf0JSuObCOvZZDgH7xyVqmHtI5ggJD/f2bRsC/ X-Received: by 2002:a81:34a:: with SMTP id 71mr7408202ywd.131.1550226052684; Fri, 15 Feb 2019 02:20:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550226052; cv=none; d=google.com; s=arc-20160816; b=DPCPsNwIiElfnKXH27Uz59zOTcDVK7gw6LPjv5/dDOfFPqBpj8hjNZjT4iNwDtnOny rmJE7eKYdIDjv/gkkYVTaE3SgsOR3vadYOIAgwxG8oKmW332v/4gRFZ1ELRabTAHfQ9I 17l2UVG+KgpkQw5AnYTEr71eyiMoBGb65p7jHrhDkACgN9aGQqEVgcKbO0hIzAc63rqF YpXWIUG62obCPgKPfe7YsOn8Nqf7TvSSdI4+PXIYmG/38o83IRunZSCkhaY1924TqtHQ w2iy2PIGD+Um9FjrRzMZhPHEY2eN01ZI10/cV9xiC3rHLIp2JG9zuQJ0y/t94lPyepHx 2iYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=o3Pq7RN1/1BJeOb/nNylx/6Pg5aukkw4BIAw5rYlJ1g=; b=JlUhTkJbBCm2NpM/c/qfcJURfTsdlhIuuLbB2UPpVRH5o9ddBpCn965tbmwvOKhrcv L0wD57jKi3PeF7rXvh+7KKfeh4z0PbiHrj7mDXwtUibHEEk2eYdyCMOwkd3PxtmMrWXE 7zywUuhKSf375BUmCjZQzk2KHBZvWItYDEOzU/01u2wmLLU1/6T05elLv79UZ3wAFBnB UEVgAvpzxLfAR/syJsvbdeKyID/SKQE+y6a+JFTR5kuv6CSBfaXMc33GKgiSpYy3ZmGn UlKfuBrseySb+yJmAoXBezYxsVsP3Y7bkjBxAUfvCF9D/Llz3j1IAM5A5aAZzjn3lzPV lD7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s186si3027493ybb.280.2019.02.15.02.20.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:20:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:36064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guac0-0002p0-7T for patch@linaro.org; Fri, 15 Feb 2019 05:20:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaQU-0003eJ-QM for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:09:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaQQ-0003Li-3s for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:56 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38843 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaQ9-0002dD-0C; Fri, 15 Feb 2019 05:08:43 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJj-00027S-L5; Fri, 15 Feb 2019 10:02:01 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:57 +0000 Message-Id: <20190215100058.20015-17-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 16/17] target/ppc: convert vadd*s and vsub*s to vector operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/helper.h | 24 ++++++++-------- target/ppc/int_helper.c | 18 +++--------- target/ppc/translate/vmx-impl.inc.c | 57 +++++++++++++++++++++++++++++-------- 3 files changed, 61 insertions(+), 38 deletions(-) -- 2.11.0 diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 7dbb08b9dd..3daf6bf863 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -219,18 +219,18 @@ DEF_HELPER_2(vprtybq, void, avr, avr) DEF_HELPER_3(vsubcuw, void, avr, avr, avr) DEF_HELPER_2(lvsl, void, avr, tl) DEF_HELPER_2(lvsr, void, avr, tl) -DEF_HELPER_4(vaddsbs, void, env, avr, avr, avr) -DEF_HELPER_4(vaddshs, void, env, avr, avr, avr) -DEF_HELPER_4(vaddsws, void, env, avr, avr, avr) -DEF_HELPER_4(vsubsbs, void, env, avr, avr, avr) -DEF_HELPER_4(vsubshs, void, env, avr, avr, avr) -DEF_HELPER_4(vsubsws, void, env, avr, avr, avr) -DEF_HELPER_4(vaddubs, void, env, avr, avr, avr) -DEF_HELPER_4(vadduhs, void, env, avr, avr, avr) -DEF_HELPER_4(vadduws, void, env, avr, avr, avr) -DEF_HELPER_4(vsububs, void, env, avr, avr, avr) -DEF_HELPER_4(vsubuhs, void, env, avr, avr, avr) -DEF_HELPER_4(vsubuws, void, env, avr, avr, avr) +DEF_HELPER_FLAGS_5(vaddsbs, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vaddshs, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vaddsws, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vsubsbs, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vsubshs, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vsubsws, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vaddubs, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vadduhs, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vadduws, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vsububs, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vsubuhs, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) +DEF_HELPER_FLAGS_5(vsubuws, TCG_CALL_NO_RWG, void, avr, avr, avr, avr, i32) DEF_HELPER_3(vadduqm, void, avr, avr, avr) DEF_HELPER_4(vaddecuq, void, avr, avr, avr, avr) DEF_HELPER_4(vaddeuqm, void, avr, avr, avr, avr) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 6ad596a08b..4aeb375edd 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -571,27 +571,17 @@ VARITHFPFMA(nmsubfp, float_muladd_negate_result | float_muladd_negate_c); } #define VARITHSAT_DO(name, op, optype, cvt, element) \ - void helper_v##name(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, \ - ppc_avr_t *b) \ + void helper_v##name(ppc_avr_t *r, ppc_avr_t *vscr_sat, \ + ppc_avr_t *a, ppc_avr_t *b, uint32_t desc) \ { \ int sat = 0; \ int i; \ \ for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ - switch (sizeof(r->element[0])) { \ - case 1: \ - VARITHSAT_CASE(optype, op, cvt, element); \ - break; \ - case 2: \ - VARITHSAT_CASE(optype, op, cvt, element); \ - break; \ - case 4: \ - VARITHSAT_CASE(optype, op, cvt, element); \ - break; \ - } \ + VARITHSAT_CASE(optype, op, cvt, element); \ } \ if (sat) { \ - set_vscr_sat(env); \ + vscr_sat->u32[0] = 1; \ } \ } #define VARITHSAT_SIGNED(suffix, element, optype, cvt) \ diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index 5e13edbf53..62c5578070 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -552,22 +552,55 @@ GEN_VXFORM(vslo, 6, 16); GEN_VXFORM(vsro, 6, 17); GEN_VXFORM(vaddcuw, 0, 6); GEN_VXFORM(vsubcuw, 0, 22); -GEN_VXFORM_ENV(vaddubs, 0, 8); + +#define GEN_VXFORM_SAT(NAME, VECE, NORM, SAT, OPC2, OPC3) \ +static void glue(glue(gen_, NAME), _vec)(unsigned vece, TCGv_vec t, \ + TCGv_vec sat, TCGv_vec a, \ + TCGv_vec b) \ +{ \ + TCGv_vec x = tcg_temp_new_vec_matching(t); \ + glue(glue(tcg_gen_, NORM), _vec)(VECE, x, a, b); \ + glue(glue(tcg_gen_, SAT), _vec)(VECE, t, a, b); \ + tcg_gen_cmp_vec(TCG_COND_NE, VECE, x, x, t); \ + tcg_gen_or_vec(VECE, sat, sat, x); \ + tcg_temp_free_vec(x); \ +} \ +static void glue(gen_, NAME)(DisasContext *ctx) \ +{ \ + static const GVecGen4 g = { \ + .fniv = glue(glue(gen_, NAME), _vec), \ + .fno = glue(gen_helper_, NAME), \ + .opc = glue(glue(INDEX_op_, SAT), _vec), \ + .write_aofs = true, \ + .vece = VECE, \ + }; \ + if (unlikely(!ctx->altivec_enabled)) { \ + gen_exception(ctx, POWERPC_EXCP_VPU); \ + return; \ + } \ + tcg_gen_gvec_4(avr64_offset(rD(ctx->opcode), true), \ + offsetof(CPUPPCState, vscr_sat), \ + avr64_offset(rA(ctx->opcode), true), \ + avr64_offset(rB(ctx->opcode), true), \ + 16, 16, &g); \ +} + +GEN_VXFORM_SAT(vaddubs, MO_8, add, usadd, 0, 8); GEN_VXFORM_DUAL_EXT(vaddubs, PPC_ALTIVEC, PPC_NONE, 0, \ vmul10uq, PPC_NONE, PPC2_ISA300, 0x0000F800) -GEN_VXFORM_ENV(vadduhs, 0, 9); +GEN_VXFORM_SAT(vadduhs, MO_16, add, usadd, 0, 9); GEN_VXFORM_DUAL(vadduhs, PPC_ALTIVEC, PPC_NONE, \ vmul10euq, PPC_NONE, PPC2_ISA300) -GEN_VXFORM_ENV(vadduws, 0, 10); -GEN_VXFORM_ENV(vaddsbs, 0, 12); -GEN_VXFORM_ENV(vaddshs, 0, 13); -GEN_VXFORM_ENV(vaddsws, 0, 14); -GEN_VXFORM_ENV(vsububs, 0, 24); -GEN_VXFORM_ENV(vsubuhs, 0, 25); -GEN_VXFORM_ENV(vsubuws, 0, 26); -GEN_VXFORM_ENV(vsubsbs, 0, 28); -GEN_VXFORM_ENV(vsubshs, 0, 29); -GEN_VXFORM_ENV(vsubsws, 0, 30); +GEN_VXFORM_SAT(vadduws, MO_32, add, usadd, 0, 10); +GEN_VXFORM_SAT(vaddsbs, MO_8, add, ssadd, 0, 12); +GEN_VXFORM_SAT(vaddshs, MO_16, add, ssadd, 0, 13); +GEN_VXFORM_SAT(vaddsws, MO_32, add, ssadd, 0, 14); +GEN_VXFORM_SAT(vsububs, MO_8, sub, ussub, 0, 24); +GEN_VXFORM_SAT(vsubuhs, MO_16, sub, ussub, 0, 25); +GEN_VXFORM_SAT(vsubuws, MO_32, sub, ussub, 0, 26); +GEN_VXFORM_SAT(vsubsbs, MO_8, sub, sssub, 0, 28); +GEN_VXFORM_SAT(vsubshs, MO_16, sub, sssub, 0, 29); +GEN_VXFORM_SAT(vsubsws, MO_32, sub, sssub, 0, 30); GEN_VXFORM(vadduqm, 0, 4); GEN_VXFORM(vaddcuq, 0, 5); GEN_VXFORM3(vaddeuqm, 30, 0); From patchwork Fri Feb 15 10:00:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Cave-Ayland X-Patchwork-Id: 158492 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp523904jaa; Fri, 15 Feb 2019 02:12:57 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia56JsVz0x5ZcNOCmq5bxoTyhuRnI8qVnkxkFOiEej8reJ0SWFpmZ/Icb5+uyZJiFzdDJnF X-Received: by 2002:a81:9b10:: with SMTP id s16mr7225088ywg.335.1550225576987; Fri, 15 Feb 2019 02:12:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550225576; cv=none; d=google.com; s=arc-20160816; b=Vi8LPeCMMs820zRcWCGmpNc5r2CvoOglJAwHEgV1mNJPtWEnnfqOh7zlCgvGF4WS9W /ltMyMNwp1de8MAHgPqH72Sf4EWBKeuQYzI9OguEiz7cJ14jzuWLT+yM3PN6cMdDrZEd 8WaLYeLgyj+sP8UplFim1VgAuL+YzJGJZ4LnfkE/3hNPjmP53nZIMuuiEP4B8qPG/RuO VeHy2VQ5OlKv8sjNGLQC3ViX+a7EXW3axq7WbM1IRoFE226w8Bk4TcCZ6H/JXMvmvnxq Se73X4Pm5NF2QS5YK/ypl35mo0uuDqY5igjq9atQUIjf6w6B+Dphvq/VXdsT4t/kh3gH TLZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from; bh=UzLBZGDz0UI7MhZMJzfbr8FaFtmkZMur+q37S/YvFOw=; b=LRKVkuhc1lMQY1QO4Y89v4Rb3PhLUmI3ckpZ/0ct8UK81TOPi+WMN6tUGazyExltTQ 1q49Il+eqA3u0mZSqejRha9jb0DpTQx7Yw1r62fNJcCUbMq4InU6AI/kj4Wd1xjhhARO +k0YcEG6wvIHIEQnNqbFIoZapNw4xA0M/p2AHl7VqRro+38ttZOmM801NVvluV2yMpOl hVjTu2+XW352dvo/scSSxxZZWnep15bEJxXiaa4pTuNxoAr0WcfbWgSHi1oTDnbG4SJ5 +RMwi53U0Bq+JlALa6vfd3xj+8nIXCH9hjQZH9dwNHlIxwD1qJKhewsjJOYmUM58pCWH 0oNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s133si2972952ywc.115.2019.02.15.02.12.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Feb 2019 02:12:56 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([127.0.0.1]:35910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaUK-0006JH-GF for patch@linaro.org; Fri, 15 Feb 2019 05:12:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1guaPW-0002ms-Jx for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:08:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1guaPV-0002FC-Fj for qemu-devel@nongnu.org; Fri, 15 Feb 2019 05:07:58 -0500 Received: from chuckie.co.uk ([82.165.15.123]:38822 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1guaPP-0001zj-5F; Fri, 15 Feb 2019 05:07:52 -0500 Received: from host86-133-194-245.range86-133.btcentralplus.com ([86.133.194.245] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1guaJl-00027S-Kl; Fri, 15 Feb 2019 10:02:03 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, richard.henderson@linaro.org Date: Fri, 15 Feb 2019 10:00:58 +0000 Message-Id: <20190215100058.20015-18-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> References: <20190215100058.20015-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.133.194.245 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 17/17] target/ppc: convert vmin* and vmax* to vector operations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Acked-by: David Gibson --- target/ppc/helper.h | 16 ---------------- target/ppc/int_helper.c | 27 --------------------------- target/ppc/translate/vmx-impl.inc.c | 32 ++++++++++++++++---------------- 3 files changed, 16 insertions(+), 59 deletions(-) -- 2.11.0 diff --git a/target/ppc/helper.h b/target/ppc/helper.h index 3daf6bf863..18910d18a4 100644 --- a/target/ppc/helper.h +++ b/target/ppc/helper.h @@ -117,22 +117,6 @@ DEF_HELPER_3(vabsduw, void, avr, avr, avr) DEF_HELPER_3(vavgsb, void, avr, avr, avr) DEF_HELPER_3(vavgsh, void, avr, avr, avr) DEF_HELPER_3(vavgsw, void, avr, avr, avr) -DEF_HELPER_3(vminsb, void, avr, avr, avr) -DEF_HELPER_3(vminsh, void, avr, avr, avr) -DEF_HELPER_3(vminsw, void, avr, avr, avr) -DEF_HELPER_3(vminsd, void, avr, avr, avr) -DEF_HELPER_3(vmaxsb, void, avr, avr, avr) -DEF_HELPER_3(vmaxsh, void, avr, avr, avr) -DEF_HELPER_3(vmaxsw, void, avr, avr, avr) -DEF_HELPER_3(vmaxsd, void, avr, avr, avr) -DEF_HELPER_3(vminub, void, avr, avr, avr) -DEF_HELPER_3(vminuh, void, avr, avr, avr) -DEF_HELPER_3(vminuw, void, avr, avr, avr) -DEF_HELPER_3(vminud, void, avr, avr, avr) -DEF_HELPER_3(vmaxub, void, avr, avr, avr) -DEF_HELPER_3(vmaxuh, void, avr, avr, avr) -DEF_HELPER_3(vmaxuw, void, avr, avr, avr) -DEF_HELPER_3(vmaxud, void, avr, avr, avr) DEF_HELPER_4(vcmpequb, void, env, avr, avr, avr) DEF_HELPER_4(vcmpequh, void, env, avr, avr, avr) DEF_HELPER_4(vcmpequw, void, env, avr, avr, avr) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 4aeb375edd..162add561e 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -921,33 +921,6 @@ void helper_vmhraddshs(CPUPPCState *env, ppc_avr_t *r, ppc_avr_t *a, } } -#define VMINMAX_DO(name, compare, element) \ - void helper_v##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ - { \ - int i; \ - \ - for (i = 0; i < ARRAY_SIZE(r->element); i++) { \ - if (a->element[i] compare b->element[i]) { \ - r->element[i] = b->element[i]; \ - } else { \ - r->element[i] = a->element[i]; \ - } \ - } \ - } -#define VMINMAX(suffix, element) \ - VMINMAX_DO(min##suffix, >, element) \ - VMINMAX_DO(max##suffix, <, element) -VMINMAX(sb, s8) -VMINMAX(sh, s16) -VMINMAX(sw, s32) -VMINMAX(sd, s64) -VMINMAX(ub, u8) -VMINMAX(uh, u16) -VMINMAX(uw, u32) -VMINMAX(ud, u64) -#undef VMINMAX_DO -#undef VMINMAX - void helper_vmladduhm(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) { int i; diff --git a/target/ppc/translate/vmx-impl.inc.c b/target/ppc/translate/vmx-impl.inc.c index 62c5578070..f1b15ae2cb 100644 --- a/target/ppc/translate/vmx-impl.inc.c +++ b/target/ppc/translate/vmx-impl.inc.c @@ -416,22 +416,22 @@ GEN_VXFORM_V(vsububm, MO_8, tcg_gen_gvec_sub, 0, 16); GEN_VXFORM_V(vsubuhm, MO_16, tcg_gen_gvec_sub, 0, 17); GEN_VXFORM_V(vsubuwm, MO_32, tcg_gen_gvec_sub, 0, 18); GEN_VXFORM_V(vsubudm, MO_64, tcg_gen_gvec_sub, 0, 19); -GEN_VXFORM(vmaxub, 1, 0); -GEN_VXFORM(vmaxuh, 1, 1); -GEN_VXFORM(vmaxuw, 1, 2); -GEN_VXFORM(vmaxud, 1, 3); -GEN_VXFORM(vmaxsb, 1, 4); -GEN_VXFORM(vmaxsh, 1, 5); -GEN_VXFORM(vmaxsw, 1, 6); -GEN_VXFORM(vmaxsd, 1, 7); -GEN_VXFORM(vminub, 1, 8); -GEN_VXFORM(vminuh, 1, 9); -GEN_VXFORM(vminuw, 1, 10); -GEN_VXFORM(vminud, 1, 11); -GEN_VXFORM(vminsb, 1, 12); -GEN_VXFORM(vminsh, 1, 13); -GEN_VXFORM(vminsw, 1, 14); -GEN_VXFORM(vminsd, 1, 15); +GEN_VXFORM_V(vmaxub, MO_8, tcg_gen_gvec_umax, 1, 0); +GEN_VXFORM_V(vmaxuh, MO_16, tcg_gen_gvec_umax, 1, 1); +GEN_VXFORM_V(vmaxuw, MO_32, tcg_gen_gvec_umax, 1, 2); +GEN_VXFORM_V(vmaxud, MO_64, tcg_gen_gvec_umax, 1, 3); +GEN_VXFORM_V(vmaxsb, MO_8, tcg_gen_gvec_smax, 1, 4); +GEN_VXFORM_V(vmaxsh, MO_16, tcg_gen_gvec_smax, 1, 5); +GEN_VXFORM_V(vmaxsw, MO_32, tcg_gen_gvec_smax, 1, 6); +GEN_VXFORM_V(vmaxsd, MO_64, tcg_gen_gvec_smax, 1, 7); +GEN_VXFORM_V(vminub, MO_8, tcg_gen_gvec_umin, 1, 8); +GEN_VXFORM_V(vminuh, MO_16, tcg_gen_gvec_umin, 1, 9); +GEN_VXFORM_V(vminuw, MO_32, tcg_gen_gvec_umin, 1, 10); +GEN_VXFORM_V(vminud, MO_64, tcg_gen_gvec_umin, 1, 11); +GEN_VXFORM_V(vminsb, MO_8, tcg_gen_gvec_smin, 1, 12); +GEN_VXFORM_V(vminsh, MO_16, tcg_gen_gvec_smin, 1, 13); +GEN_VXFORM_V(vminsw, MO_32, tcg_gen_gvec_smin, 1, 14); +GEN_VXFORM_V(vminsd, MO_64, tcg_gen_gvec_smin, 1, 15); GEN_VXFORM(vavgub, 1, 16); GEN_VXFORM(vabsdub, 1, 16); GEN_VXFORM_DUAL(vavgub, PPC_ALTIVEC, PPC_NONE, \