From patchwork Mon May 6 01:03:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 794958 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp718962wra; Sun, 5 May 2024 18:12:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXVUG0O9fEqk0QI9BV6e0yrkqONioTphuvFts59TAKkCs9CzTm3+EZ4ANd2wS2WalNQbg3gFBSov7OmDvIcDSb1 X-Google-Smtp-Source: AGHT+IGLwMbL4aetRVZgdlC6dvKveTnLX76xPQ1HWwIi1o5zb7D+xQONjaW1U7oeSX0w3Mt/sCGV X-Received: by 2002:ac8:5a48:0:b0:43a:e704:8a74 with SMTP id o8-20020ac85a48000000b0043ae7048a74mr10765761qta.57.1714957975569; Sun, 05 May 2024 18:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714957975; cv=none; d=google.com; s=arc-20160816; b=V/+WkssjNtvrEizPGgThLoxfnBwPyQ44CwQDy9U8nldsYC4IMHNk+ak3qfwa1XgPdP KbJ0QpoGn2BralfWmGMa6UXlIWqdlPmDPTy/48Q4DHEghIcPhnE8qTqifXKMDcQgCKqf rrB4+VhsgOw68JbNmn/pq/2cpkSvBdpjb9GSKfiTGSdpSlXKRUXX8cSKc4WbTqWPbkmF n0fPdWm/b1rfJlD56QVp4//Kn6LYSDIs/WURnuf0sEwZWls/TpITRdyLFxmx85Jh3Px/ kyt6JmsTrJ7mRNTYklini35geM8S9R9fqGBSD3eFgDzWnz5X5EkHIVMytzvE3trmm+a/ dxdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EAk+AKEhGDCmtMPJ4RMZskfIIvGN7VLr1LadByn/0vE=; fh=9Ev+QBUhk6P6vR3LT1wYeDLexozsz44nqjfoyPajZCc=; b=mZlmwlhCVp70MWgsMApFI+3WXFp5ZReTQ1I2zkhcvk4/PKQQxTkq+SFDrHBJ5Z+eCY ew+ECa8umY0hxa+P4Fwt3td/5/MTDQXidtFL2yEs0l689m06iux7crsC2Y7FZkLSxg1Y Oh7K8kzyfCzPfB9FN0w7axdK3lFxI1J+m6bsAffJlv++SkZIcFEMA5Q6yrbVEwTmPTKK SO/UE7cDptXavZA70k/5DXt6kqm8j7YBHWezTh7tDEHqP3AlnZCaRdCWRrtt0AmRv16O hQaw3WbYwmbv1TAMuhjshr5O4L7xPuAnX80bq3gtFsRm3m6LrMwekNjOL0Y+D7Cr5nBg GYZg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W5Bpd5NX; 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 d15-20020a05622a05cf00b0043af50b17f9si8400179qtb.93.2024.05.05.18.12.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 May 2024 18:12:55 -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=W5Bpd5NX; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3mq3-0008Tc-QQ; Sun, 05 May 2024 21:08:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3mpZ-0007bE-Se for qemu-devel@nongnu.org; Sun, 05 May 2024 21:07:51 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3mpT-0003LE-CQ for qemu-devel@nongnu.org; Sun, 05 May 2024 21:07:49 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6f44dc475f4so777608b3a.2 for ; Sun, 05 May 2024 18:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714957661; x=1715562461; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EAk+AKEhGDCmtMPJ4RMZskfIIvGN7VLr1LadByn/0vE=; b=W5Bpd5NXhRgwhpaiyPEP6ZB7O68BufKmWmOYIty4t90YODXegaVZQJJFCSgo7jF3s2 vmtKyxrY4PPKcRwbbu+B5QKn0aGzZRPJg6YO24+/6GACns4Yow12treVKRianO+/j8w0 D2SQlIO0YqeSG7/ZGlMN3fOsXpmwmu9Ph/We3fXno8Pdp2NxWlmOXx+PJpUgl4WVPQl7 c9A2xRzHV23lx3kSGBVbCgW8MfVrwbHN19DXvaR3DUbLWB82MT52VMXcB3QmQjzMxGPa aBYgF1TlB1Lm3I1LhIV8sZdvDkIMiIfIiQQJMJ4p3YtltsWjw1zgi75lVLjA6QuHInYK e5lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714957661; x=1715562461; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EAk+AKEhGDCmtMPJ4RMZskfIIvGN7VLr1LadByn/0vE=; b=BA/fZNj9WMBcFP0Z/+YnJgmyDJlJs09mkB+5YfwLy0g7KLgvNcou5R7c9wtZyOj/Ti SZ0qn0g+s9/Xm/k5Bdswvof3Z0t+dbuMVXZj5ejz0AylDrI32x9dA9I3A5rCgxzteovK od5EZ9DoxNxKG+MjWegCOOfi72mwcJjeMh4eKzN2j1hZjdWFOJ9TXszj2Cdw/SWbEZz9 Zbv+cj8o0DDzYtfY8CZCd/6Xd5OsWwTU2RChPhQbWNPmI2abKxJxIub36iAp3WNJRvjG 13bXVbQN64TcLO2Ez1bu76x2QBiO6YZDN3RWN5tVovGF+6yeb7yIJsS7jXMZ9wu+acKP 2qCA== X-Gm-Message-State: AOJu0Yx8W0hOP5D80e5Pmmgw7jrggkHMTr10m4DiDd/EZlh3nFCKqjUw IHRyyqpJARI83RbkG7xhfnxJYjWvYoiEf3yk22ja7MqeRPCCzwui4v/XtVrU4ij+CE8F/ZwkF0A d X-Received: by 2002:a05:6a00:8c4:b0:6ed:5f64:2fef with SMTP id s4-20020a056a0008c400b006ed5f642fefmr10917813pfu.17.1714957660932; Sun, 05 May 2024 18:07:40 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id kp4-20020a056a00464400b006e580678dfbsm6577287pfb.193.2024.05.05.18.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 18:07:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 43/57] target/arm: Convert ADD, SUB (vector) to decodetree Date: Sun, 5 May 2024 18:03:49 -0700 Message-Id: <20240506010403.6204-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240506010403.6204-1-richard.henderson@linaro.org> References: <20240506010403.6204-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson --- target/arm/tcg/a64.decode | 6 ++++++ target/arm/tcg/translate-a64.c | 34 +++++++++++----------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 86279edc98..97fe1ef927 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -765,6 +765,9 @@ UQSHL_s 0111 1110 ..1 ..... 01001 1 ..... ..... @rrr_e SQRSHL_s 0101 1110 ..1 ..... 01011 1 ..... ..... @rrr_e UQRSHL_s 0111 1110 ..1 ..... 01011 1 ..... ..... @rrr_e +ADD_s 0101 1110 111 ..... 10000 1 ..... ..... @rrr_d +SUB_s 0111 1110 111 ..... 10000 1 ..... ..... @rrr_d + ### Advanced SIMD scalar pairwise FADDP_s 0101 1110 0011 0000 1101 10 ..... ..... @rr_h @@ -895,6 +898,9 @@ UQSHL_v 0.10 1110 ..1 ..... 01001 1 ..... ..... @qrrr_e SQRSHL_v 0.00 1110 ..1 ..... 01011 1 ..... ..... @qrrr_e UQRSHL_v 0.10 1110 ..1 ..... 01011 1 ..... ..... @qrrr_e +ADD_v 0.00 1110 ..1 ..... 10000 1 ..... ..... @qrrr_e +SUB_v 0.10 1110 ..1 ..... 10000 1 ..... ..... @qrrr_e + ### Advanced SIMD scalar x indexed element FMUL_si 0101 1111 00 .. .... 1001 . 0 ..... ..... @rrx_h diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index db3ba77760..9daa8fe5b0 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -5119,6 +5119,8 @@ TRANS(SSHL_s, do_int3_scalar_d, a, gen_sshl_i64) TRANS(USHL_s, do_int3_scalar_d, a, gen_ushl_i64) TRANS(SRSHL_s, do_int3_scalar_d, a, gen_helper_neon_rshl_s64) TRANS(URSHL_s, do_int3_scalar_d, a, gen_helper_neon_rshl_u64) +TRANS(ADD_s, do_int3_scalar_d, a, tcg_gen_add_i64) +TRANS(SUB_s, do_int3_scalar_d, a, tcg_gen_sub_i64) typedef struct ENVScalar2 { NeonGenTwoOpEnvFn *gen_bhs[3]; @@ -5433,6 +5435,8 @@ TRANS(UQSHL_v, do_gvec_fn3, a, gen_neon_uqshl) TRANS(SQRSHL_v, do_gvec_fn3, a, gen_neon_sqrshl) TRANS(UQRSHL_v, do_gvec_fn3, a, gen_neon_uqrshl) +TRANS(ADD_v, do_gvec_fn3, a, tcg_gen_gvec_add) +TRANS(SUB_v, do_gvec_fn3, a, tcg_gen_gvec_sub) /* * Advanced SIMD scalar/vector x indexed element @@ -9438,13 +9442,6 @@ static void handle_3same_64(DisasContext *s, int opcode, bool u, } gen_cmtst_i64(tcg_rd, tcg_rn, tcg_rm); break; - case 0x10: /* ADD, SUB */ - if (u) { - tcg_gen_sub_i64(tcg_rd, tcg_rn, tcg_rm); - } else { - tcg_gen_add_i64(tcg_rd, tcg_rn, tcg_rm); - } - break; default: case 0x1: /* SQADD / UQADD */ case 0x5: /* SQSUB / UQSUB */ @@ -9452,6 +9449,7 @@ static void handle_3same_64(DisasContext *s, int opcode, bool u, case 0x9: /* SQSHL, UQSHL */ case 0xa: /* SRSHL, URSHL */ case 0xb: /* SQRSHL, UQRSHL */ + case 0x10: /* ADD, SUB */ g_assert_not_reached(); } } @@ -9476,7 +9474,6 @@ static void disas_simd_scalar_three_reg_same(DisasContext *s, uint32_t insn) case 0x6: /* CMGT, CMHI */ case 0x7: /* CMGE, CMHS */ case 0x11: /* CMTST, CMEQ */ - case 0x10: /* ADD, SUB (vector) */ if (size != 3) { unallocated_encoding(s); return; @@ -9495,6 +9492,7 @@ static void disas_simd_scalar_three_reg_same(DisasContext *s, uint32_t insn) case 0x9: /* SQSHL, UQSHL */ case 0xa: /* SRSHL, URSHL */ case 0xb: /* SQRSHL, UQRSHL */ + case 0x10: /* ADD, SUB (vector) */ unallocated_encoding(s); return; } @@ -10952,6 +10950,11 @@ static void disas_simd_3same_int(DisasContext *s, uint32_t insn) case 0x01: /* SQADD, UQADD */ case 0x05: /* SQSUB, UQSUB */ + case 0x08: /* SSHL, USHL */ + case 0x09: /* SQSHL, UQSHL */ + case 0x0a: /* SRSHL, URSHL */ + case 0x0b: /* SQRSHL, UQRSHL */ + case 0x10: /* ADD, SUB */ unallocated_encoding(s); return; } @@ -10989,13 +10992,6 @@ static void disas_simd_3same_int(DisasContext *s, uint32_t insn) gen_gvec_fn3(s, is_q, rd, rn, rm, gen_gvec_saba, size); } return; - case 0x10: /* ADD, SUB */ - if (u) { - gen_gvec_fn3(s, is_q, rd, rn, rm, tcg_gen_gvec_sub, size); - } else { - gen_gvec_fn3(s, is_q, rd, rn, rm, tcg_gen_gvec_add, size); - } - return; case 0x13: /* MUL, PMUL */ if (!u) { /* MUL */ gen_gvec_fn3(s, is_q, rd, rn, rm, tcg_gen_gvec_mul, size); @@ -11038,14 +11034,6 @@ static void disas_simd_3same_int(DisasContext *s, uint32_t insn) vec_full_reg_offset(s, rm), is_q ? 16 : 8, vec_full_reg_size(s)); return; - - case 0x01: /* SQADD, UQADD */ - case 0x05: /* SQSUB, UQSUB */ - case 0x08: /* SSHL, USHL */ - case 0x09: /* SQSHL, UQSHL */ - case 0x0a: /* SRSHL, URSHL */ - case 0x0b: /* SQRSHL, UQRSHL */ - g_assert_not_reached(); } if (size == 3) {