From patchwork Tue Mar 17 19:00:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 184665 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp4500455ile; Tue, 17 Mar 2020 12:01:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtq0BfqjCgxh+d80Vlaqj3ZMiXoPKd6TKtQf4izlhrjwU/SHbpsFY6oOMXWw+0W+6Lk6Obf X-Received: by 2002:aed:38ea:: with SMTP id k97mr688437qte.66.1584471664286; Tue, 17 Mar 2020 12:01:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584471664; cv=none; d=google.com; s=arc-20160816; b=aJl/McmFkQqKnpoVp3eCYBHDU4djHrilpIm662o+mDMS7hfcr9roKJglX4d9TuUTT3 CI6iDf8b6eYDHQEWMLEVrpE+9KWcQe3Jkv/H7/SCLoqMlEZeD5h8YOmn1i4JQMP2jzU5 YAMzVUjWUHO1ZzTN3oQgCnwrysyGrglAMaL63y9i3k5Q0Cfpf50EaFWr9c1aqvoOvnmU b7ePA4WZ0eGMFoatLM9TH7neEuysfK9r6SfmiKgeSpwiPc8Wf0eGmq5BWz4fItuf5USk qE2rlP35H+o3/CjACzE5cg++4ZyjciO/veYR2CC6ssZpDHGFBedl1lUT9wEqnHoml+xa 1f+A== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=jFLYAZoqwDTEu0F4qEf8cTvEll1bS4pjAF8UeJqCwYI=; b=uMXK93W5Z+fhMq5M7BjGiee0OeC5ua+5z2nEkqgpYI+MBbJaD2TZGkESjKZ5OtpKcr Vl2TBlxs37+qGCla5tu8HZgJkJ4ei/PdykQFKk3b3+sE7jsAKeLQtV3ynniMmA8ldB5H SiCyaE4xSmPcrG5sYr1VsZyPwzn692MA2V52jH/hcepyIRDnLyK5QLeo0+ItjjxptXti isFQ71phasDaZNHe6tiSnV9WS2DiOAL9G7bSllKE4+fozXtWkhhQtSGn3y8s+pz10p+Y 9WM8oCi73gVemkhjlhz4WdrYV0jhMK0a5s0FNfgShHKq68HLwZcx97TXTEVRYNXY0xE9 bjcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nLtn+kr4; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n202si2655086qka.151.2020.03.17.12.01.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 17 Mar 2020 12:01:04 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=nLtn+kr4; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEHSZ-0007I6-GD for patch@linaro.org; Tue, 17 Mar 2020 15:01:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33318) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEHRw-0007FO-KA for qemu-devel@nongnu.org; Tue, 17 Mar 2020 15:00:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEHRu-0004bW-Pw for qemu-devel@nongnu.org; Tue, 17 Mar 2020 15:00:24 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:38851) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jEHRu-0004VA-Iw for qemu-devel@nongnu.org; Tue, 17 Mar 2020 15:00:22 -0400 Received: by mail-pg1-x533.google.com with SMTP id x7so12235762pgh.5 for ; Tue, 17 Mar 2020 12:00:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jFLYAZoqwDTEu0F4qEf8cTvEll1bS4pjAF8UeJqCwYI=; b=nLtn+kr486UZBruM5UvoTWFA0rO77oPXi86HX5sRkuijkPNTKlurn5/ITkzLCfflAG uMUCqc0Kal9B8pic/ICrEpwazoNi8OlXNTqpkbkDLLiO6LVxZpjQDTcRSDivG/0+gB36 AZKtrz25JQsDle9UGqeDjeIuuwl0bDjCYUyghPTGnuCAneYZ3836uZqBmCKhOmKq6A5L pwY/6OQwX1Qf/a4pCoPTIlgLdYthf+mfSIjfLXj5Mem6oaKL8GXrCCoFERvb3JOPTBbH I9pF2FlZbtqUbfj5A9ASvLLCP1XmIDsESuTLbdBuN+iEGe0n2yfzw3InH69aOUebA55I U7Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jFLYAZoqwDTEu0F4qEf8cTvEll1bS4pjAF8UeJqCwYI=; b=Wgz5gAv31KIs1fngKQ/SvPxo+iXupoJzb2GTymygtGQX9QRcKO1tU48cyeIUfby8OE ebHPNmBjSAUI34mwdw35QZWotxwAgsYDilocJIuI3xy8B73cq1JCGkvCRjPShE9RIarB OQYKsPsGTN/FvOk1p828xXIwgnKICG0QXpBUtDikmN0EFHXCdjNZNvJdKIJ/q55zqx1y MBLT0fknNZW3KyspJ081ZIjv+frvAVVY4xlzaH/ACSOYVI3MBBT3WyfP0qdo/XNI9fCX NZVgB8g6vd4mqSdbOZ4DrqXXP2Ecz3h/Z/NBeZw7tuOg1r4Ty4NjBEJKjDLjfT5hdbSN qrIQ== X-Gm-Message-State: ANhLgQ3i2YuEGgtHWPADSpnINw1nAd5X68UYLopm5mX4kZfovtIEpmYH A1aZRnWDD+/66EewCO5ai/WP85A3H0c= X-Received: by 2002:a65:6447:: with SMTP id s7mr641993pgv.163.1584471620980; Tue, 17 Mar 2020 12:00:20 -0700 (PDT) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id y13sm3738411pfp.88.2020.03.17.12.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 12:00:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 4/5] tcg: Tidy tcg-runtime-gvec.c DUP* Date: Tue, 17 Mar 2020 12:00:12 -0700 Message-Id: <20200317190013.25036-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200317190013.25036-1-richard.henderson@linaro.org> References: <20200317190013.25036-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::533 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Partial cleanup from the CONFIG_VECTOR16 removal. Replace the DUP* expansions with the scalar argument. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/tcg-runtime-gvec.c | 50 +++++++++++------------------------- 1 file changed, 15 insertions(+), 35 deletions(-) -- 2.20.1 diff --git a/accel/tcg/tcg-runtime-gvec.c b/accel/tcg/tcg-runtime-gvec.c index 97852b515b..f2199f14b4 100644 --- a/accel/tcg/tcg-runtime-gvec.c +++ b/accel/tcg/tcg-runtime-gvec.c @@ -24,11 +24,6 @@ #include "tcg/tcg-gvec-desc.h" -#define DUP16(X) X -#define DUP8(X) X -#define DUP4(X) X -#define DUP2(X) X - static inline void clear_high(void *d, intptr_t oprsz, uint32_t desc) { intptr_t maxsz = simd_maxsz(desc); @@ -88,11 +83,10 @@ void HELPER(gvec_add64)(void *d, void *a, void *b, uint32_t desc) void HELPER(gvec_adds8)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint8_t vecb = (uint8_t)DUP16(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint8_t)) { - *(uint8_t *)(d + i) = *(uint8_t *)(a + i) + vecb; + *(uint8_t *)(d + i) = *(uint8_t *)(a + i) + (uint8_t)b; } clear_high(d, oprsz, desc); } @@ -100,11 +94,10 @@ void HELPER(gvec_adds8)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_adds16)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint16_t vecb = (uint16_t)DUP8(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint16_t)) { - *(uint16_t *)(d + i) = *(uint16_t *)(a + i) + vecb; + *(uint16_t *)(d + i) = *(uint16_t *)(a + i) + (uint16_t)b; } clear_high(d, oprsz, desc); } @@ -112,11 +105,10 @@ void HELPER(gvec_adds16)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_adds32)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint32_t vecb = (uint32_t)DUP4(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint32_t)) { - *(uint32_t *)(d + i) = *(uint32_t *)(a + i) + vecb; + *(uint32_t *)(d + i) = *(uint32_t *)(a + i) + (uint32_t)b; } clear_high(d, oprsz, desc); } @@ -124,11 +116,10 @@ void HELPER(gvec_adds32)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_adds64)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint64_t vecb = (uint64_t)DUP2(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint64_t)) { - *(uint64_t *)(d + i) = *(uint64_t *)(a + i) + vecb; + *(uint64_t *)(d + i) = *(uint64_t *)(a + i) + b; } clear_high(d, oprsz, desc); } @@ -180,11 +171,10 @@ void HELPER(gvec_sub64)(void *d, void *a, void *b, uint32_t desc) void HELPER(gvec_subs8)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint8_t vecb = (uint8_t)DUP16(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint8_t)) { - *(uint8_t *)(d + i) = *(uint8_t *)(a + i) - vecb; + *(uint8_t *)(d + i) = *(uint8_t *)(a + i) - (uint8_t)b; } clear_high(d, oprsz, desc); } @@ -192,11 +182,10 @@ void HELPER(gvec_subs8)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_subs16)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint16_t vecb = (uint16_t)DUP8(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint16_t)) { - *(uint16_t *)(d + i) = *(uint16_t *)(a + i) - vecb; + *(uint16_t *)(d + i) = *(uint16_t *)(a + i) - (uint16_t)b; } clear_high(d, oprsz, desc); } @@ -204,11 +193,10 @@ void HELPER(gvec_subs16)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_subs32)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint32_t vecb = (uint32_t)DUP4(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint32_t)) { - *(uint32_t *)(d + i) = *(uint32_t *)(a + i) - vecb; + *(uint32_t *)(d + i) = *(uint32_t *)(a + i) - (uint32_t)b; } clear_high(d, oprsz, desc); } @@ -216,11 +204,10 @@ void HELPER(gvec_subs32)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_subs64)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint64_t vecb = (uint64_t)DUP2(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint64_t)) { - *(uint64_t *)(d + i) = *(uint64_t *)(a + i) - vecb; + *(uint64_t *)(d + i) = *(uint64_t *)(a + i) - b; } clear_high(d, oprsz, desc); } @@ -272,11 +259,10 @@ void HELPER(gvec_mul64)(void *d, void *a, void *b, uint32_t desc) void HELPER(gvec_muls8)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint8_t vecb = (uint8_t)DUP16(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint8_t)) { - *(uint8_t *)(d + i) = *(uint8_t *)(a + i) * vecb; + *(uint8_t *)(d + i) = *(uint8_t *)(a + i) * (uint8_t)b; } clear_high(d, oprsz, desc); } @@ -284,11 +270,10 @@ void HELPER(gvec_muls8)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_muls16)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint16_t vecb = (uint16_t)DUP8(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint16_t)) { - *(uint16_t *)(d + i) = *(uint16_t *)(a + i) * vecb; + *(uint16_t *)(d + i) = *(uint16_t *)(a + i) * (uint16_t)b; } clear_high(d, oprsz, desc); } @@ -296,11 +281,10 @@ void HELPER(gvec_muls16)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_muls32)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint32_t vecb = (uint32_t)DUP4(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint32_t)) { - *(uint32_t *)(d + i) = *(uint32_t *)(a + i) * vecb; + *(uint32_t *)(d + i) = *(uint32_t *)(a + i) * (uint32_t)b; } clear_high(d, oprsz, desc); } @@ -308,11 +292,10 @@ void HELPER(gvec_muls32)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_muls64)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint64_t vecb = (uint64_t)DUP2(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint64_t)) { - *(uint64_t *)(d + i) = *(uint64_t *)(a + i) * vecb; + *(uint64_t *)(d + i) = *(uint64_t *)(a + i) * b; } clear_high(d, oprsz, desc); } @@ -559,11 +542,10 @@ void HELPER(gvec_eqv)(void *d, void *a, void *b, uint32_t desc) void HELPER(gvec_ands)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint64_t vecb = (uint64_t)DUP2(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint64_t)) { - *(uint64_t *)(d + i) = *(uint64_t *)(a + i) & vecb; + *(uint64_t *)(d + i) = *(uint64_t *)(a + i) & b; } clear_high(d, oprsz, desc); } @@ -571,11 +553,10 @@ void HELPER(gvec_ands)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_xors)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint64_t vecb = (uint64_t)DUP2(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint64_t)) { - *(uint64_t *)(d + i) = *(uint64_t *)(a + i) ^ vecb; + *(uint64_t *)(d + i) = *(uint64_t *)(a + i) ^ b; } clear_high(d, oprsz, desc); } @@ -583,11 +564,10 @@ void HELPER(gvec_xors)(void *d, void *a, uint64_t b, uint32_t desc) void HELPER(gvec_ors)(void *d, void *a, uint64_t b, uint32_t desc) { intptr_t oprsz = simd_oprsz(desc); - uint64_t vecb = (uint64_t)DUP2(b); intptr_t i; for (i = 0; i < oprsz; i += sizeof(uint64_t)) { - *(uint64_t *)(d + i) = *(uint64_t *)(a + i) | vecb; + *(uint64_t *)(d + i) = *(uint64_t *)(a + i) | b; } clear_high(d, oprsz, desc); }