From patchwork Sat Mar 2 05:15:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777477 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694504wrn; Fri, 1 Mar 2024 21:18:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUXF22pwo+PrOJo69r48+fbHhymqygSIdVEgNhn11ZwIW43M4wzZp97EywhlzpnBmZsE4+pcV9rJPR8cxq/8oC8 X-Google-Smtp-Source: AGHT+IGNYlDaZjGqWb3esFaUNFqpBzKkbRMLMNw+12kszFHmQgM5/Ae88SN6wmia79J31WLtENp2 X-Received: by 2002:a05:622a:1c5:b0:42e:c64f:91b2 with SMTP id t5-20020a05622a01c500b0042ec64f91b2mr4090542qtw.17.1709356699882; Fri, 01 Mar 2024 21:18:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356699; cv=none; d=google.com; s=arc-20160816; b=WR1giaO3y2J77orRa2b57jcTQZ9p4gWjyDJINYZ4cNY3XqR8l/Vom/m56WMCVBlLyh fL4Gvhq6LwIwTM95pKWokXJo2huKyK0wPkgHgq3w4ym+hKoYWQrErCDN6cLSIJTrW/NF LUTljECTT2mUrrQzybdEIWyoqitu2Y/l/WR7tFZxa4mKwPJVrfhQvUTecO7gPYmGdjyN LLI+N0DdOHY3gJkJchBCkCzYBpm8c9pRj5bUWw2cjCLexnUrmAeloQ2tZm31HiM1NdKZ +ScU/SByutBJ47G/xNG4pjGqAtstMF6XVxIV9pIZnzJv60r9ZkNcXU8IqJFEeqf7AGyN 9c8g== 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=SqTaay3vfX0RnU8kn+fHbm8BSG9uRWmoUVyFSKJHkDQ=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=b8dPktayFoFtj6xl8SLZ3X+U2EwzcebNnNCw5e04aJw3daCOQmZ7aXoUPPlmYvkcdy dMv7igP+F468yRIC+aLzantYh36hTvtOVs8Nag7/foKjNiD/7N0lw3RFmu8xd7bbRngo e5lc6W5yc7Z28pABNup0Gi9rM8zRjtuSNyyB+DUXdOBkFG+0DdtabF+mQ0qAclLm4XJn jp73Ym1UgWxE//0xhjg3hlPY04bzKoc/U5s72CHfXx1SlksW1m0rIPxKqtm25+HBcPX9 RPXbnIHwVz3wuPMGP53fwe/x/SqCfLuo9qT+fPV1qcvVeHzGU7VY7Rka8lX8hbeoLc/g glVw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nse4cjAT; 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 w16-20020ac87e90000000b0042ed0c896b1si1003182qtj.217.2024.03.01.21.18.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:19 -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=pass header.i=@linaro.org header.s=google header.b=nse4cjAT; 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 1rgHk6-00032Q-TM; Sat, 02 Mar 2024 00:17:02 -0500 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 1rgHk4-00031h-Uy for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:00 -0500 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjy-0007au-32 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:00 -0500 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-5cddc5455aeso2321780a12.1 for ; Fri, 01 Mar 2024 21:16:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356613; x=1709961413; 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=SqTaay3vfX0RnU8kn+fHbm8BSG9uRWmoUVyFSKJHkDQ=; b=nse4cjAT+V7HxyGYYUpkHV42Bk35Oy4NRdkhR+mzIH2CENBVZZVwILoi8MHDgF8lVO s3ScieCtn8MSieYsjboX3iXPOe9m6VgNO4el/olRPkXn5y0H9/4ZbxBhEzzI/QsaYm13 Fom5xk6vFbpawbbzAA2xX/L+GBqYdmR6Kc3wREUlIIyrD2sw/W4+p/rHIlRtjc1wDTBf MbAfDSigkSYl7Wyl8nCW1x49Ofl5DYf8olECy197JwXiZUNCU01sCdAnm+45RhwuLOM9 5SzdIzCiBDkxipSDh0OYphmal05Ltl7iv0qtj6f64i5/IhpQ0bVhgFCv3DYL0UUjUiq6 eJ4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356613; x=1709961413; 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=SqTaay3vfX0RnU8kn+fHbm8BSG9uRWmoUVyFSKJHkDQ=; b=dzLPWB1vVh1dy4WRSI3CZZcboqWVVFVyXziVtfYkHWweuMdheK4ckxiTYOBbRTdGdD l42ftTAa1rXSyvx1Ui+7aZJmvsHg87IPOFDSigY1Ly0XzLpZxIUS6BdBflhGfwifByCH 4LM+Vfgd80vFLTXRt0F+BwyyY7zdogtHgzmw+JxdPEQL1NT8YrQF/baFPQQd3yMuYpyi A5JEtzd/4zqGCJyZFn2Y0UoHksTB1UACI3KBv5af73n3y/K8nzMEoc1mg0w0HL7o+P+I 0he0E/fGwdTlC6ChuuNqtyWRTRCyj5f7t094GHPe5E8MZi+IEx6CFHHuVevO6PdQNV60 qn3g== X-Gm-Message-State: AOJu0Yxk29FtBEiuI3AgUDDlKWpRZPDDT+TPwlebRo8XdU4uNjozxQ35 i0kcmFiaa8BjU/QMt7fQyKh5l+sluiS4tKMvG96cH5mAZe73Vas+hDiud2R60mRDlL4qqb8zlpq m X-Received: by 2002:a05:6a20:4328:b0:1a1:47ff:81f4 with SMTP id h40-20020a056a20432800b001a147ff81f4mr167825pzk.20.1709356612840; Fri, 01 Mar 2024 21:16:52 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id v8-20020a17090a458800b0029af67d4fd0sm4034901pjg.44.2024.03.01.21.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 30/41] target/sparc: Implement XMULX Date: Fri, 1 Mar 2024 19:15:50 -1000 Message-Id: <20240302051601.53649-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240302051601.53649-1-richard.henderson@linaro.org> References: <20240302051601.53649-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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/sparc/helper.h | 2 ++ target/sparc/translate.c | 4 ++++ target/sparc/vis_helper.c | 11 +++++++++++ target/sparc/insns.decode | 2 ++ 4 files changed, 19 insertions(+) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 56daf2ad01..9b642fd74b 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -130,6 +130,8 @@ DEF_HELPER_FLAGS_2(fcmpeq8, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fcmpne8, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fcmpule8, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fcmpugt8, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(xmulx, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(xmulxhi, TCG_CALL_NO_RWG_SE, i64, i64, i64) #endif #undef VIS_HELPER #undef VIS_CMPHELPER diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 2d697d2020..f8db98c32f 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -91,6 +91,8 @@ # define gen_helper_fxtoq ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fxtos ({ qemu_build_not_reached(); NULL; }) # define gen_helper_pdist ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_xmulx ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_xmulxhi ({ qemu_build_not_reached(); NULL; }) # define MAXTL_MASK 0 #endif @@ -5081,6 +5083,8 @@ TRANS(FPCMPULE8, VIS3B, do_rdd, a, gen_helper_fcmpule8) TRANS(FPCMPUGT8, VIS3B, do_rdd, a, gen_helper_fcmpugt8) TRANS(PDISTN, VIS3, do_rdd, a, gen_op_pdistn) +TRANS(XMULX, VIS3, do_rdd, a, gen_helper_xmulx) +TRANS(XMULXHI, VIS3, do_rdd, a, gen_helper_xmulxhi) static bool do_env_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_env, TCGv_i64, TCGv_i64)) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 8675ac64b3..387acb3855 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/helper-proto.h" +#include "crypto/clmul.h" /* This function uses non-native bit order */ #define GET_FIELD(X, FROM, TO) \ @@ -492,3 +493,13 @@ uint64_t helper_fslas32(uint64_t src1, uint64_t src2) return r.ll; } + +uint64_t helper_xmulx(uint64_t src1, uint64_t src2) +{ + return int128_getlo(clmul_64(src1, src2)); +} + +uint64_t helper_xmulxhi(uint64_t src1, uint64_t src2) +{ + return int128_gethi(clmul_64(src1, src2)); +} diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 0cd1cffe18..54ba329440 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -391,6 +391,8 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ ADDXCcc 10 ..... 110110 ..... 0 0001 0011 ..... @r_r_r UMULXHI 10 ..... 110110 ..... 0 0001 0110 ..... @r_r_r LZCNT 10 ..... 110110 00000 0 0001 0111 ..... @r_r2 + XMULX 10 ..... 110110 ..... 1 0001 0101 ..... @r_r_r + XMULXHI 10 ..... 110110 ..... 1 0001 0110 ..... @r_r_r ALIGNADDR 10 ..... 110110 ..... 0 0001 1000 ..... @r_r_r ALIGNADDRL 10 ..... 110110 ..... 0 0001 1010 ..... @r_r_r