From patchwork Mon Feb 18 14:30:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158623 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2600813jaa; Mon, 18 Feb 2019 07:10:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IZTgamWaV5hCmjMEV6bj5a5hbXB8RlMP3gsaOhjnsJ1/RBxgI6UVgsAzI4br+opR2Y5iKwb X-Received: by 2002:a25:cf44:: with SMTP id f65mr9483856ybg.62.1550502625679; Mon, 18 Feb 2019 07:10:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550502625; cv=none; d=google.com; s=arc-20160816; b=I9A8OEqSPtc4zI9XJ3LtQYgXESBDv5PEpBY4YtJaWz1O8Hnk7aCRgeB72eMAGfaVkV cLzsWXxxE38N+f5VLvh5FKGAszjOp8CiMd5X6DB/HhOHAOKPzx8VXxJKVTjV36D8fB2I uT6tkGDdIjRZ5k7JVimStb/SkgQ+SFwSf7598Q6bR9CWs49kLb8Kiy4vjF4/fQTYbOP6 0hBqgwK/tLdz1Uh/Y+vNHG1QKGPEi9kGlH5MDsJadoJA+z6poruuygw/G8bzkFzeNJnq mCLhgz2ZKSUpofh7Q/R+XjpTwiOX/OpNd87R6uZhodPX00iuIz4bafFyj+alP/ltZY4q bq2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=bJmbTY+9IxaEdYgny3zkGY0oxkzDNTyXlA4CUlH3uHk=; b=pYqOc0rXW/JDKTMAIOpqi/pEGBqttrvtcYYQJkXnmdEaZmAmmOg8BCnu9Oq9eb686a QxjMUwtno5QFYJei7/62vBqxb55FYTRbkrhlGhHOh9xrfAfeYRDWGH4zM0nBBJsfQJW/ eSHvBabqDWxKoTL8folaQcIRwFktBDDDFNUKXiEb49Sgmdkr6QgD3vdN8z8+r15k3GNl knpsVTnWLAqFNw1T3iXhNFX+SHEGevcbq/uzuZXR8Ej1fuNBsjXDNNa7Yt8UD2X59lwg AkDjgrDxukrhab1WREfedvI+PJuQYCd5gyhoElJJFJGlaERp2e616bcp67eJBiAHU77X 1Lvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=ngTy4ch4; 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 x126si7749758ywe.25.2019.02.18.07.10.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:10:25 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=ngTy4ch4; 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]:60170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkYr-00032R-2Z for patch@linaro.org; Mon, 18 Feb 2019 10:10:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39361) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjxu-0006aV-Ie for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjxs-0003Ak-Ty for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:14 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:48231) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjxr-00034w-W7; Mon, 18 Feb 2019 09:32:12 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s02gYlz9sQt; Tue, 19 Feb 2019 01:31:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500276; bh=PlAcG9ajRT3vv+qMwO0vfunQnxHHh/SDrHvLStAJvQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ngTy4ch4mxQSXwc8pMJzxjvhDIhNmnt/l/bSERtDWDXfKspZUdHLT6OZt/Dgs5CHB L5HmWxDUPOxusFe88qYqMaSbB/X8bVHhfbItXB0p8yaDEXoYFU8zCf9Y5CsesP9l/a hY1Z6fRFLfYYDwQPEChQVFUECXOrKaaYGK17AbXQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:35 +1100 Message-Id: <20190218143049.17142-30-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 29/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Message-Id: <20190215100058.20015-4-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- 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.20.1 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 Mon Feb 18 14:30:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158633 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2619320jaa; Mon, 18 Feb 2019 07:27:01 -0800 (PST) X-Google-Smtp-Source: AHgI3IaUfKb9r8z08YMau+IYg1HmNPhY2kRk9D91ENMoXvwXGkW8i0sGoTEJsjlrL92h13VHro1R X-Received: by 2002:a25:8b8f:: with SMTP id j15mr19466639ybl.373.1550503621891; Mon, 18 Feb 2019 07:27:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503621; cv=none; d=google.com; s=arc-20160816; b=OPgPgbDvqz7uWpZmxUe10WQfEeaQcCFeMOq3mQI2Yp/doVjpHKzej6MExiVzolykpL GMQDzbFYQm5mhTkZprQx316+oopX48dwFL/iUuJ/P+dGa8CVJNbL/3nMUCQBDpWBzQ9j 4wcdl39KTkBq2lKEw7dOHEVns0QV8w4+jCep+yTwQapfGJo0/3ypqj18+0VH2X+WndCl CqMHhLFbwXlqylrLgpEIp6KxxAa+MlSwEnHLp9L6d5BGH6zbGgap8cLYd+PgZHtLHQYp LS8U5N7t4IDBZoqQcaxvZF97AiOzTAif79qo81MQHI6f73w5amsIMnsUy71ebmU55tsP yG9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=TQwWBZls1kQ/NUKYMMRzEt/s2VK98xivggZDC3mS0RA=; b=kNHFpceztPPc8xosrhybhYmEkfqA0jaCRkmpsMPAyGPQQu20j1dDRdYVM+3j9sbgd7 u1KCFEsGb/if7SCr+kC3T/IKlmOB929OCd8cHPMkjMVleep4K+qTneSUVeiwxqztgmz2 DVFHRda2gYel+BuLXKaLGHaV14F0K1ns4wD9VPoFggATtqh8pL/g/r4gVPQ1JBRrwOEH WImKyYS35SCjFrHZwPxeh2PnyCAluOWqO9Ui9L7QSggFolwKGma51zd+Qw3EGPTqTEIU 9jU8d5lPDVBHAhReBmOJ2s8m+NQjf0/SWJuIyL/76QWQ32D20GnnTf1lMT7PI2SNMlqc xfKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=kx07n7Uw; 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 z8si2331107ywd.416.2019.02.18.07.27.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:27:01 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=kx07n7Uw; 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]:60528 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkov-0001E0-FA for patch@linaro.org; Mon, 18 Feb 2019 10:27:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyF-0006qx-RR for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjxw-0003GK-Mk for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:27 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:55463) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjxv-0003BR-MX; Mon, 18 Feb 2019 09:32:16 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s10R1Wz9sRR; Tue, 19 Feb 2019 01:31:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500277; bh=WubUiDDXXur8qFHgUdiC67JJm1jDf1+DCdSvFn1QqUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kx07n7UwHo5HO2TEh2bpG6O+BTWuc0Aqy/opcsO86e+pNas7tPrHOp5cRubtc4/3k BmhHoYHpwiCHs47OXeFTRTjDssnKJKg7neatYpMQL9J7WIgnxrZLwQ4HUOUty2lTTD 7uRdt95ShlUSzGNJnbrmd0qXP25roKty/pEpkhNQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:36 +1100 Message-Id: <20190218143049.17142-31-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 30/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-5-mark.cave-ayland@ilande.co.uk> Signed-off-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.20.1 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 Mon Feb 18 14:30:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158632 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2616860jaa; Mon, 18 Feb 2019 07:24:41 -0800 (PST) X-Google-Smtp-Source: AHgI3IbeJs7EJOYkHFp2IZyNKzceG3JDpExBxtLzKpRk9g+Eea/5ICyHNIwHbJxF0ekibcC9qsIh X-Received: by 2002:a25:9c42:: with SMTP id x2mr18756252ybo.199.1550503481816; Mon, 18 Feb 2019 07:24:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503481; cv=none; d=google.com; s=arc-20160816; b=Y2n/wHBR54L3f2ecJcHsjnjPnDu5PiLytUyo6Qn204WCn6Ed49jMP4UIc4ya1l1Niz zB5p5wbx444KXA54SD+pdTVGpdwOzE5UYs9b7BGXGLz6uf8vSx/e1zeCoWHVGMM8QQ09 FhxSC8S6GbSyRSAbGFYklnplfjFcccpnndrQT+8CIVb6CcIcojiIFzxbdIX9tVyj1GKV 8CY6eLO32m84LNQlxuOyQ+etJMfqtzDnsGYWj4kd0nVnFX6JxKjwT1z/R0zIcmMmruPD ARbzlyUIh35suUQCf+ag5l9DQfBfsSC3zb8eig3wbkWlpTgSzTEQWifWugre7yXluPKJ FV2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=hw4LjAaa3jVptJqmQVmPsbUlAFwTG3iPpyWz+lp7jL0=; b=OjTkz5a72QWkp88lcfVWaHZcck6SaShD3JrkCW+lq7gjzNpGqO9D0Y9jD4YKzjJGDK qU/C9GAkkDUZ3xymUF1GRzRBx2FxnoxtIEwPNODXYjR692FPwNs+JOlX9Hu8pQIrYfNp krDY0a5KcWbu0YYiiJ0FbxJNCOPQLYqw9qt7+9112j2HTZJVeWVlGN10EoQQLx9Pz6Eg Kn4/SHQ5kSoyBicLi02TxX7xVRY83bqJ6MAogxo2e6snwAaFoWTOHCmi4EGHPq6QE5cF wtMkSbwq6crExeEjDdPoCWIdsWjJujoR95Oi+KzDZpw1EojzufEpd1pvScDZEBNxQCTn f9ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=nbxduOEK; 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 w205si8019430ybw.161.2019.02.18.07.24.41 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:24: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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=nbxduOEK; 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]:60441 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkme-00077X-VE for patch@linaro.org; Mon, 18 Feb 2019 10:24:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjxw-0006ch-Hk for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjxt-0003Bg-Gu for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:16 -0500 Received: from ozlabs.org ([203.11.71.1]:35709) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjxs-00038z-8g; Mon, 18 Feb 2019 09:32:13 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s05q6Xz9sRQ; Tue, 19 Feb 2019 01:31:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500276; bh=IpQLKVTonX96XBiQgzaJBL6YAZ1p1M2fpTVxrTKQlUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nbxduOEKTjFzwytgxC3JkaeID+NSE+BXgmiKeaVNlnPJrZwwSZa6vUvKNP9tCaz1B 21b57ej1BX+WR6txs3BNKL9m6yuYn/evrgsIeERfiJZq9ORIls0W+bdT4fM282U2aF x1ZbPkNWLgIHuVimy66OgcAfY9fIEe4cJqb/g9sQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:37 +1100 Message-Id: <20190218143049.17142-32-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 31/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-6-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 43 ++++++++++++----------------- 1 file changed, 17 insertions(+), 26 deletions(-) -- 2.20.1 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 Mon Feb 18 14:30:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158625 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2605573jaa; Mon, 18 Feb 2019 07:14:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IY3xxRhayJrLkj1Qr5TqBFH2hq3GoJ7LI4Zm6g53UEh3cQXCBvNr7k8BPlxeetjyilH1OcP X-Received: by 2002:a25:28c:: with SMTP id 134mr18852950ybc.405.1550502865847; Mon, 18 Feb 2019 07:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550502865; cv=none; d=google.com; s=arc-20160816; b=dvQPurvjrXzqYAYr/6bX9MDLXvImAU4wJjLnA1zhroE8wEKclRMfx4mu7lLCLr+baZ iT0uetv8meUeuiq6Huv2WEDcF9W6dOk7/f/M/L/1/oFTjI1UAugjxDZnYlS/JdKICRAr z+nk/CBzgJwkW5MafuROLggBWZYF8P92b0dIGax/kJuFbPaODjkcNQOdM/82F9vQ5jMa Vqo4fFYgVeZWqwHb2VTtIHM8FOxd0DKfuEjMS54NMzDa45U17xKZXmX+UYMTwTptJLau aAi2pyebtid/xGqlHIjPQ0mrzr5gH73GMJ3LaIT/5IqB82Cg1TT5mIFlfPK31wwv9UdV yF2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=e+5bTT7cAo+OnNE7qOIYzk/hM6Sfwy8R/EC8msNhfxI=; b=c4Gb8TwgaO2DYr3BCpAh/ulVNhWWoAMkZVX90nkQo2gEBBU78vxqkhD8x8NCL99Ty4 28Cp2BMrcMqGNDso68HdiE5x72UBe7c4lYjUXpZ+xX40fskyctGfdmcYLBoaiFTGDxcA m6rBGopPCvkPkK9w+k7kn0MOQzeAkDMsrpqpO6c2bH0+42Kgyjly6SIf9w4J7sZxu23N 0zltQhF/tUIZi7tb9q1asg3YROXn7XXAcBOpZQJgtyyWTpxR02E5P2YVwTUK3e365Zig Qo3DmSbMQS88bZXBlztHq0qW2s5Q+EFUiu3S+xoUSvdM1wp10fD5lLPOrCHD/Htjm+Iw BiPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b="nM/aErQv"; 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 15si3517784ybf.275.2019.02.18.07.14.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:14:25 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b="nM/aErQv"; 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]:60262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkcj-0007gC-9x for patch@linaro.org; Mon, 18 Feb 2019 10:14:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyY-00078D-69 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyW-0003Ys-Hz for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:54 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:39379) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyW-0003C9-27; Mon, 18 Feb 2019 09:32:52 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s157Z1z9sRW; Tue, 19 Feb 2019 01:31:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500277; bh=l/uZnwapLXCAmSRW+SLynhpQG35UrcsG7sMrQKApUc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nM/aErQvBDHwAsTyQVEZ/ki8hIN4/dayJb0M15H+ZFfyWMMr6Ozg97v72YdHzjQeo Msefz9Q56mypIDsCvLP2BmkFI1txLHEWEO0AbBA3WQDMJXRTIB+TqpuO7hyQoPf8Qz rj1ZBmEv0ECEeexIJCwNH91dqTFG30l4LZxkYddc= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:38 +1100 Message-Id: <20190218143049.17142-33-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 32/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-7-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.20.1 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 Mon Feb 18 14:30:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158624 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2602931jaa; Mon, 18 Feb 2019 07:12:11 -0800 (PST) X-Google-Smtp-Source: AHgI3IYF06vVYujxOZXSSPiIFYAME8FXShnAC+PczNhPwqjV0+7OhK5/MxrLhaMN4GNjDtZW7AXt X-Received: by 2002:a25:a286:: with SMTP id c6mr19010376ybi.295.1550502731551; Mon, 18 Feb 2019 07:12:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550502731; cv=none; d=google.com; s=arc-20160816; b=ZVS8/YWlQqb/nYpc8z9Zdq1FJUP4K7ZBJn55bJpQSxu6GaDJdpWRQjB3XEaFjv7PoS TesDeJNAk5fahjLx8ifBhj0ET7JIvujTumFEfFKnwWbPvyPBU8nVT5293ZgYwiJUgI6T 1zC+yIhD6lOOFj+xd4TP/fQpDXUvdHVMWxnd/Vt0C3JU3ThF7yrXb0PQ8xYnN8HmyOV8 iONwbo8DmiIABemuCaqFn12qyvsD4ZqrtOJJzmR22Ytcsn4t5wUvrogBRYl24D4jsE/e wJvsB9FsIraYmSSGZy/ooPpuSVnvhtZlL2G2UPS8qNaI6AXB+OMsMZC4fWBwI2NSqwW4 cVbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=7KFMvbBEBeCoo8nZw0Hg1Ct31GQZ3B+DFIPYiUL/gek=; b=U743jCJ6ZNIGIxpp2usBKLNjr8IkBbDhA5FOlLeAXoLF9p5AmTbYR5w3hSmMqHOq5h 7I9EmE8jXtyA547XP+wFbSzEJzmKHAIy/kzgyl9biGEU4vey4rwVH81F62ER8vUMD1m8 g/2ApCTRitP3s8dpWpcVGOwYOrm/M6t9biFbjBp+fMUZZVjoROJvgLHs67po63aV5Dg1 Sb5G/R0VXyLSkFTNUZGdMYARmoebm6CLTZoBhH4Pfs5H7L3VPz0eEOAwl8K5yivLhfbN mltsaqLzmpiDVze/JQhgTjTAlYcu4SM0Gpy3fn2UzoYkZjHnqOqnpjcpr7yDDc1myFLA NRUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=bCoqZ9uF; 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 k188si2892137ywe.126.2019.02.18.07.12.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:12:11 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=bCoqZ9uF; 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]:60228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkaZ-0005ZG-1e for patch@linaro.org; Mon, 18 Feb 2019 10:12:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyD-0006oM-E6 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjxv-0003Ff-RV for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:23 -0500 Received: from ozlabs.org ([203.11.71.1]:52887) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjxv-0003BL-CU; Mon, 18 Feb 2019 09:32:15 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s12hWRz9sPc; Tue, 19 Feb 2019 01:31:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500277; bh=9CbsTN7zMnIBmdU3wrzDYYYfH6VFlUgeu8hBq9gZFik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bCoqZ9uFDfknpDANdlxaSzs3o5/+X9SGgrpWH/P0z3i9EseX4Z8o2HuzemXB1XpbY q+LsivLuLzHNYlj1FTMEFbWSF5BpidWvZrLo5wTRlve3uBhin+tObaQLOGBEApYMg1 LkZ7ijBUvsZlaTzBlzySQZNoepcwh6VQOwHvWsAQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:39 +1100 Message-Id: <20190218143049.17142-34-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 33/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-8-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 36 +++++++++-------------------- 1 file changed, 11 insertions(+), 25 deletions(-) -- 2.20.1 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 Mon Feb 18 14:30:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158631 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2614880jaa; Mon, 18 Feb 2019 07:22:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IY58H4VqTda5Lq39Y/umrPfzUfNzjJKKWF+quHGuEL+AObg8tUhqayVZ3yJtk7x0gxas6UF X-Received: by 2002:a81:57d2:: with SMTP id l201mr19756129ywb.145.1550503368451; Mon, 18 Feb 2019 07:22:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503368; cv=none; d=google.com; s=arc-20160816; b=hyWVq1K5j/7NlA4COmjXtuYL3T9gjSIfmK1Kyhi4YQHn3PaZv9XOcW6MPG+/dWHaW7 qciQtX/fqEZjIS8iM4GJ4vohYAsbWGw9DTSV50d1xLJifut/H06QAtL5jQwRQqmIUVHp awpOMGhWF1nUDOyw32qvqeFWrNTuRDVlaXS7Xo1AAiCsNGFo5sHoVoFUe42iiWv1bMsR ExwJbDzH/9E81tcvtKcvjJIc9JIRHgZEpy2jPza/8FNYrJUn21dymGT1yJi0UWW+HGH5 LTRzn1KpU3HzUyutHnmRS6eWdDbSmm+8THLRpSBBq4MchM2nGJyDlQWFyAIuIM3d08DV aAKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=BaOaHQU9eqU4gEwLJuUHbwmlWfo2sH9fxtmxtwan8v4=; b=HOrvOIVtPbwhsANRrHkR4G784J0YJWbMLjuWky9uqWT4BeC3gliD0+ecmF/6lkvE7K GnPydshVIlVPZy1FDsVm/Urv0PP0L/c7gcNsHs3nC5t5EUJvGCsV/hB8UDpylUgUWQwQ 9pG+HSFDDG9edN9qcVy9V7jASPskx4MyGqbChhd205FJJqjA+piDrTOVC33wMfBph1NY N3n25Nwg4byElcirgRSB+yY2SrSk/clSEiY37FQg4eZ0tNAI7AreAG3YRNrfW5T9cKsK DJ/Clbb4+LpQHObFgnc3vEYzmresFtRM4nDwjFaMSKXihT3lI3nZGJJaRxDo8m3h1Sdn 9X1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=gqhpZcIK; 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 r184si251474ywf.95.2019.02.18.07.22.48 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:22:48 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=gqhpZcIK; 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]:60419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkkp-0006Ek-Sk for patch@linaro.org; Mon, 18 Feb 2019 10:22:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjye-0007Fe-P4 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:33:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyd-0003es-UY for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:33:00 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:34983) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyd-0003DA-H4; Mon, 18 Feb 2019 09:32:59 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s23BN7z9sRY; Tue, 19 Feb 2019 01:31:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500278; bh=euRyDtQkQGHZFeeOzuy1J579rlrETAxJoHQij8WW8uU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gqhpZcIKqTslv4a2MCzXBt6LzDDzfngKD/dK2JFxOqeo8CVAeY/luMtPgRpXakCo0 ovNXOT+G0oi1Y7mSCOZjMmQhzgCp6YoU6hwmdjTExbPQtCNjfjw7T2pU9n+I6ki2cg bwTwe4qu3FK3LWZlaQi7I86utfooZaBQAY8YJWmQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:40 +1100 Message-Id: <20190218143049.17142-35-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 34/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-9-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/translate/vsx-impl.inc.c | 55 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 28 deletions(-) -- 2.20.1 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 Mon Feb 18 14:30:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158627 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2610586jaa; Mon, 18 Feb 2019 07:18:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IajYnvDtMaIVXujzywT4wrdW1M12CD7wFquu9s1WbPx6aASSxwwR3ost5DHBOKNa2mGCA0f X-Received: by 2002:a81:a707:: with SMTP id e7mr9402720ywh.396.1550503135234; Mon, 18 Feb 2019 07:18:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503135; cv=none; d=google.com; s=arc-20160816; b=eRWp9uHM1YStAlYxJWDypIVHzkkD8dnuXOQM+zvujq2H8e/ttEVEm83kQVoKwLBUqb D6A2cacbabtepRppZ9AC1alpiOWezbN42mkp56rMOYuwMI45nq1N+bWTSPnqukRMZtoQ H2obR8zh1E/SfO7pekdG/SMOvjBSffjmdeIdz1lhC928lY8NeNmunCrA0lIs+rLd3U9H KzhcdcezhEn+JPuPy/0Qn5Cujhl0o41wTpSW0WPEbWCULM673nEuDW75z/E70KS/wv5e +mWTjFjFwjf7BpSlTTiP+ucYCs0OOv+ZplUiJsz9rWmt1BtcJqWjUuWThwypgJvPjXFJ kAfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=Mp5QhxupPIwHTCs4gw0MdsAZqc7LZnNxHtb26QXmMYs=; b=U1hAr2i32X3h8qfTRdbMXK6LIf76x2PD/15UFC75qVKSyWZiJ4NxV7pxe2DeXIgRTV KT7QzM+gXeLZL0Y4f23NRjPFTp5gnv/dvjN95CVaXM7kIou49DepB0FauKio+SvUzDQ1 YqUf576yw5u8FUS4CDJr8RenAkRx65kZyytcSluUzSUgnU0M6+Bsui8XqKYd/22/C+f2 fsbMfa0Rr9j7jDN28qrvX4Jc4b40GEjhf9/ry7t6sKqxYSj8G6jfiM2wQfbuobkx9woq 6NUCB0K6g5MMe5hOT3PgijwnunAk3jllahIvTILykzUMHdD2gikXKLrJKryidQ8TkrC9 VL9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=nj8euyjr; 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 e184si3015497ywh.215.2019.02.18.07.18.54 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:18: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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=nj8euyjr; 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]:60337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkh4-0002YC-BI for patch@linaro.org; Mon, 18 Feb 2019 10:18:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39903) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyY-000786-2a for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyW-0003YE-4P for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:54 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:40343) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyV-0003Cu-LU; Mon, 18 Feb 2019 09:32:52 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s223S0z9sRc; Tue, 19 Feb 2019 01:31:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500278; bh=wWeJX6kiKqIb3Z0jPOtU5580gOTCe1HMpkmz26Aj5tU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nj8euyjraW6lgefnu6VsFGizwjDUDw98ee9FQCiMHfAqZZ89wuILTL6G+tGeJdsY2 pP/OyO1zFDp/lswAAvu0japBjqFPb5mBFKS+INqwrlXFr9WDycnPWD0NdbE/1k/Qh9 M7YNAfF1/tqgQq/9ZByz9LZYzxV0W3KPd5e2MzHk= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:41 +1100 Message-Id: <20190218143049.17142-36-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 35/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-10-mark.cave-ayland@ilande.co.uk> Signed-off-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.20.1 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 Mon Feb 18 14:30:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158622 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2599421jaa; Mon, 18 Feb 2019 07:09:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IZYsO5lpTdoP0c5bAI1waoj6hUzmFyk70+0rprn4ZyQK5kG0yPVa46P9w1PVAzVAvZOv/G6 X-Received: by 2002:a0d:ecd2:: with SMTP id v201mr18400287ywe.96.1550502560320; Mon, 18 Feb 2019 07:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550502560; cv=none; d=google.com; s=arc-20160816; b=zeqa7DQrZFk4em0aKCQ5K9zFTYrQBVYAW1kJi9Ij3f9X8TpyuScg/9NhWv8S9TI9Nr zaAOBZ+rpp1DuOCwH3OC+vs4GvhyJXhrKK9BlHx/WKV7m+rbp1OhRrDVNCecfXDKR2nW o+Rr0qq62RD6tDyJGSGlYHebzxHOgoSJ6J5/b+RFN+C4A5LoDYTLrbl7t6aCqj8Y+lYp 7CUu74kjNay9xqVX6v54Auq1/H+RBVJlRw8W12Mup68USfR+dW5hKd3e80mEO7QvETah n1fbaQ2j5c3u71HYswaEgENU0PpQ8PAJ2mg6AzPXd5m7XkER9jpZUDrJ5j20f4p2T40Z TbqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=T4AoU+gl1gWP2or4i7Y3fkBt5u1dKmSRm/3mYDQbR9w=; b=uUes9OzTtAK6MFtbIPXei3Cu4FFWSl6Ubq96AL7+R6yAlP7FZD+tf9WGGTAl++iNv1 tq2fRxXhn1H/r/nuyVyjaWtFElSnBXD0FcMtntwhsIdaIW7nub+ZW8LRoZrFA/P+R81/ dEv8NE6MK4f2pn6rdiESJLF2pJAlx6W+dCX6EOXaEsIiRdvPwIeJdyC1pHHnTW1Y0SsM G38EehW0dZDcM8z1QkiuspTM1ELt+gRDsyf5PxMAkNv/E9nK40DMU4WRnHMJ3z6BPgmY 7z6LXjxLB+7wxIeM0/VMjT/UTqzB6kdvS1O5SGkVc25Xy2G4sM63x4cWXLXlWEFDWWDs wkOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=pAVCn2+A; 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 q126si8120487ybc.29.2019.02.18.07.09.20 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:09: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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=pAVCn2+A; 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]:60166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkXn-0002zn-Ps for patch@linaro.org; Mon, 18 Feb 2019 10:09:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyD-0006oP-Eh for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjxw-0003GP-NH for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:23 -0500 Received: from ozlabs.org ([203.11.71.1]:52421) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjxw-0003CZ-0d; Mon, 18 Feb 2019 09:32:16 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s205yCz9sPd; Tue, 19 Feb 2019 01:31:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500278; bh=iEJRs2mtmGZ+SyiAKeopd4SgnrMyKKrs4KjGZTpPGbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pAVCn2+AMWeRrEAyfo5E50IxkC8CHVFS7gyCUthvF5HNA6kS/Uopsp21xyHfjaJqz apcGmk+CSbSfB9e38TJtnyZepVQyXQWrO58CnM7QDnBmxpsIB86PuDjfA/KJn1yYrj fFFriH3yIzMfPpZstW1g3sFYf3u60CUY35ahh978= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:42 +1100 Message-Id: <20190218143049.17142-37-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 36/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-11-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/translate_init.inc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.20.1 diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c index c9985c0d22..ee574b342e 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 @@ -9603,7 +9602,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 Mon Feb 18 14:30:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158629 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2611500jaa; Mon, 18 Feb 2019 07:19:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IZMHy6iViJBgB5CgBNaSioswvUvJJkM5maZjBdZuZZcg8lbBGaWIwlIahpU1X349/nBMs5U X-Received: by 2002:a81:6f8a:: with SMTP id k132mr12078901ywc.469.1550503184944; Mon, 18 Feb 2019 07:19:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503184; cv=none; d=google.com; s=arc-20160816; b=ZygVRMxLC7Q0u3v+M16x/f1HP3kY3GWf13t6p6lmjR3EEqpdYslVSJdcmGRIcj40Wc /CPEDNcjTIbelzYmceLXuH4ErhLYnIgjBJLZ7k8KPK8G7PtBV6aZ5qBS/USixkfAcSif ynKK7PgIW3EWS4kMBlGE89HjQ6466HmWHoD/TE4OzLlXn81qVuuSFAPxD4kq0v5RHjqq 1anx4IqnzsNQTcIcUpatRybhYLRrS+sjESItM9ejLG8d8Uo0fpvvsZ9dSJNW/s3ykFFq G36dm/PXPKDMaKy/fBqVxixpMnWOfsjKjvUX0Xp7pSA87dJeToVfN3uH1RPKXqjDXmJ+ 92zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=9wgt+bhTBfOHTwNQpqkoJcqF5VwIWCHcyGbciCAqZT8=; b=Yn1zElaF+KUvsE6Oqr44oXT0io6oZqgIynoyckdb7RVhmqMAZ88NSfeDcRIVrUh0OG 8vFknXlNOEVzBe1abVhYQvbf2s7MHrSYb3+Vb0otLZc38ISTns8GBif1jtmyxu0BsXWc 44lejg5fZexRzD8AAz9mysCBl+V2VAbx5px++SrkN5nPbKcRVUnyo8O1s2YMkv6oHUNZ h4YSStg6+2yRQjeMaowjF5W578E8J4QTA+PgdrOeJzG9sgBmaq2VLOMORJlFIhhCvpa7 EtctKg7QepC/g+oaG39w+WmryxPCK+H57bw9gxR4Ns5E05jpvy3WVMa23Yz+e0iV/yjG Bweg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=iZrd64iB; 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 w201si982777ywa.240.2019.02.18.07.19.44 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:19:44 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=iZrd64iB; 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]:60343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkhs-0003BA-7p for patch@linaro.org; Mon, 18 Feb 2019 10:19:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39906) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyY-000789-5G for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyW-0003Z4-Jt for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:54 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:34139) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyV-0003Fw-Vm; Mon, 18 Feb 2019 09:32:52 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s33H50z9sRV; Tue, 19 Feb 2019 01:31:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500279; bh=QZDF9bsVYmotPRYvh0MZNvS8Ocj2KcsIs8eeCe9JUQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iZrd64iBaYlJ4IKTQlOCelqoXwnWg/kLPauMvB8QX7t1G/nFOnkZ5t7Gt6BMGYqIs 5wnDba9OMRyuDCX3jeeq7rv49fQ68mW0B1mxESTlcKDQLWDOYmK+8vJINnsxkjs7Da ZAH0aswGPbr3RIMpxIRlGwRJHvDImHZis5jeATMI= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:43 +1100 Message-Id: <20190218143049.17142-38-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 37/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-12-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/cpu.h | 2 -- 1 file changed, 2 deletions(-) -- 2.20.1 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 78af7e4608..1c883fa836 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -689,8 +689,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 Mon Feb 18 14:30:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158635 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2622823jaa; Mon, 18 Feb 2019 07:30:07 -0800 (PST) X-Google-Smtp-Source: AHgI3IaLclDwDMqv0jzU7Q/+488Sh1ci+Ydgudb+dXY7wul7QmBEBWdVqJ3WAk8skXcaBGwGuYKX X-Received: by 2002:a25:c184:: with SMTP id r126mr19005854ybf.441.1550503807524; Mon, 18 Feb 2019 07:30:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503807; cv=none; d=google.com; s=arc-20160816; b=FvYnrfcPLEI0vY0LAiVc76IQTqBmv8nSyQTC+JrBe3ROgbAo5rt5mnbe5sUes7r13e rDbWZvR31ZuiXDZiaL/mdOBq5A1SD3gdQrepGi+a2/fU/Sh6/ADXI55y/D/uV2ikKtK1 +j41jY9HEtkKieRW4DmcMsnwRgDKrQpL2+p7pK+IKLxMbO/LTHhBP7lmqqqIqd1tiKV7 zGZUzTxLFVY1d9ka56CsReiB0oQfJK2FHiVCtD8UUttyBkxaJMkrd5swwOzsYIJ/jP5r gHCaY94NilBim9jWT2m3GLT3jmMm7TmTfmqX8aVcnSBxu/ophSgNINMHgH/7zvQzl2Ov s2PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=t3Uc86jYMjnfrES2+IcjzgEYlXynWgKO0l2TKZFDPG4=; b=cI5UzoDNX2i8hFPaN3m7jmvFjRpg3NGVBMFj2gnbAHP+GAriWpaM8r8xEL4OeVqoNZ RrritgU2FQsaRNreNpb0x68pUsHotmM9dMrjK/k7JzhzdFG6YT2epUVzb2nTe/Nsa8yf ilbsX/xOaL8QkiWkXroyFXcvZKI87VGx28TTW/eiW6LHd+2kjmJE0uBRv3iyi4pqInLU fdufs6ftOPryMBkbOItPDnTwtP7pKo29jpZya7uHUBac+t1aA9rwep/2u8OaQHxluG4t WXDTOlbey/Y0siv1eK2T311ZTBQN4mmA22D9ulBUAG+7lHRUxHljRbeMvSquR9A4T62q 3nGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=YmtBb6p+; 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 w4si8839443ywi.342.2019.02.18.07.30.07 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:30:07 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=YmtBb6p+; 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]:60586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkrv-0003JC-4F for patch@linaro.org; Mon, 18 Feb 2019 10:30:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyZ-0007AH-Sk for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyY-0003af-H3 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:55 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:46273) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyX-0003Gg-OZ; Mon, 18 Feb 2019 09:32:54 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s35DG9z9sRd; Tue, 19 Feb 2019 01:31:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500279; bh=qMVNghwDiAdQeTyLXZkLNEGqOtqDcvrhaUV15aEGm7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YmtBb6p+HKuFiuy0XG0YgyvlIeY0G3ZuBQVBY+KNdFS9ALz/d76jKHGJneHjSOPJY tH435dlSjMVKmxiYalnvC74A7D6drre3XyWe7kj+kBP4iVXbKQUYwSxfowse/ahQHJ ceOTuRaRNWzwxk/5dUsKFyHmsiuu2x5o6WlKKkKA= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:44 +1100 Message-Id: <20190218143049.17142-39-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 38/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-13-mark.cave-ayland@ilande.co.uk> Signed-off-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.20.1 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 ee574b342e..1657d88341 100644 --- a/target/ppc/translate_init.inc.c +++ b/target/ppc/translate_init.inc.c @@ -9573,7 +9573,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 Mon Feb 18 14:30:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158626 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2608191jaa; Mon, 18 Feb 2019 07:16:45 -0800 (PST) X-Google-Smtp-Source: AHgI3IaSEpipHFJRrflQ9nMGFRMas9QyZ5U/BEEi53bZ8/ooto0Hb6VCvhFMycbNj/NmlSarIIan X-Received: by 2002:a0d:e105:: with SMTP id k5mr18937208ywe.196.1550503005264; Mon, 18 Feb 2019 07:16:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503005; cv=none; d=google.com; s=arc-20160816; b=nZICko9fESIey3tXg0OanUXznjtJFZmbIsE7S7ODQ7fzu6T2X1TeJcJqgOqs+S1vOA stDLckXClscFeUpmNEi8e136q+dV7yhDk/v6J+nsXE4Yhf5VtR4k336H9sEnFaGjSqd1 h1Bn6pZPuQCQAH0LzzNqFD0Zunfq5M2kTWfqoV74Pm1iLR8A3L6eJAHaXQCKsT0Sprpj cn1YVKDfW9WYLcXStqvz7wMbzNnXjQ5xvGf5UIjXuhbLm7QGU8b3gKfbUAMgTzMjzPtF FW17zgq+ewkKPy5yV+j6UW1u3BSMXXIhtZYYPmn+sbDofO/+J/xa5RjTzd+4xsXfjVkZ vkVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=T5q6/axCPk/TX85ha2kr35ego4qxLfmWvAgNZOpwOTY=; b=G+2R0rLwnv627wn3mnKSupCw6cLrL9HZM8VdD0cx3zpdEa4xQp0zuDZJnuyq9mJLNn tDBbgOP9vp1iB4Urgfl2fs9JwfbxJ8GhGOwnz2vlrjs005K7YKmO4kAjGuyLVeKE6bMs pYeyJ9EmIF/ZgvfdC83UEMD/xlIfGmzbX6ykA+zhqpsY2QzA8XtsMyWfH+ptqbzF8idn hnzct2cZc/4xTyVxyXKk1JZL2a5j6QPtK7f8Kmgs0H/s6p9tt9+lOFrea7gvUkOFYlAU y475az+wASMOl+eO08HDgI9MGmGon7ZzMD+7or1AFjV6cwEvMP0rk+nfoJKPAfWvNZBr 0Ttw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=L1v4W3Bv; 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 l189si6996508ywg.418.2019.02.18.07.16.45 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:16:45 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=L1v4W3Bv; 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]:60315 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkey-0000g7-N6 for patch@linaro.org; Mon, 18 Feb 2019 10:16:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyF-0006qy-Ro for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjxx-0003Gx-Gg for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:27 -0500 Received: from ozlabs.org ([203.11.71.1]:52461) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjxw-0003Ds-QR; Mon, 18 Feb 2019 09:32:17 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s30k9Dz9sQm; Tue, 19 Feb 2019 01:31:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500279; bh=3dZ+99kwfp6L+lvyxQtGfMWD/0+jLACIq9+NuLPc/dM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L1v4W3Bv06d6KeBsQoW8dqjNqsW/h6O3mHCX1/koEnGKbKeaxlw36+eQ0NxQr3lkW FG2YZ2eHIrQa+4gqXuluJNDCh07Se6lhRb7CIAlYrFk6AFg9yjD4YtWYemyNVU0ETV 984otIMwCuJ7iUf5ZfievQfWDsNMYLcqX3Ag450Y= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:45 +1100 Message-Id: <20190218143049.17142-40-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 39/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-14-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/machine.c | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) -- 2.20.1 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 Mon Feb 18 14:30:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158634 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2622607jaa; Mon, 18 Feb 2019 07:29:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IbOGljn93hgUoE/37R/6Dj3+HF7UVlEzL0BHQO2rleXbqRZjwgOIdCl5fSM7HEFfTmJfnHR X-Received: by 2002:a25:c752:: with SMTP id w79mr8732430ybe.397.1550503796835; Mon, 18 Feb 2019 07:29:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503796; cv=none; d=google.com; s=arc-20160816; b=eGXz8jMIzSjQgNOVfiuLedln3ROHkGJMsONN/B1f4ZJ0E1CGN97wY8ipZoQaRSNGo4 VxaVXFKG0thSvGtjB24ooFGKxAIdkpmaD38nPRKmoJj2XRx3w4ptmcQZKAZYasI2WEmn +q3UZqDyArtKcdbmw+PEhjHoYfjpcSA+7W1vnRfo7KirbTZlaUA0tnnzgqbHIS/RWB5G 5Gb8U4TNV917a9nzzUysRcrqsPugYy5T7WC5EGO2iK0n/j//fNo3LGKCCEUU0TMN9a/9 mZPqRWNnL+qQD6qZrJ8+q2OR8tsjiEXgmJznf9DdNWP6e4gZ282DI/mgmzdQ3m2B7jBG 9+3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=CjP1zziGzTtlmDXg9+rPE+QvnHWR/AOw47sCWNQ/nqg=; b=fY+52DxG2qhHAL3CvXdz0rbcy5vWL3baiAUz/fIxHlpWFQf05eEjGtkxEfYfCk4qL7 WJ1bBL9ZI6SoaMQyxaPKSoSvhqtITl9j9cx2FzG69uSFfOQ+fNt+8ud63tIGMb0Qlquh OhN4UNxdWqtenWWuYR/focCz6LnCINNdTQTOBn9hAvXJ8fjwOzrC/eeTvEoLlg+fs/Et s1569qqRtkANuZNGedjStxJ0ukzxk4uN/IQb7rcpz5ATRerVV0I3PgPjVIJeQz9SDONL TYmwfho8X6KMeuaLdpfEPEfgoTCIcXhHPwWCSuOa0E3S5t9bci67iMgWCl9yvIOxLykV bsWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=m50U0aAD; 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 z187si5240169ywd.238.2019.02.18.07.29.56 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:29: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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=m50U0aAD; 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]:60580 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkrk-0002z2-EA for patch@linaro.org; Mon, 18 Feb 2019 10:29:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyY-00078O-AX for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyW-0003YN-80 for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:54 -0500 Received: from ozlabs.org ([203.11.71.1]:48193) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyV-0003DB-I0; Mon, 18 Feb 2019 09:32:52 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s24KNzz9sPl; Tue, 19 Feb 2019 01:31:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500278; bh=4N9M6Jo+jUM9P9qqQvopfFA5r2bjZ607uhJzd7kzerM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m50U0aADGWjLCcxHuqUtn97RPIHzffQyVRPMIn+UGjX11tFIyZoQnAI6yWS5yFppc wm2m5818gfPkvwzsOrX1LDtTetqqxkLMP9r3yKUdJIwKikWkhyNElQj7fwS5Wqa7fF wojMO8aa1glTF6+UXwj9l3DTxl3nrjBHukI/9RF8= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:46 +1100 Message-Id: <20190218143049.17142-41-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 40/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-15-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/int_helper.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) -- 2.20.1 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 Mon Feb 18 14:30:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158621 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2593775jaa; Mon, 18 Feb 2019 07:04:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IY9KraZlWMwCFUo2pfrRG6McLcD1wqK1Zs6O/D0FUkS2mtCeKfJjFgskJbWz0Q71cuwd1uJ X-Received: by 2002:a25:8188:: with SMTP id p8mr14174544ybk.309.1550502278396; Mon, 18 Feb 2019 07:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550502278; cv=none; d=google.com; s=arc-20160816; b=WerXrbKlYXtvafJ1vyXU3cjUDQkhYM+4Bztp7xdedUhnMtVGOWASrps4UiwaM8tTID 07mkxXtAtiVnGSKXfS1N/UDqr26/yQuep4OVsA8Elhd7vGjz7+pt5EOwIHwyiUJqlB1Y Qm2Db3IHHdRure396UVDDMlvhRv22jRLQc1JdByj/kXyoBe5eSJwTGSiklL5q68+JgoJ 6E3HY9IaedOdObJI6v+LqNzC2PnHZO3kU51E3SokmtGbtTMzSqW/QRoToikixbn9nrJ6 xif6jreVb6uxHF2Gbas9WJ2qucNQdL4GRrbtccIzTbEW2ugKXStuoxzztHjK8oKR2bqS NGag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=XLjaKIOd3KqrrW7I6gAkdk4H2/Y3ArQCptCWypt/QV4=; b=blGT6/OZUSo7zTSvMFOoMPTLEPgIqsdX1e/hBTI6fJx5vWxls+n5O76a4I+6Y8IrOo xpF9HPhuXu/OH75ZMmOu4Ki1X2T96C/JVf/JtRlMWA/jngnRSMcL+Lq/cr1ES7AHlcNT JypJqaUMiajv8HOX+OL6UjiwO4KD7ROFSN2S8bIIiowM92F7y/uaNa3gCzQgpk3EwEYk UGa5BlyVc6Wmo0cGaQ1O2ac65wHLbbRaNfgKtuGxH7cNdeKRjuqKpwbXDi9EqQ7L45eF kGdhD/XM6kjXF25Z8T56FUlKWuffXO0IOjx/Ezp9khw4/Li4MyMdrQgQ6fLI58Hd2pq0 ll7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=GyMGAJOO; 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 s66si8269665ywc.5.2019.02.18.07.04.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:04:38 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=GyMGAJOO; 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]:60090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkTF-0007e9-TK for patch@linaro.org; Mon, 18 Feb 2019 10:04:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyY-00078K-9K for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyW-0003Yy-IR for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:54 -0500 Received: from ozlabs.org ([2401:3900:2:1::2]:35565) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyV-0003HO-Ud; Mon, 18 Feb 2019 09:32:52 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s36xsCz9sNp; Tue, 19 Feb 2019 01:31:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500279; bh=SbFTW5ArUtzfEMNfc+DBJyifayJX+tu5Lp1EoIkfjWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GyMGAJOO8145/FO+/TMohslqmPc1pJeCtLPkhXCxAjZUUNvLNtnhKpmz+CMJUAvZm Dt0Pa+R/60ekrzBlMubxo+ws9hRVD7MLfLM1/5uU1mu488vnl4oFKRT79BXUp1UeHS taXECYcQonmS+2khgMUeZaIrl4xZCZGmn0rUVEsQ= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:47 +1100 Message-Id: <20190218143049.17142-42-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 41/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-16-mark.cave-ayland@ilande.co.uk> Signed-off-by: David Gibson --- target/ppc/cpu.h | 4 +++- target/ppc/int_helper.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) -- 2.20.1 diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index 1c883fa836..325ebbeb98 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1052,10 +1052,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 Mon Feb 18 14:30:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158630 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2614234jaa; Mon, 18 Feb 2019 07:22:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IY2pzUopfHYkbLB0gtSHPn+4FzKOsWCCBuRS4j5ZTX/936dASKrBWU6CPp1a/FrqBnm8G0/ X-Received: by 2002:a25:d14a:: with SMTP id i71mr14830039ybg.130.1550503332626; Mon, 18 Feb 2019 07:22:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503332; cv=none; d=google.com; s=arc-20160816; b=jxYgF5aUbZXn1yRbdRlhwghf5MiDMpZdfiRLpdcoS54LMvpsqwmqQbzjFhy937z3Rx ZSOc39dQOQYxMx6KBtyfZSAomanCsVH8g5jzA8wfxFDk26u6olpsuMGm+WZthTWilPjh 4ALn41pseCywbeikS1EaKxsupDz8YcIo04wyCL/FlSnZLJBubATI0QB+2Pf5roHKC/S3 YvBXs9nPyLgdM6TVhIDfO+L1gKH/iGV7qsnW7QE6VIQOf+MmHAVyPkp+82E2cqSnkmi6 qgadONamn/iJ7gvqOnO6tKPqKADE0h66pdInF8lK7Ibvy57EwS2DYAo7eTzsHEOBXKJ0 CkLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=/OAHQUZ16rmq8ZDvReuORt636UJFZnvfPle+rpO+WDY=; b=w86BvvN1XjEr+iKmMkGgQ1+isrc/77WYWBIfzdDxC3CBMofBB61dc+hq8KmNi49ahN uHS0xMgUNMdRdhUyFB5fO92MIfutMEwFapkiMfOAIJEEdH/Z5akAu57PmxhYzoyQMvIX iQonY4LFKVyFuIwfNb/jB8y6M11OdmWNcR2uj8plRliZE2cbLA4e8shmuovPwZzyd80z 4Adw7wMbMeqzGPhZTLsByIX1rpOKa79vE6APlCmKKpO4pWVJ0txAT57te9keWd0R2/TN pQOO7pFvemeMvrHG5TlykPooQ1BDLAKzjH0TBBKADPsndUcxEBlZAN4JY7U/mKYGJ1pb K2Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=FALScLTq; 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 j11si3310242ywc.156.2019.02.18.07.22.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:22:12 -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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=FALScLTq; 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]:60393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkkG-00058E-3T for patch@linaro.org; Mon, 18 Feb 2019 10:22:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjya-0007Aw-Fy for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyY-0003b0-Vs for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:56 -0500 Received: from ozlabs.org ([203.11.71.1]:44225) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyY-0003Z2-Ae; Mon, 18 Feb 2019 09:32:54 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s41DKvz9sRX; Tue, 19 Feb 2019 01:31:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500280; bh=aNLFd4pqYxyS6EItpFZi9xkbP2RLyrTKOmdx8BIWqP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FALScLTq97+Ks+PE72Qhz5D94ARU1ir8MQL1cgtG8Vnzk1yYz/fs4uwoBB6G0Jvl9 hr0NWvVMaHG9CGJUFCAS41BU4rt9Xhma8z+HAYiQn81GZLfoODrxmg2AfvPi+SHOLM WAOSwIONRAz1YNh9uQ0tQquCAE5fbypa8M9RqHmw= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:48 +1100 Message-Id: <20190218143049.17142-43-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 42/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-17-mark.cave-ayland@ilande.co.uk> Signed-off-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.20.1 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 Mon Feb 18 14:30:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 158628 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2611009jaa; Mon, 18 Feb 2019 07:19:18 -0800 (PST) X-Google-Smtp-Source: AHgI3IbvhlP0lqz57OtcrR+guJzKnWFIvx1FjVN/ncdEdarBdZGptYsbejpyEAMfMq80fYWhgQfF X-Received: by 2002:a81:446:: with SMTP id 67mr18357739ywe.310.1550503158591; Mon, 18 Feb 2019 07:19:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550503158; cv=none; d=google.com; s=arc-20160816; b=J5LzzluCOdlsBsGBKMuiczs5NLvAGfxuabS1EOce+AYW6jN5uvv5Xjp9fC/c2ZVz8h b+Spa9j8G7nTS3XUaDBgJQkLN94q41sFWVgl6KfzcPxs9emsXqtyD1KLZ4lQ9dj2gtdR pW34i7MCN3izv0ASF+H74o+xJAqibz0VxfvkI7GR8KS8RD215ov8lrB96oep8XwBsbgK RJJy5HBLjdVQrp1YlGg14fvbI5LMtYgiqtlo1h+7R349pTXaD/9dEdYb9NUn83XINIB2 fXrPetRNk74LCK1HmYuGZPuPqKu4DmQr+CZzc/Spld7gEtw3oFgMhBrNFPQ/qE6KOsVL X4Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=suP6Viz25HbHYpTvuSVojCdUgLhCSVu1v7gk4srHQvY=; b=I9Z0u/v8cflzor0yUJgx2thg/esVKMbbmgGfXv0eFknuDPNRzEVd9853ez0pFND63S tfXoTEN72gdC16REDQVvcnrGdulhB09mGuDRXkX58QDSUvaHac2YyECdUIHoakSxGk3G wvvTl/UBpGW4pjzx7HpvgQx4GEdm+QMbY+F4RgNBIsstS8mF6Muam/ytw0jvqgW+ZewX AfZvwbK1TWKPCJ7h0lodZEi84yks0hG6NnS98TEbVibNK/7bYztmyF2bZdk1CcyEI40S pF1UcLUVwSrTLE+w2Nfb5mkt2bN64puZDkgCUyaFmAA33hZxziHCyoDbvnqAbhTiCDAo K3mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=lH4w5lu3; 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 l188si8090564ywg.425.2019.02.18.07.19.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 18 Feb 2019 07:19: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; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=lH4w5lu3; 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]:60349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvkhS-0003Rp-2t for patch@linaro.org; Mon, 18 Feb 2019 10:19:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gvjyY-00078n-MZ for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gvjyW-0003YV-9u for qemu-devel@nongnu.org; Mon, 18 Feb 2019 09:32:54 -0500 Received: from ozlabs.org ([203.11.71.1]:37345) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gvjyV-0003Gd-Ka; Mon, 18 Feb 2019 09:32:52 -0500 Received: by ozlabs.org (Postfix, from userid 1007) id 4435s35y9Xz9sP6; Tue, 19 Feb 2019 01:31:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1550500279; bh=xIjHaidE3XlcLM9BBPaNibCsVVy8yS+uIYwX5U6bAFE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lH4w5lu3hk84bGG6ZOxAXCQOnSV5Y5zzXwG2UZJCciLgPZNLSM2XBUSUQhoo/fIWu 4aWpxZxypJicuaJjM3EQbTOIW/mvyXkYLE7GRfWZZn4upP6IkCT9eqkcPRgfRjchxM 3Go6QDe4qsocbqmQNiyoDAMUrvvcwKi9erZoREaA= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 19 Feb 2019 01:30:49 +1100 Message-Id: <20190218143049.17142-44-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218143049.17142-1-david@gibson.dropbear.id.au> References: <20190218143049.17142-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 43/43] 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: , Cc: Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Message-Id: <20190215100058.20015-18-mark.cave-ayland@ilande.co.uk> Signed-off-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.20.1 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, \