From patchwork Sat Mar 2 05:15:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777487 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694721wrn; Fri, 1 Mar 2024 21:19:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWCuOMMlIpUOpWiEGNi8g3kQkC8mCjQeEOpCYYaP2Hci57q8VZ7kohYts2gwbx3sSh8Jp7m+keza8/1QEScxHve X-Google-Smtp-Source: AGHT+IFEwXQGWPJOUX+t8PHgTUzLoBh9r1+fQ8FG6sH7Jbi5BfbhOlkibLZl1ctqmge2I32nhDEy X-Received: by 2002:ac8:5fd6:0:b0:42e:defb:1a46 with SMTP id k22-20020ac85fd6000000b0042edefb1a46mr82059qta.23.1709356753525; Fri, 01 Mar 2024 21:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356753; cv=none; d=google.com; s=arc-20160816; b=oVrdsH20Vf5be10z2NICp5Er18Bh28lgVArFQG5iMZXtyxcA7w73ilPb7Jr01xWnW4 QN2ZbctFMgiazNfKLa79SWLdoFDPWCqkjQUUIdYBgcUDHCLK/84MMvDo+du9JeDMB/js 0hASHwfsoXpxdCtwijeN3IThDTqeh+4fXXONRheOZqBE1FtBJrxq9lkI8yKk5YpO8mS/ eICs6r4o2W7u4O+nzJGqM8WgFrHUE6k4xulYAlDJVbCi6SX6AZxBvuMbgDDHr/Rx4QoG ymUOsFOw1jqLJrzbpMJQyzUpIIVqilJRnoKgK6AzeFet3l4RkGQtFLK0uF4oDOVBIiTO uBfw== 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=yRnj6RNj8pIhlV8KrPPZGUlyyYXlw3LRarbXZSGYsp4=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=E+uJe4ocwKkGoEaCTRLMJ+GxFkvMWCGfKQUqtzCuh55fuYOMzgyhYTWsaTwQETDneF vSzI1fVrZsNbUJUdswbYIJ3x6IH+pjW5KLOW37BZniFcfxETbNNrdnWvClzG+6ogCvK8 lSGapSMjiG7SY0ySMSUuYJmB3QqyyXxo7iai78M92/CfsNwZ7dXrYC9kiRIhBhLiruwU ShCLU84r1xQelgWXaOR8XkE3mSffIpNP+4Z7XJIIMaStuB1zr5Wzs2MM2MBT3qnSGMCg i9ETtR/TxSD3Kj5GU8itK8vqDQ7mXq8+iiO6q0iVU1jhAaqmftQsPOuk0syN5wQ/SEqH iMzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HMbPzgFS; 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 g24-20020ac870d8000000b0042ec5f75661si3206766qtp.546.2024.03.01.21.19.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:19:13 -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=HMbPzgFS; 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 1rgHjO-0002Nr-47; Sat, 02 Mar 2024 00:16:18 -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 1rgHjI-0002Ky-Oz for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:12 -0500 Received: from mail-oo1-xc2d.google.com ([2607:f8b0:4864:20::c2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjD-0007TY-Hv for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:12 -0500 Received: by mail-oo1-xc2d.google.com with SMTP id 006d021491bc7-5a11b231ec5so88016eaf.3 for ; Fri, 01 Mar 2024 21:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356566; x=1709961366; 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=yRnj6RNj8pIhlV8KrPPZGUlyyYXlw3LRarbXZSGYsp4=; b=HMbPzgFSIyGDcQMGjNljL1OAUP/ZoyXpHuCYIFGNKGhINQKg0mY+sChvJ5+wOGty38 8O+kQrNUe3PjPjqU0fM5syRHI05gcZuvnNNlaxvuwuGNRGrxIK9K/0rcak0JnKkfpUOe My2rOGlJQCK6ny0CYX7v5B8OZbZu2xZyVzJpYmfWtoBpKfHN2LwwMQO2Qud465M8qkgT cV5moJ5uYUswpaAuMNxT2B09Xvn6dXAAzL0eRV2XZt75dSM9HK09jE23ySBBy/uoRoNJ QCsYe7y6HZTIA/WTrJSMmmDNQypz92pxl2uHR2/GKnny0G+pMNRCgAsS5rmur/wS8tSQ aqcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356566; x=1709961366; 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=yRnj6RNj8pIhlV8KrPPZGUlyyYXlw3LRarbXZSGYsp4=; b=WgElo3L+E95obFtZj1fGcjEpd+SU4OinURYfUvNN09VynQ4eN3KbMHPwmpAE0GkUq8 o/PEs3LY9d96yCOD4mGPtn1QNLCmnzP5YZfA/eFLFcKjfKb0WdP4r/rSifwZc8hHVaxl kuX3Y8NbZQrP/K+O9toOkPADpyFMZxp93ztMm2BIMshC8eAfOi14SyNbV1F95DaKJEgG Lm4zHQh7upEL2D011ThIazlkf48e7u7OaULZ2mK033QfWKQCc1ni/N2N48//xTJcTZqk DPPMMPaL+/0gusebKk4EXxnVERRL0XkvL+hIwpWuJOUkxOjTpthNt4SodJE/L0jM1dpV 47xQ== X-Gm-Message-State: AOJu0YxHC4JhsONKDscfjxwuaeJV2nbN6V5WxjoyX/ZQrOUHFs2TpiXo JWDTsSHmdsUJyMS/1fYsGFObTRf74pWJd9pLb5CDKuc4HlvpxcOuRQsfDEofIq5msMc4rlgxne+ E X-Received: by 2002:a05:6808:1789:b0:3c1:b170:7e0a with SMTP id bg9-20020a056808178900b003c1b1707e0amr4634496oib.38.1709356566029; Fri, 01 Mar 2024 21:16:06 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 01/41] linux-user/sparc: Add more hwcap bits for sparc64 Date: Fri, 1 Mar 2024 19:15:21 -1000 Message-Id: <20240302051601.53649-2-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::c2d; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2d.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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 Supply HWCAP_SPARC_V8PLUS, HWCAP_SPARC_MUL32, HWCAP_SPARC_DIV32, HWCAP_SPARC_POPC, HWCAP_SPARC_FSMULD, HWCAP_SPARC_VIS, HWCAP_SPARC_VIS2. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 48 +++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index b8eef893d0..6041270f1c 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -963,24 +963,44 @@ const char *elf_hwcap2_str(uint32_t bit) #endif /* TARGET_ARM */ #ifdef TARGET_SPARC -#ifdef TARGET_SPARC64 -#define ELF_HWCAP (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | HWCAP_SPARC_SWAP \ - | HWCAP_SPARC_MULDIV | HWCAP_SPARC_V9) -#ifndef TARGET_ABI32 -#define elf_check_arch(x) ( (x) == EM_SPARCV9 || (x) == EM_SPARC32PLUS ) +#ifndef TARGET_SPARC64 +# define ELF_CLASS ELFCLASS32 +# define ELF_ARCH EM_SPARC +#elif defined(TARGET_ABI32) +# define ELF_CLASS ELFCLASS32 +# define elf_check_arch(x) ((x) == EM_SPARC32PLUS || (x) == EM_SPARC) #else -#define elf_check_arch(x) ( (x) == EM_SPARC32PLUS || (x) == EM_SPARC ) +# define ELF_CLASS ELFCLASS64 +# define ELF_ARCH EM_SPARCV9 #endif -#define ELF_CLASS ELFCLASS64 -#define ELF_ARCH EM_SPARCV9 -#else -#define ELF_HWCAP (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | HWCAP_SPARC_SWAP \ - | HWCAP_SPARC_MULDIV) -#define ELF_CLASS ELFCLASS32 -#define ELF_ARCH EM_SPARC -#endif /* TARGET_SPARC64 */ +#include "elf.h" + +#define ELF_HWCAP get_elf_hwcap() + +static uint32_t get_elf_hwcap(void) +{ + /* There are not many sparc32 hwcap bits -- we have all of them. */ + uint32_t r = HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | + HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV; + +#ifdef TARGET_SPARC64 + CPUSPARCState *env = cpu_env(thread_cpu); + uint32_t features = env->def.features; + + r |= HWCAP_SPARC_V9 | HWCAP_SPARC_V8PLUS; + /* 32x32 multiply and divide are efficient. */ + r |= HWCAP_SPARC_MUL32 | HWCAP_SPARC_DIV32; + /* We don't have an internal feature bit for this. */ + r |= HWCAP_SPARC_POPC; + r |= features & CPU_FEATURE_FSMULD ? HWCAP_SPARC_FSMULD : 0; + r |= features & CPU_FEATURE_VIS1 ? HWCAP_SPARC_VIS : 0; + r |= features & CPU_FEATURE_VIS2 ? HWCAP_SPARC_VIS2 : 0; +#endif + + return r; +} static inline void init_thread(struct target_pt_regs *regs, struct image_info *infop) From patchwork Sat Mar 2 05:15:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777482 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694561wrn; Fri, 1 Mar 2024 21:18:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV3sVzXvJ6lHecu5PH2PRoHOUe+mL4nFjpsrVHCRJL0yJpz4Dn0oJu/g+r/avl6ycL2owTHijykjCZAjE3QtnKC X-Google-Smtp-Source: AGHT+IGTR/8BsVoP7st9cyR1RvoihdzRSz03RhOsP4fw8s0krewaR2qxrBAzSz7Hzh9KaIgwQ4y0 X-Received: by 2002:a05:620a:45a6:b0:785:b247:e723 with SMTP id bp38-20020a05620a45a600b00785b247e723mr4665835qkb.40.1709356714916; Fri, 01 Mar 2024 21:18:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356714; cv=none; d=google.com; s=arc-20160816; b=jeqIVuJLJ5gBLHO3LWesqUVpDYGRJi1KkquWTX915xaQGjeRRaLyZqb5xT5V+3DjG7 C9S0t+GLupj13AOI2sB7XDnSADiqo14sijwklutn0GmgKRy3wcmguoP1O9bmujHdnHFu QFkQmV1bkm6rNkjTBa9HWcwUM1unu+YO4LXlf53ijXiHTNcfAcjpDm3c2xvy21/41lM0 Xc154ssONLc8YfvIZKbmB/hHamEbT7hyAgOq9ziq8zXmLUgwhAQy79JH29DXinLi9+bE MMsewCu7Hj+sljdq5xgOnJsqvXqdKxAvejeU4e7eGjGIMyk1X/oqiSXKjL4HkjB9BhcW uwuQ== 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=yuH2zSAfuVjEDd5KC+vHgGixxVmZT968m1jduIgoS7U=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=woVtmR9lPIRRILONFkxE/6SNxQyMWImKvgIi+Q20mYHxJb35tQsF6Buom0badLnelr xwiK0suFdapZrBHMmo+yVoBloNG5a0VA3cGiGjCMlfiWiXOramAuMWEan5pHBGuxaJwH QeXSXMSBe3Rdb8ePrtb96YwhZroqmxHTHFZxHr0FNt3WRqsQ3afMSvbedJXUwELXI1Eu 42lIR8bxBnVQ2GX32S+otMejAQqFZzw/Qwe/j5xCtjreGlAkJ2GoRJuZkLIOXCikXOaV eJWgCpGQ8m2aFGOZZQ8Si1E4nW5fq4zj6b7XgANg/01/7QIovva322odZKkQbFz1HaCM dqBg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gJpZw2xj; 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 j15-20020a05620a0a4f00b00785ec2292e3si5020532qka.465.2024.03.01.21.18.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:34 -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=gJpZw2xj; 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 1rgHjS-0002PA-KB; Sat, 02 Mar 2024 00:16:22 -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 1rgHjP-0002OY-Sf for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:19 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjF-0007Tf-Dv for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:19 -0500 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-5d4d15ec7c5so2468217a12.1 for ; Fri, 01 Mar 2024 21:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356568; x=1709961368; 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=yuH2zSAfuVjEDd5KC+vHgGixxVmZT968m1jduIgoS7U=; b=gJpZw2xjnhj9UY+zUCLa/oyYcwLaV5U8rTy+NwZBgERZfdlSMgolvi5ciFc62Ktfp0 qGXMKIofHS87fVTI4GT+PjrCbTgo9ruBKJtzxupmgwmHJLF9MpOrhooK0lJ0mHrFnhnU +n4xWJZ/+nKNop4jEOhK/Dmqckv0z+3oqUODK66/h2/L/4nQFWHO2r9Bk3uIcHA79Ixj qIl/KHa6xGzVOxRfpgRkk3KXnh1EZqByJPHMVoufWBZGHQTXUMVH2Wh/onv34NqLpSXv iiuMj2HhAM8DaumQpDaYYHSNAIErD7UQOkdoaQ2e1Ah6g3eHifQsUlJNckuJTs/Owl7u 9wkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356568; x=1709961368; 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=yuH2zSAfuVjEDd5KC+vHgGixxVmZT968m1jduIgoS7U=; b=bnhar1u3C/J/euj3BAYf7GmFhbvzaQE9POJ8XrxTIMmDpgqHM65SbPoUVXFwx/+7sx j1zlYr0ffnWJw+P/DWlpOR3754EnOS+p/2V6TIKZtBcnzKTzokhDImpP7dmWNJTq7BK5 yh+ScVG4H954HBB83v01h2fBsdIQnuesbkyoIXCbbFc37+s5a4GCyQYo26EwctoXwE9i rVCagqtIWDs/kCr9uDEXOZ/kNBABcedsZiPtKVn4IEZH5pT92wqyaHfWVIArWp1/vFMm kKU3au1OCQpdSjykMlCGWNOqeMySCnNTLuN9g8IoszcRY1Bo7y5sKAiQf9Hf/z6/Qa6m z+UA== X-Gm-Message-State: AOJu0Yx8T3dLe4vFjk7gsPkpon73QGKmvaEqKbMX5bSx9Y2/6xNHCC+K a0NtZEAZAEo3L8EkxAGfW+4aacp7oZXpgqZVVEiNFYDsXxoHpKle5WAjdnElommK2mqEsQLpUfK D X-Received: by 2002:a05:6a20:d818:b0:1a1:3d87:422d with SMTP id iv24-20020a056a20d81800b001a13d87422dmr3689365pzb.45.1709356567741; Fri, 01 Mar 2024 21:16:07 -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.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 02/41] target/sparc: Fix FEXPAND Date: Fri, 1 Mar 2024 19:15:22 -1000 Message-Id: <20240302051601.53649-3-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::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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 This is a 2-operand instruction, not 3-operand. Worse, we took the source from the wrong operand. Signed-off-by: Richard Henderson --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 20 +++++++++++++++++++- target/sparc/vis_helper.c | 6 +++--- target/sparc/insns.decode | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index e55fad5b8c..ef21ef49ef 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -99,7 +99,7 @@ DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmuld8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmuld8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fexpand, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_1(fexpand, TCG_CALL_NO_RWG_SE, i64, i32) DEF_HELPER_FLAGS_3(pdist, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) DEF_HELPER_FLAGS_2(fpack16, TCG_CALL_NO_RWG_SE, i32, i64, i64) DEF_HELPER_FLAGS_3(fpack32, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 692ce0b010..5016664869 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4314,6 +4314,25 @@ TRANS(FSQRTd, ALL, do_env_dd, a, gen_helper_fsqrtd) TRANS(FxTOd, 64, do_env_dd, a, gen_helper_fxtod) TRANS(FdTOx, 64, do_env_dd, a, gen_helper_fdtox) +static bool do_df(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv_i64, TCGv_i32)) +{ + TCGv_i64 dst; + TCGv_i32 src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst = tcg_temp_new_i64(); + src = gen_load_fpr_F(dc, a->rs); + func(dst, src); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FEXPAND, VIS1, do_df, a, gen_helper_fexpand) + static bool do_env_df(DisasContext *dc, arg_r_r *a, void (*func)(TCGv_i64, TCGv_env, TCGv_i32)) { @@ -4545,7 +4564,6 @@ TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ulx16) TRANS(FMULD8SUx16, VIS1, do_ddd, a, gen_helper_fmuld8sux16) TRANS(FMULD8ULx16, VIS1, do_ddd, a, gen_helper_fmuld8ulx16) TRANS(FPMERGE, VIS1, do_ddd, a, gen_helper_fpmerge) -TRANS(FEXPAND, VIS1, do_ddd, a, gen_helper_fexpand) TRANS(FPADD16, VIS1, do_ddd, a, tcg_gen_vec_add16_i64) TRANS(FPADD32, VIS1, do_ddd, a, tcg_gen_vec_add32_i64) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 7763b16c24..db2e6dd6c1 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -260,13 +260,13 @@ uint64_t helper_fmuld8ulx16(uint64_t src1, uint64_t src2) return d.ll; } -uint64_t helper_fexpand(uint64_t src1, uint64_t src2) +uint64_t helper_fexpand(uint32_t src2) { VIS32 s; VIS64 d; - s.l = (uint32_t)src1; - d.ll = src2; + s.l = src2; + d.ll = 0; d.VIS_W64(0) = s.VIS_B32(0) << 4; d.VIS_W64(1) = s.VIS_B32(1) << 4; d.VIS_W64(2) = s.VIS_B32(2) << 4; diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 2d26404cb2..e2d8a07dc4 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -352,7 +352,7 @@ FCMPEq 10 000 cc:2 110101 rs1:5 0 0101 0111 rs2:5 FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @r_r_r FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @r_r_r BSHUFFLE 10 ..... 110110 ..... 0 0100 1100 ..... @r_r_r - FEXPAND 10 ..... 110110 ..... 0 0100 1101 ..... @r_r_r + FEXPAND 10 ..... 110110 00000 0 0100 1101 ..... @r_r2 FSRCd 10 ..... 110110 ..... 0 0111 0100 00000 @r_r1 # FSRC1d FSRCs 10 ..... 110110 ..... 0 0111 0101 00000 @r_r1 # FSRC1s From patchwork Sat Mar 2 05:15:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777491 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694798wrn; Fri, 1 Mar 2024 21:19:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUwkzybr04Sd3O2klbGA/lZgFpaCFB55s4k9OMFt2id0U8zGLf8lIPxKbnLi4zkxJyYRpSsROI3sRcyQ2lMI/fp X-Google-Smtp-Source: AGHT+IH5sPp2ZwJTplYbSv5QnxIRqOem6CMBzFg0+Cz1j1AVaTZ/DlVBzNnzd2SZ/gS1eMqv4F9R X-Received: by 2002:a05:620a:12f0:b0:787:e43e:801a with SMTP id f16-20020a05620a12f000b00787e43e801amr4224930qkl.50.1709356776126; Fri, 01 Mar 2024 21:19:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356776; cv=none; d=google.com; s=arc-20160816; b=tPPRoJp1DOI5xzR+Zx2kMIJjYFrsUxDSuICIGUTZdu4CuudlBjlLgcB/DPM/qn2w1c zGsX/Us43eUG1bjtc/VDyJcI36VzZOs5yK8bnVS18oYvZLLrGQ49BqTqya847FQkJAPe kYoxvyz+1B6lUCcwqjlIibWRK+79KxGR3sHJx2plNdX9vSIPPMeup/IXvygLocDCk55K LCRc+G+xW+ejAI96wPmARm5nW1zYAHd4SJqWScAnS4vOFZX90+B1Vy7K2WyIqAarDlyu W3bmlSwZG6U4g+46MVq61SdMewXt1cL9u6dyh6r6aIr32PGi0ELSr7wyXu8eC+vZVmt3 5/Gg== 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=+NJ0CHRGS5ogMQU2PTHyrbDWsaPoNSmVFmZRaOgb2+Y=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=V1oVKsUF3WUFmQ3fQuOTr7MsHN0KouadmS6Rf8EIlQ1/FdJKlQ8D4WviOkjI0dXSEY nLF+8x89mfdxpt0GzfSmcPxYPP56kvUUHSmx13OmiJlGIBQMNxl0c+BtApHbHr82SRWi zJV7jmp6OK9dMW/emtMcCWsbYaFgbepVqRwICFVu0sMpIM8K0UujNyPeVGdWNira5Z8O xjYZ+25jPL1iDOALU4RlcgVYxEj3Fka7Q5nTeIdIJTtfjvhA0dhBtkEgEHeGnCPlxqH2 bSKZUnifOZ5NVL4XU8OLtbeJi/UDnHnqq07i4lV9OrnkNhSlVCiAd6dNJjyI8uwHevSD kojg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V9xswyMs; 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 x1-20020ae9e641000000b007881c3bb58esi200006qkl.540.2024.03.01.21.19.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:19:36 -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=V9xswyMs; 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 1rgHjN-0002Lj-62; Sat, 02 Mar 2024 00:16:17 -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 1rgHjJ-0002LN-Vo for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:14 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjG-0007To-QG for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:13 -0500 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5dca1efad59so2374975a12.2 for ; Fri, 01 Mar 2024 21:16:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356569; x=1709961369; 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=+NJ0CHRGS5ogMQU2PTHyrbDWsaPoNSmVFmZRaOgb2+Y=; b=V9xswyMsOFfHNF32r7HPqwItLARrbgY6A2MRqkQ9lK3hKTBzdbdPc6MGyRcJOmr6Pf BNxQR+UQ0G95ys5j2ObMPuD+GpRunnKOL8/co/0nx8uMkVYTsqqaW/2Co5FXrQVT2Ggc 70CWowIHbkqyADrLf1B0sqezJvelxpqBwHTBziAhNAuNNLgDkVOJpfEM53hDT9BOOchG o061YnuEqDGqZQJhthHQLR1A5+AneI3lHO68SxGcfrOJq30aXtLAlUpDIohtGS3D1eUl l9IlJaYm8/WR2s2lhIn2eLkUYTy2NAFcDjnSXsIZAQVv9zOQzKzWsT1a7/VVxnBCajCY gt7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356569; x=1709961369; 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=+NJ0CHRGS5ogMQU2PTHyrbDWsaPoNSmVFmZRaOgb2+Y=; b=THiGHtNM/EIh3/DnmoZWRf0yRjx9KUe9KRlW3O2MC9RUeXqbaXiW7fAJ8VDjGFYocf epxSG4uzi8n/6QeGyDFarM0uUxZ85yL95+qhj5Ejsr1RC/dfe6ABJgYl8LhUq8UEgEfQ 2a3SJSK+tlu4ZsmRn92V1LvfjoT/Z1lI4ADMCSxQ6ag+n9BBCeBWvaIgN2fvgv48xcxg MpiSEoKzaAXnngUnu5LdNqOxdV/6Zu7ttAIVXKHWmSetTP1PPzj/c7EEN7U8DR9xz8tl gMIC9nYS6R9wbNtBGZ8yNawF7talWikunMbBZ8xO0nvmKqZHSkPWke0fNlANaP2zIdEO C8aA== X-Gm-Message-State: AOJu0YxPv1qSLoo1+Qoa2oBR9XZPNMekuWJEEglw1fy/Q9Zuev0hc19t RwaOdIFsyO46lSva2xqprgZulhQbrXxnQQ3H8RiFIW8zyFVBLkKHBFhnuzS6SO8Iz9XyAGG23zJ b X-Received: by 2002:a05:6a20:3d01:b0:1a1:14f2:4b70 with SMTP id y1-20020a056a203d0100b001a114f24b70mr4318154pzi.22.1709356569473; Fri, 01 Mar 2024 21:16:09 -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.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 03/41] target/sparc: Fix FMUL8x16 Date: Fri, 1 Mar 2024 19:15:23 -1000 Message-Id: <20240302051601.53649-4-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::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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 This instruction has f32 as source1, which alters the decoding of the register number, which means we've been passing the wrong data for odd register numbers. Signed-off-by: Richard Henderson --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 21 ++++++++++++++++++++- target/sparc/vis_helper.c | 9 +++++---- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index ef21ef49ef..adc1b87319 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -92,7 +92,7 @@ DEF_HELPER_FLAGS_2(fdtox, TCG_CALL_NO_WG, s64, env, f64) DEF_HELPER_FLAGS_2(fqtox, TCG_CALL_NO_WG, s64, env, i128) DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i32, i64) DEF_HELPER_FLAGS_2(fmul8x16al, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8x16au, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 5016664869..5144fe4ed9 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4539,6 +4539,26 @@ TRANS(FSUBs, ALL, do_env_fff, a, gen_helper_fsubs) TRANS(FMULs, ALL, do_env_fff, a, gen_helper_fmuls) TRANS(FDIVs, ALL, do_env_fff, a, gen_helper_fdivs) +static bool do_dfd(DisasContext *dc, arg_r_r_r *a, + void (*func)(TCGv_i64, TCGv_i32, TCGv_i64)) +{ + TCGv_i64 dst, src2; + TCGv_i32 src1; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst = gen_dest_fpr_D(dc, a->rd); + src1 = gen_load_fpr_F(dc, a->rs1); + src2 = gen_load_fpr_D(dc, a->rs2); + func(dst, src1, src2); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FMUL8x16, VIS1, do_dfd, a, gen_helper_fmul8x16) + static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -4556,7 +4576,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, return advance_pc(dc); } -TRANS(FMUL8x16, VIS1, do_ddd, a, gen_helper_fmul8x16) TRANS(FMUL8x16AU, VIS1, do_ddd, a, gen_helper_fmul8x16au) TRANS(FMUL8x16AL, VIS1, do_ddd, a, gen_helper_fmul8x16al) TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index db2e6dd6c1..7728ffe9c6 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -94,16 +94,17 @@ uint64_t helper_fpmerge(uint64_t src1, uint64_t src2) return d.ll; } -uint64_t helper_fmul8x16(uint64_t src1, uint64_t src2) +uint64_t helper_fmul8x16(uint32_t src1, uint64_t src2) { - VIS64 s, d; + VIS64 d; + VIS32 s; uint32_t tmp; - s.ll = src1; + s.l = src1; d.ll = src2; #define PMUL(r) \ - tmp = (int32_t)d.VIS_SW64(r) * (int32_t)s.VIS_B64(r); \ + tmp = (int32_t)d.VIS_SW64(r) * (int32_t)s.VIS_B32(r); \ if ((tmp & 0xff) > 0x7f) { \ tmp += 0x100; \ } \ From patchwork Sat Mar 2 05:15:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777481 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694546wrn; Fri, 1 Mar 2024 21:18:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWWO0Z1Zy8YMh/Qs5HHhrAtpWHupKmBM/abxAkg+5PHLcJ0bmI2jw1CuQAtxdFwHEm6Cb9LQ4jERKfGbq2VJKV4 X-Google-Smtp-Source: AGHT+IFxQ5sA8xK3SjcQUaQYJPyyDbcjcDz+QB/rTHqFgv5osMnCc7UcTdBOM2FNcxA4MiD6UGIx X-Received: by 2002:a05:622a:288:b0:42e:b4b6:cbe6 with SMTP id z8-20020a05622a028800b0042eb4b6cbe6mr3651161qtw.67.1709356712024; Fri, 01 Mar 2024 21:18:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356712; cv=none; d=google.com; s=arc-20160816; b=h5WxLknThXY/qqo0gASF0r/PO7elqcYtx2uEKexOTlK9Bnc6ARPMd59FScnHKGpZaZ lS8y4v7WJcENyIQ+mJNcNYGKV8kthveBZZCSvWyC8RPYavVln43mnuuYqfXxhLjSwLui gyQMnsrSzoPX30ncQsyCr3k7egXReLUfX+fKHU4qm98SdyyCYNYhBhGkuPhddVHNB4Nr UKlXBoBSYn3zw+HE3SUAnjJAhB98JPzX/3Y/LxWiZhqg3zKpk46sw23PWYTj0s54OkDP 2KlZ5BNnj05woCYnqmWqMD9Ny4Ns0m5bcm0NeNMAK1GHVrZFV/Obu/rBuI/zEtoNH6OA VTSQ== 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=WAjdnf4F1BQaB8ZETOaZXvMHqeLzkYIxxnKbKFG5YO0=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=G1e6wU08yflY24yfYcbKjX5Nn8zNGxCL35gcX3FKYKWI6OIJtxVRL5KJsLZbXtmvwX Hsfh0lYjbHIujAtNvmN/cvYffmI0sWs33UHKo0eMADFhMrsiyUk1U2ajPiaPPVW9XCp9 OU6QF5GZgi5+y/Oh0i2fneNJ70VE5M2tBS/pdnVx84HTQ66dZHAX/+0nXCsBuvepmkiQ d1xxZgecOGW3uuqYGd+OtMKfl3rh2xz/2W3T0SDyp3gHHhL02DvaDuna3imomiZMz0ep vR2jp2XvqJcc0RYSfPcwvL4p4/ARt6zd7zQncdvTMjw9yGRT2PIYPS4VKAGxEzejunRh BoFg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v0UNDtWZ; 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 n3-20020ac85a03000000b0042edf85a6easi476qta.160.2024.03.01.21.18.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:32 -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=v0UNDtWZ; 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 1rgHjO-0002OD-N1; Sat, 02 Mar 2024 00:16:18 -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 1rgHjN-0002Lf-2c for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:17 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjI-0007Ts-Qb for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:15 -0500 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-5e152c757a5so1987938a12.2 for ; Fri, 01 Mar 2024 21:16:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356571; x=1709961371; 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=WAjdnf4F1BQaB8ZETOaZXvMHqeLzkYIxxnKbKFG5YO0=; b=v0UNDtWZxKg/5cUFwnQKcTy67Elbhdm7epfeefPAoJsg9m97ESgh7m6XfIXTwtUS2t pOtHptszSmGESjXBGxdm1R8wUAT/EZEJ/IZF0Qbb3tMJCewBgdbm01inOIIOvZQ8/3R+ rOneEw+BPldvOxKfrfRGBL8SPI6Qzd3+9ziaem541CjOTl6F7XE6Iu8Rp2LVqBzGgqaB nGZ3BIFrXQcnBI0EWvQmDyOiQyBgmvD7PVLMZFnf/XdNFCiEVwwv6zOetXAvK8/0biz7 fM+M2sZA5E9IGVG8wxvzoxew5/+XAwTDiN3hec6bMQgL9EVA2Fbzm8s7SVll1WsXlnBe ZvHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356571; x=1709961371; 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=WAjdnf4F1BQaB8ZETOaZXvMHqeLzkYIxxnKbKFG5YO0=; b=wWRqqstp+C9pc9pDHXG4I/ZABWbE1F+2UmMMEZlMwTOoYvbaf0eEz7PfYRX47xAGpR CQxC5jfgvqhzQSKSSxLK/rHtCf+1H4NROoRi5BdIALv/ZWo/J7dAJEpOu2rNN+fFPj85 URnCeawgzeegVfQBWjb15CLIyhVjiIZRZM5+QyHAMxpRSIRHZcgF7g4Nn/zPklt4bETu /0Hnxse/9V/dJK907htM3VCtI3u4ZqqRBhVfhzrQ16FrbqUE+NeQQmXAnKM4pPeOPHRq kK9L2cvmCp5u9N0nnzG6DnRL5bSOtqz8iYiUW8FckZZEQXTM+7tg96Kq8lVSHoQOCgy5 ijPQ== X-Gm-Message-State: AOJu0YzWI4x3NYX5sESZo6H+Oro7d8sQeeWTSKsR/okxV/DH4JeV+OL3 WIG1OczsLtsF4JrLLoHssZl66b67a5xzIBO0YJdIWddnpRKgc3oVwSY/FoRof513Vnjm7BinQo3 5 X-Received: by 2002:a17:90b:b04:b0:29a:c89a:bcdb with SMTP id bf4-20020a17090b0b0400b0029ac89abcdbmr2868816pjb.46.1709356571446; Fri, 01 Mar 2024 21:16:11 -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.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 04/41] target/sparc: Fix FMUL8x16A{U,L} Date: Fri, 1 Mar 2024 19:15:24 -1000 Message-Id: <20240302051601.53649-5-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::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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 These instructions have f32 inputs, which changes the decode of the register numbers. While we're fixing things, use a common helper for both insns, extracting the 16-bit scalar in tcg beforehand. Signed-off-by: Richard Henderson --- target/sparc/helper.h | 3 +-- target/sparc/translate.c | 38 ++++++++++++++++++++++++++++++---- target/sparc/vis_helper.c | 43 +++++++++------------------------------ 3 files changed, 45 insertions(+), 39 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index adc1b87319..9e0b8b463e 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -93,8 +93,7 @@ DEF_HELPER_FLAGS_2(fqtox, TCG_CALL_NO_WG, s64, env, i128) DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i32, i64) -DEF_HELPER_FLAGS_2(fmul8x16al, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fmul8x16au, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fmul8x16a, TCG_CALL_NO_RWG_SE, i64, i32, s32) DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmuld8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 5144fe4ed9..598cfcf0ac 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -45,6 +45,7 @@ # define gen_helper_clear_softint(E, S) qemu_build_not_reached() # define gen_helper_done(E) qemu_build_not_reached() # define gen_helper_flushw(E) qemu_build_not_reached() +# define gen_helper_fmul8x16a(D, S1, S2) qemu_build_not_reached() # define gen_helper_rdccr(D, E) qemu_build_not_reached() # define gen_helper_rdcwp(D, E) qemu_build_not_reached() # define gen_helper_restored(E) qemu_build_not_reached() @@ -72,8 +73,6 @@ # define gen_helper_fexpand ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmul8sux16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmul8ulx16 ({ qemu_build_not_reached(); NULL; }) -# define gen_helper_fmul8x16al ({ qemu_build_not_reached(); NULL; }) -# define gen_helper_fmul8x16au ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmul8x16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmuld8sux16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmuld8ulx16 ({ qemu_build_not_reached(); NULL; }) @@ -719,6 +718,18 @@ static void gen_op_bshuffle(TCGv_i64 dst, TCGv_i64 src1, TCGv_i64 src2) #endif } +static void gen_op_fmul8x16al(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) +{ + tcg_gen_ext16s_i32(src2, src2); + gen_helper_fmul8x16a(dst, src1, src2); +} + +static void gen_op_fmul8x16au(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) +{ + tcg_gen_sari_i32(src2, src2, 16); + gen_helper_fmul8x16a(dst, src1, src2); +} + static void finishing_insn(DisasContext *dc) { /* @@ -4539,6 +4550,27 @@ TRANS(FSUBs, ALL, do_env_fff, a, gen_helper_fsubs) TRANS(FMULs, ALL, do_env_fff, a, gen_helper_fmuls) TRANS(FDIVs, ALL, do_env_fff, a, gen_helper_fdivs) +static bool do_dff(DisasContext *dc, arg_r_r_r *a, + void (*func)(TCGv_i64, TCGv_i32, TCGv_i32)) +{ + TCGv_i64 dst; + TCGv_i32 src1, src2; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst = gen_dest_fpr_D(dc, a->rd); + src1 = gen_load_fpr_F(dc, a->rs1); + src2 = gen_load_fpr_F(dc, a->rs2); + func(dst, src1, src2); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FMUL8x16AU, VIS1, do_dff, a, gen_op_fmul8x16au) +TRANS(FMUL8x16AL, VIS1, do_dff, a, gen_op_fmul8x16al) + static bool do_dfd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i32, TCGv_i64)) { @@ -4576,8 +4608,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, return advance_pc(dc); } -TRANS(FMUL8x16AU, VIS1, do_ddd, a, gen_helper_fmul8x16au) -TRANS(FMUL8x16AL, VIS1, do_ddd, a, gen_helper_fmul8x16al) TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ulx16) TRANS(FMULD8SUx16, VIS1, do_ddd, a, gen_helper_fmuld8sux16) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 7728ffe9c6..5c7f5536bc 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -119,43 +119,20 @@ uint64_t helper_fmul8x16(uint32_t src1, uint64_t src2) return d.ll; } -uint64_t helper_fmul8x16al(uint64_t src1, uint64_t src2) +uint64_t helper_fmul8x16a(uint32_t src1, int32_t src2) { - VIS64 s, d; + VIS32 s; + VIS64 d; uint32_t tmp; - s.ll = src1; - d.ll = src2; + s.l = src1; + d.ll = 0; -#define PMUL(r) \ - tmp = (int32_t)d.VIS_SW64(1) * (int32_t)s.VIS_B64(r); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp += 0x100; \ - } \ - d.VIS_W64(r) = tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL - - return d.ll; -} - -uint64_t helper_fmul8x16au(uint64_t src1, uint64_t src2) -{ - VIS64 s, d; - uint32_t tmp; - - s.ll = src1; - d.ll = src2; - -#define PMUL(r) \ - tmp = (int32_t)d.VIS_SW64(0) * (int32_t)s.VIS_B64(r); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp += 0x100; \ - } \ +#define PMUL(r) \ + tmp = src2 * (int32_t)s.VIS_B64(r); \ + if ((tmp & 0xff) > 0x7f) { \ + tmp += 0x100; \ + } \ d.VIS_W64(r) = tmp >> 8; PMUL(0); From patchwork Sat Mar 2 05:15:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777473 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694423wrn; Fri, 1 Mar 2024 21:18:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXtxNjJTTerKySOgKB1R7sipQd2kN4Yl+KZflImUDXYqjEY4DImXPlL3jcGH5vjkwt+XSyXUNz0YfbN1xoIT/1j X-Google-Smtp-Source: AGHT+IGSQt7D8YGNhpJPa+dO8hEBWup74nfKR+XeNkoORmwXDPcjTtvdFHk/Qu/mLsIE/AHqej2N X-Received: by 2002:a05:620a:1721:b0:787:a64a:b05a with SMTP id az33-20020a05620a172100b00787a64ab05amr4646059qkb.6.1709356686246; Fri, 01 Mar 2024 21:18:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356686; cv=none; d=google.com; s=arc-20160816; b=y////8IpzyLooBofZwvA5K89WKNYt3zOj5250IMzxYZKl1o3Zfb6eILkqYJ0nBpN8b 9HILgNdgTcodA8nkBQLadFPWIc3Ck3/bqQ1IdQPWyqNEk9AsAuCf/s58h/hqEVBA5Oem meZfUXSDx+kt1+bOX1l6suFiYpGBXdH8QBGyBFutjjGJQBv/4dMRC+3Hx2oi9RAsyBH0 P6+QYSf9piw2dxWEVcWIvLjQ8WiOVX66LGHbkSkAJ8H7ATZ8MtHEdOGFuXJWVNyJV3M6 gHJnvhBIjhJHg5kcOW3b04dujyUhOCL9MpwwjwqBzQDSJBw6SAn+uejOvZnqgeVIRZ9O EW2A== 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=nn5GDQ2edJRZsgPi611vkmSc2f1OhhpZtbh88+pU1qY=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=JmmCck8weReHPW1Twmb5+JxDF+cJhwn6ynnSOAd3Qo1XUPOoVG49NyY2EaisC96Qr4 3zRIo08Kuyo3XTtp/WpHOIEjpx9V8XSvw+QVr5FkED1xax9kne37UDspzmEnntPxMXvo oCnLgoXevpe3CVB6w8K2HlfZLxijm0oegoSx9CA0oP22uXcAJuz13xalXyZg2aQGwJxq PMV5GPgBYJ3QccnJyyVvygvuyNHSquln69dgpkfBR91svERsgwnmp60khLnb79LESY4U NhbeKRYYsjn+RjOaZEP8M1JFT6TcOJT4VqkGpIIKDD7rF+EfrYtOh65TB7r7jg5QtNbj TnLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SCdTC3XQ; 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 z14-20020a05620a100e00b00787f098c733si4861217qkj.584.2024.03.01.21.18.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:06 -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=SCdTC3XQ; 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 1rgHjR-0002P7-Kd; Sat, 02 Mar 2024 00:16:21 -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 1rgHjN-0002Lh-33 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:17 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjK-0007UM-Gq for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:16 -0500 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6e58a984ea1so2075844b3a.2 for ; Fri, 01 Mar 2024 21:16:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356573; x=1709961373; 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=nn5GDQ2edJRZsgPi611vkmSc2f1OhhpZtbh88+pU1qY=; b=SCdTC3XQBiG9/tCT8Hpcv2/kPyMptaY3gd/f2eUXTFZHXmdKfaQoaxDrjuiA/tDqhv gaQ0MVmVg25rDdSI4tyqrcEljLuHAE0zTG51UiVFVap3yIJaLX7muRYcStjM6CPzSIE8 vPIFYoucYoDC8s1127wnQY549f0dZtgfjnqGnArOhD0S7ZRYdW3DScKgb7O6XjW7TZKy SpcwwdRFigGMXAP+jQSwKsKnxdtPfntGWBfvktTUHo9bQ9SdeqHPup31iY6lFfijfN9W kMSu6P5+ffvoTeolUHNbw0Bl6B2K2iv4f0w+brH6ZQMHIxaN+th6DX7lrTkNbiEFoua0 Eeqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356573; x=1709961373; 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=nn5GDQ2edJRZsgPi611vkmSc2f1OhhpZtbh88+pU1qY=; b=MgR/PGkHCvh3zzWArmH2cJ3lM4r17F4XA/T+w5rtxHz0uS7Z5e2TRSbY4IsOh8xWiT 9aTp3mCzCp4ATAABNH6ye+BLTFfd823SHEozl4Pex0SwhTtjxNQSZGqqxRMeU4suo6nd w5TMvd8thzqwoVddIRO2XzPdMFBgXoxUxG0/rkUXt8wew9CmMa+nsswJLqQr4BWsYcdX dYJBUBIyblKmFEjKBHGwXjfMpi58fE38WKxWDv8E2F98tyoXQPv4X1QXsrnXVqxhNd0k UxN3CpZJhrSZj3kaN5x3xkBYFUnExM6gWCwmV5459/wHYrx75DkyHhsqXnNEcZ3kjyBo gfxQ== X-Gm-Message-State: AOJu0YznZlpcElgnlxbHM2mTpcsp0De/ccygsxfNZI0qXUly8F6I5GQi rCJFin2gAivJEmi9aYVXoGsdwCVuJaXIeHO898OZn2b185Ks/xaDuKEhQHNQ1hI6yKBeZKQQ/Vi n X-Received: by 2002:a05:6a21:78a7:b0:1a1:3fd9:e531 with SMTP id bf39-20020a056a2178a700b001a13fd9e531mr2659872pzc.4.1709356573277; Fri, 01 Mar 2024 21:16:13 -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.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 05/41] target/sparc: Fix FMULD8*X16 Date: Fri, 1 Mar 2024 19:15:25 -1000 Message-Id: <20240302051601.53649-6-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::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 Not only do these instructions have f32 inputs, they also do not perform rounding. Since these are relatively simple, implement them properly inline. Signed-off-by: Richard Henderson --- target/sparc/helper.h | 2 -- target/sparc/translate.c | 48 +++++++++++++++++++++++++++++++++++---- target/sparc/vis_helper.c | 46 ------------------------------------- 3 files changed, 44 insertions(+), 52 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 9e0b8b463e..39ea8f9baf 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -96,8 +96,6 @@ DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i32, i64) DEF_HELPER_FLAGS_2(fmul8x16a, TCG_CALL_NO_RWG_SE, i64, i32, s32) DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmul8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fmuld8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) -DEF_HELPER_FLAGS_2(fmuld8ulx16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_1(fexpand, TCG_CALL_NO_RWG_SE, i64, i32) DEF_HELPER_FLAGS_3(pdist, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) DEF_HELPER_FLAGS_2(fpack16, TCG_CALL_NO_RWG_SE, i32, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 598cfcf0ac..edb97bc64e 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -74,8 +74,6 @@ # define gen_helper_fmul8sux16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmul8ulx16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmul8x16 ({ qemu_build_not_reached(); NULL; }) -# define gen_helper_fmuld8sux16 ({ qemu_build_not_reached(); NULL; }) -# define gen_helper_fmuld8ulx16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fpmerge ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fqtox ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fstox ({ qemu_build_not_reached(); NULL; }) @@ -730,6 +728,48 @@ static void gen_op_fmul8x16au(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) gen_helper_fmul8x16a(dst, src1, src2); } +static void gen_op_fmuld8ulx16(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) +{ + TCGv_i32 t0 = tcg_temp_new_i32(); + TCGv_i32 t1 = tcg_temp_new_i32(); + TCGv_i32 t2 = tcg_temp_new_i32(); + + tcg_gen_ext8u_i32(t0, src1); + tcg_gen_ext16s_i32(t1, src2); + tcg_gen_mul_i32(t0, t0, t1); + + tcg_gen_extract_i32(t1, src1, 16, 8); + tcg_gen_sextract_i32(t2, src2, 16, 16); + tcg_gen_mul_i32(t1, t1, t2); + + tcg_gen_concat_i32_i64(dst, t0, t1); +} + +static void gen_op_fmuld8sux16(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) +{ + TCGv_i32 t0 = tcg_temp_new_i32(); + TCGv_i32 t1 = tcg_temp_new_i32(); + TCGv_i32 t2 = tcg_temp_new_i32(); + + /* + * The insn description talks about extracting the upper 8 bits + * of the signed 16-bit input rs1, performing the multiply, then + * shifting left by 8 bits. Instead, zap the lower 8 bits of + * the rs1 input, which avoids the need for two shifts. + */ + tcg_gen_ext16s_i32(t0, src1); + tcg_gen_andi_i32(t0, t0, ~0xff); + tcg_gen_ext16s_i32(t1, src2); + tcg_gen_mul_i32(t0, t0, t1); + + tcg_gen_sextract_i32(t1, src1, 16, 16); + tcg_gen_andi_i32(t1, t1, ~0xff); + tcg_gen_sextract_i32(t2, src2, 16, 16); + tcg_gen_mul_i32(t1, t1, t2); + + tcg_gen_concat_i32_i64(dst, t0, t1); +} + static void finishing_insn(DisasContext *dc) { /* @@ -4570,6 +4610,8 @@ static bool do_dff(DisasContext *dc, arg_r_r_r *a, TRANS(FMUL8x16AU, VIS1, do_dff, a, gen_op_fmul8x16au) TRANS(FMUL8x16AL, VIS1, do_dff, a, gen_op_fmul8x16al) +TRANS(FMULD8SUx16, VIS1, do_dff, a, gen_op_fmuld8sux16) +TRANS(FMULD8ULx16, VIS1, do_dff, a, gen_op_fmuld8ulx16) static bool do_dfd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i32, TCGv_i64)) @@ -4610,8 +4652,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ulx16) -TRANS(FMULD8SUx16, VIS1, do_ddd, a, gen_helper_fmuld8sux16) -TRANS(FMULD8ULx16, VIS1, do_ddd, a, gen_helper_fmuld8ulx16) TRANS(FPMERGE, VIS1, do_ddd, a, gen_helper_fpmerge) TRANS(FPADD16, VIS1, do_ddd, a, tcg_gen_vec_add16_i64) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 5c7f5536bc..eb1c4e47e9 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -192,52 +192,6 @@ uint64_t helper_fmul8ulx16(uint64_t src1, uint64_t src2) return d.ll; } -uint64_t helper_fmuld8sux16(uint64_t src1, uint64_t src2) -{ - VIS64 s, d; - uint32_t tmp; - - s.ll = src1; - d.ll = src2; - -#define PMUL(r) \ - tmp = (int32_t)d.VIS_SW64(r) * ((int32_t)s.VIS_SW64(r) >> 8); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp += 0x100; \ - } \ - d.VIS_L64(r) = tmp; - - /* Reverse calculation order to handle overlap */ - PMUL(1); - PMUL(0); -#undef PMUL - - return d.ll; -} - -uint64_t helper_fmuld8ulx16(uint64_t src1, uint64_t src2) -{ - VIS64 s, d; - uint32_t tmp; - - s.ll = src1; - d.ll = src2; - -#define PMUL(r) \ - tmp = (int32_t)d.VIS_SW64(r) * ((uint32_t)s.VIS_B64(r * 2)); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp += 0x100; \ - } \ - d.VIS_L64(r) = tmp; - - /* Reverse calculation order to handle overlap */ - PMUL(1); - PMUL(0); -#undef PMUL - - return d.ll; -} - uint64_t helper_fexpand(uint32_t src2) { VIS32 s; From patchwork Sat Mar 2 05:15:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777474 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694449wrn; Fri, 1 Mar 2024 21:18:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXoXB+E3jOuOb/8RKf4tCA+OsBLpCYAbICZNI2AnneCNdtiYUe1g/x5R+5xsdy5VjXB3X22bcr4qk56j+qK3af4 X-Google-Smtp-Source: AGHT+IGj3oZ6he845iivlTaC5WvMB8dlnK9QctojXSPJzxlk3sG/2iOTLfirSbn2u9zkAj4wFGsI X-Received: by 2002:a05:622a:44c:b0:42e:ce05:b7b4 with SMTP id o12-20020a05622a044c00b0042ece05b7b4mr3859643qtx.52.1709356689653; Fri, 01 Mar 2024 21:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356689; cv=none; d=google.com; s=arc-20160816; b=THTcR1VF1VdAKXOO0juuKQEhlImcqDj4FHjA4ZeUD3qeGQz2UZGLTQ5Q5A5vi42NzM 1sg2e0N+cU6Uh25GgIKWlVf+mI12nt3VJtVfWVKsQinz1vwFfI3mR+mPAGBncYxf8ICF 1qcY+/amhXfFe8a0TNBAXFryoGUSAUXv627ls2bH/SbViuB2VZjacqY9VZm5aKxUyYN2 9QnhEfKgo1KaJGSsogLsMuEzuXJxRb8oj6X4AVF7RHUXPv3/kVJUZTXS8IPJ5nkzESgP jJTp3JV++8YRe3SwvE+d2zAuMD+P+55QTaAm94YSVG0/4vkYmRErNgFL2hbDE2c+QGHC Id2A== 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=0lmJvt9dO3jDpvQGB6rhOn+2wNUhURlD+0eWhHde1MI=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=woeLwe6nN/Hpt2VcTptDRrr7p5cMnEDFGTpTfbB84MGFP0wCAVO8kVlqyo7DHuRbzD BNMGvZGZlevSYeAwhQeDAu1hQmt6DAcxYonnSNTByu0gdWt4SeshuUtdcyeFlbQm8F87 CdzbPEIRQgoRf2/uWVSJM079OYv/L8OjbbsmXnosIEFIlN+3jijhPIIHX445qi2sq/JT VTztKsEGj2mc5yYri39v+mlMklnHI9UxpOuNQnvS4Ud3gdVNFf7LJHSYbGueiJRnwtV3 PAwriE318NPXtUslV/NczjYrNci2fMnJj8MFiNfMTiezGVeSNzslPdv0Jn4RxwkeojYk u8bQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qd1+YYvI; 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 h2-20020a05620a244200b00787bf3f0b34si5278439qkn.553.2024.03.01.21.18.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:09 -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=Qd1+YYvI; 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 1rgHjP-0002OZ-UE; Sat, 02 Mar 2024 00:16:19 -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 1rgHjO-0002O8-GG for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:18 -0500 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjM-0007UX-QT for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:18 -0500 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3bd4e6a7cb0so1853687b6e.3 for ; Fri, 01 Mar 2024 21:16:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356575; x=1709961375; 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=0lmJvt9dO3jDpvQGB6rhOn+2wNUhURlD+0eWhHde1MI=; b=Qd1+YYvIFc2yee9eyIRwezPM5W3NGl+H/ZEUtGaaomLEv2nHr196d2XeLeV4FW5fyq DTgSszD+1OmdgxdkljRWuAyVvm/FkTurJOIQgq2+DC04arEUaZtpkxjZD1zrem3oMW5m +eoLqjh/9phbUV/3lq4MTKkBIyuw8dCRAEEzX/Eo4ET1vqIVueFwVs+V2OMeEFvqMst3 9kBxvk95iWZOaKUpteRoLVTnzLbbt1RF7X4ysuipLb/0gqhYAJ6K9qR9T4VOE3zOOGKE Xzabm/EFFp6bSjjFwWt9ZXeYVShkM69jQJJ6VgIaGMbl6ai/94EiYL3XpUjlalq8f5gI SkDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356575; x=1709961375; 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=0lmJvt9dO3jDpvQGB6rhOn+2wNUhURlD+0eWhHde1MI=; b=qKLVXydmDWih6xYf6+xENQ/CQC0yi26PBSA4y/rS+DPTg7wIFYXOu6kbS3cLKpYwLM qL0lGv+cUvNkNio86BI3F9HfXpOzF4kceuAyj982lHyZf/HpBwcbH7BZX9nHzTJVH5QJ 4NIPftYZ7xaRWoftNwxaJTl1ulfvRkLIbAoXosI+jheGeC+vzdaid/IDKsP2RkZQ4l4q CPJ5EgMb1kCRgJC4QgIPmn9Oc9757XPyjbVxinXtjbCcC1VlL2jEmfkmv6iitGMQQ09Q 87ZmFbTYQEIHoNBzPMeuKmI7RzJKMTUP3xaUSfIfdxCUFqCfGX5ZaA38sRBkUpp5qih7 dDuQ== X-Gm-Message-State: AOJu0YxZT3U1kuNlTYOuStpgF2QRN+/jCQoa5+41+5Re1RulBRyvPpe/ UDD8zGZ2VNBb++yzURYKpVnMx7AlYLP0c1ye5mu0C/9TAhH5z50YTpxCbRIgJIkQrlqlh8bXWT1 s X-Received: by 2002:a05:6808:1302:b0:3c1:b01e:2983 with SMTP id y2-20020a056808130200b003c1b01e2983mr4389674oiv.46.1709356575346; Fri, 01 Mar 2024 21:16:15 -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.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 06/41] target/sparc: Fix FPMERGE Date: Fri, 1 Mar 2024 19:15:26 -1000 Message-Id: <20240302051601.53649-7-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::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 This instruction has f32 inputs, which changes the decode of the register numbers. Signed-off-by: Richard Henderson --- target/sparc/helper.h | 2 +- target/sparc/translate.c | 2 +- target/sparc/vis_helper.c | 27 ++++++++++++++------------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 39ea8f9baf..f0576fb748 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -91,7 +91,7 @@ DEF_HELPER_FLAGS_2(fstox, TCG_CALL_NO_WG, s64, env, f32) DEF_HELPER_FLAGS_2(fdtox, TCG_CALL_NO_WG, s64, env, f64) DEF_HELPER_FLAGS_2(fqtox, TCG_CALL_NO_WG, s64, env, i128) -DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fpmerge, TCG_CALL_NO_RWG_SE, i64, i32, i32) DEF_HELPER_FLAGS_2(fmul8x16, TCG_CALL_NO_RWG_SE, i64, i32, i64) DEF_HELPER_FLAGS_2(fmul8x16a, TCG_CALL_NO_RWG_SE, i64, i32, s32) DEF_HELPER_FLAGS_2(fmul8sux16, TCG_CALL_NO_RWG_SE, i64, i64, i64) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index edb97bc64e..6a6c259b06 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4612,6 +4612,7 @@ TRANS(FMUL8x16AU, VIS1, do_dff, a, gen_op_fmul8x16au) TRANS(FMUL8x16AL, VIS1, do_dff, a, gen_op_fmul8x16al) TRANS(FMULD8SUx16, VIS1, do_dff, a, gen_op_fmuld8sux16) TRANS(FMULD8ULx16, VIS1, do_dff, a, gen_op_fmuld8ulx16) +TRANS(FPMERGE, VIS1, do_dff, a, gen_helper_fpmerge) static bool do_dfd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i32, TCGv_i64)) @@ -4652,7 +4653,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ulx16) -TRANS(FPMERGE, VIS1, do_ddd, a, gen_helper_fpmerge) TRANS(FPADD16, VIS1, do_ddd, a, tcg_gen_vec_add16_i64) TRANS(FPADD32, VIS1, do_ddd, a, tcg_gen_vec_add32_i64) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index eb1c4e47e9..89eea05ddb 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -74,22 +74,23 @@ typedef union { float32 f; } VIS32; -uint64_t helper_fpmerge(uint64_t src1, uint64_t src2) +uint64_t helper_fpmerge(uint32_t src1, uint32_t src2) { - VIS64 s, d; + VIS32 s1, s2; + VIS64 d; - s.ll = src1; - d.ll = src2; + s1.l = src1; + s2.l = src2; + d.ll = 0; - /* Reverse calculation order to handle overlap */ - d.VIS_B64(7) = s.VIS_B64(3); - d.VIS_B64(6) = d.VIS_B64(3); - d.VIS_B64(5) = s.VIS_B64(2); - d.VIS_B64(4) = d.VIS_B64(2); - d.VIS_B64(3) = s.VIS_B64(1); - d.VIS_B64(2) = d.VIS_B64(1); - d.VIS_B64(1) = s.VIS_B64(0); - /* d.VIS_B64(0) = d.VIS_B64(0); */ + d.VIS_B64(7) = s1.VIS_B32(3); + d.VIS_B64(6) = s2.VIS_B32(3); + d.VIS_B64(5) = s1.VIS_B32(2); + d.VIS_B64(4) = s2.VIS_B32(2); + d.VIS_B64(3) = s1.VIS_B32(1); + d.VIS_B64(2) = s2.VIS_B32(1); + d.VIS_B64(1) = s1.VIS_B32(0); + d.VIS_B64(0) = s2.VIS_B32(0); return d.ll; } From patchwork Sat Mar 2 05:15:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777483 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694582wrn; Fri, 1 Mar 2024 21:18:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUbED8vSu5OK4USgqpPZ6x+ZbXzcAUqsAjsSiMdNY+BBlGDpqpKoHHiVSpIpgiVDpLWNNsvquKTdXghJT5wKE0D X-Google-Smtp-Source: AGHT+IEYQmnvlh+jNKEJwL5uPDMPeuXHnK9R/5Wrn6XH+cdHO3nI49r2qchc9ifrnBu9ET32N+yb X-Received: by 2002:a0d:cb4a:0:b0:609:338b:5cd0 with SMTP id n71-20020a0dcb4a000000b00609338b5cd0mr3558724ywd.5.1709356720125; Fri, 01 Mar 2024 21:18:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356720; cv=none; d=google.com; s=arc-20160816; b=WdRLm+CRlFIgMhW1nMNhztZuMq5RQ9ozey4nDQoKhfJP0O4gfBmypwob1PsHfupd2v M8GOSbIZw6GBBOjfyc7xVYWXPMH9lhdyg/dq4PFI1OOAsZGHcEubcb5J7SQWE3gzsGUa 2jjL3jM0d6F27EJuLc+EvCu3bE+OY3Ux7AMYWrWA/GOOFVC2VGuXiVxiNo7AZNYmW1Pq gzHUoPsdo6jifOPqWgQwIS8NQXt18mrfllGHsfSVHJ00YMpxy3xN/CiKLJDvdiv0AdFd UaiwXJtG6b6KS0EwvL9kB71wWR2SydstR8bCHNlFBIkUg5B5vUfC8WQa905CDajhrlpD rKrA== 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=vjGfHOCM0m98uQm7bh3lP0qVKdngpnelcO2QCf7+7gs=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=OKpYFF7BxT9HmBJHORwSn7mf2cpyVlTdR3VGVheRlWkUL+l9nFui734BLY85C9d5Mr WV/qsdfWnEWyKqS0kBLCqe4goLTBOzHSgpKchyVREosqd6XJqR1lE1GBBGRiYrpYRLwg dICPCChQ7P3EIAxyU0YU6u5G8Pzdog7cIYthJFMRAR1tFUH1YBepR5JG7dsIXIPyrvVY oApT6QxYKdCvlIsIjbarvQWmF8Ws5wUlKxQ0K2ZsYvzIGtaaIIMx2qVuZDoGU6goxMv7 X6yImtUdL6PllDIVUPemlaVUm5M7UevbNH3+EuqYz3nP3+3GdHbRNl14GV32aHDosWS0 hh2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SFf7Ax3B; 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 h10-20020ac846ca000000b0042dedf3dc9fsi4802942qto.434.2024.03.01.21.18.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:40 -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=SFf7Ax3B; 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 1rgHjT-0002PK-OU; Sat, 02 Mar 2024 00:16:23 -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 1rgHjQ-0002Og-5e for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:20 -0500 Received: from mail-oo1-xc35.google.com ([2607:f8b0:4864:20::c35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjO-0007Ur-Cw for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:19 -0500 Received: by mail-oo1-xc35.google.com with SMTP id 006d021491bc7-5a11b231ec5so88110eaf.3 for ; Fri, 01 Mar 2024 21:16:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356577; x=1709961377; 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=vjGfHOCM0m98uQm7bh3lP0qVKdngpnelcO2QCf7+7gs=; b=SFf7Ax3B32T/vYHXXk/SSkgpkl7W5+6V0L6XHlw0csaB5P32Xk5JSonglmkfcW7JaL q3RWB9sY18hehFe2qW7yxY5Af92DFko0f4DYbqccz8PCxdmpPnzriY5r8t+560vtkPNv x3Ks0eMtljeadOyL1EJMseKEo8jwYrqmkJhhHIv0yvoG1GSC6JGbctrdXjl0nCCPKPdN Moi5PVW9LvRlslVKxiKlYdVgYF89llKBIEiI7+GYpLe4ROls4WpKc43y9PDgl6CZbA01 NFhOSbk1CVIYED3Z3MT5gLwiESfylwlUQOotjpx/NqVuPpA4VIfi9ffsujkvnKvAuLDa kEmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356577; x=1709961377; 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=vjGfHOCM0m98uQm7bh3lP0qVKdngpnelcO2QCf7+7gs=; b=TriE+3n8VgNColcXcJZOPnR1JEplpsKmdzn0E/d+ini0xMwsghA4J6hmTUQFH9R8HT gbaHU1D0E0IR6DpcJqDZl1JEBJNqIWECt5GkIWc6DPOSbG4nljYiP7oKv7vUI0p5x4fX uINRtLEOH2yVMkX2SZoCrwr7J/RFHe8B8QDDT+PkLqzAjYXeUSA5PJAcQi2Pch9GFkcF Pu/VBI77zV8Y76ZUhLvgiDMt9qrvnJ65aA3XlDf3iMp5rMawMS2w8Rzwf1fFBu7fde7b +Xp1F0iJ8y2e9IqGqv2gEEB6gVx1judqp15J9WpgoT1w2YoBMrgaN4znIUwWI8CtTpOf SWCA== X-Gm-Message-State: AOJu0YwuedgEsSEHObOySQakMT5B/6DLgB+27bxkHSHSxU5PJUkoNFcC GTJXq54UJJBtMPIb46RQE0eJt9OYn0aTIE0u2OVfZlIznCbkyxNpxbIEl0aUDGfRODjBQDabt81 u X-Received: by 2002:a05:6808:1481:b0:3c1:5f09:b16f with SMTP id e1-20020a056808148100b003c15f09b16fmr4558767oiw.26.1709356577259; Fri, 01 Mar 2024 21:16:17 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 07/41] target/sparc: Split out do_ms16b Date: Fri, 1 Mar 2024 19:15:27 -1000 Message-Id: <20240302051601.53649-8-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::c35; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc35.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 The unit operation for fmul8x16 and friends is described in the manual as "MS16b". Split that out for clarity. Improve rounding with an unconditional addition of 0.5 as a fixed-point integer. Signed-off-by: Richard Henderson --- target/sparc/vis_helper.c | 76 +++++++++++++-------------------------- 1 file changed, 24 insertions(+), 52 deletions(-) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 89eea05ddb..e15c6bb34e 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -44,6 +44,7 @@ target_ulong helper_array8(target_ulong pixel_addr, target_ulong cubesize) #if HOST_BIG_ENDIAN #define VIS_B64(n) b[7 - (n)] +#define VIS_SB64(n) sb[7 - (n)] #define VIS_W64(n) w[3 - (n)] #define VIS_SW64(n) sw[3 - (n)] #define VIS_L64(n) l[1 - (n)] @@ -51,6 +52,7 @@ target_ulong helper_array8(target_ulong pixel_addr, target_ulong cubesize) #define VIS_W32(n) w[1 - (n)] #else #define VIS_B64(n) b[n] +#define VIS_SB64(n) sb[n] #define VIS_W64(n) w[n] #define VIS_SW64(n) sw[n] #define VIS_L64(n) l[n] @@ -60,6 +62,7 @@ target_ulong helper_array8(target_ulong pixel_addr, target_ulong cubesize) typedef union { uint8_t b[8]; + int8_t sb[8]; uint16_t w[4]; int16_t sw[4]; uint32_t l[2]; @@ -95,27 +98,23 @@ uint64_t helper_fpmerge(uint32_t src1, uint32_t src2) return d.ll; } +static inline int do_ms16b(int x, int y) +{ + return ((x * y) + 0x80) >> 8; +} + uint64_t helper_fmul8x16(uint32_t src1, uint64_t src2) { VIS64 d; VIS32 s; - uint32_t tmp; s.l = src1; d.ll = src2; -#define PMUL(r) \ - tmp = (int32_t)d.VIS_SW64(r) * (int32_t)s.VIS_B32(r); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp += 0x100; \ - } \ - d.VIS_W64(r) = tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL + d.VIS_W64(0) = do_ms16b(s.VIS_B32(0), d.VIS_SW64(0)); + d.VIS_W64(1) = do_ms16b(s.VIS_B32(1), d.VIS_SW64(1)); + d.VIS_W64(2) = do_ms16b(s.VIS_B32(2), d.VIS_SW64(2)); + d.VIS_W64(3) = do_ms16b(s.VIS_B32(3), d.VIS_SW64(3)); return d.ll; } @@ -124,23 +123,14 @@ uint64_t helper_fmul8x16a(uint32_t src1, int32_t src2) { VIS32 s; VIS64 d; - uint32_t tmp; s.l = src1; d.ll = 0; -#define PMUL(r) \ - tmp = src2 * (int32_t)s.VIS_B64(r); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp += 0x100; \ - } \ - d.VIS_W64(r) = tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL + d.VIS_W64(0) = do_ms16b(s.VIS_B32(0), src2); + d.VIS_W64(1) = do_ms16b(s.VIS_B32(1), src2); + d.VIS_W64(2) = do_ms16b(s.VIS_B32(2), src2); + d.VIS_W64(3) = do_ms16b(s.VIS_B32(3), src2); return d.ll; } @@ -148,23 +138,14 @@ uint64_t helper_fmul8x16a(uint32_t src1, int32_t src2) uint64_t helper_fmul8sux16(uint64_t src1, uint64_t src2) { VIS64 s, d; - uint32_t tmp; s.ll = src1; d.ll = src2; -#define PMUL(r) \ - tmp = (int32_t)d.VIS_SW64(r) * ((int32_t)s.VIS_SW64(r) >> 8); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp += 0x100; \ - } \ - d.VIS_W64(r) = tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL + d.VIS_W64(0) = do_ms16b(s.VIS_SB64(1), d.VIS_SW64(0)); + d.VIS_W64(1) = do_ms16b(s.VIS_SB64(3), d.VIS_SW64(1)); + d.VIS_W64(2) = do_ms16b(s.VIS_SB64(5), d.VIS_SW64(2)); + d.VIS_W64(3) = do_ms16b(s.VIS_SB64(7), d.VIS_SW64(3)); return d.ll; } @@ -172,23 +153,14 @@ uint64_t helper_fmul8sux16(uint64_t src1, uint64_t src2) uint64_t helper_fmul8ulx16(uint64_t src1, uint64_t src2) { VIS64 s, d; - uint32_t tmp; s.ll = src1; d.ll = src2; -#define PMUL(r) \ - tmp = (int32_t)d.VIS_SW64(r) * ((uint32_t)s.VIS_B64(r * 2)); \ - if ((tmp & 0xff) > 0x7f) { \ - tmp += 0x100; \ - } \ - d.VIS_W64(r) = tmp >> 8; - - PMUL(0); - PMUL(1); - PMUL(2); - PMUL(3); -#undef PMUL + d.VIS_W64(0) = do_ms16b(s.VIS_B64(0), d.VIS_SW64(0)); + d.VIS_W64(1) = do_ms16b(s.VIS_B64(2), d.VIS_SW64(1)); + d.VIS_W64(2) = do_ms16b(s.VIS_B64(4), d.VIS_SW64(2)); + d.VIS_W64(3) = do_ms16b(s.VIS_B64(6), d.VIS_SW64(3)); return d.ll; } From patchwork Sat Mar 2 05:15:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777476 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694451wrn; Fri, 1 Mar 2024 21:18:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX51dse2t9cA/SMoziUn8s53p2G3ckOG6pOUaK3VL/9hUyvxS5ZHTtINIWDFJiTQpFxoG37r20M59cHZtC+C2lx X-Google-Smtp-Source: AGHT+IGdhpfBszMi43G9FXSmNS6r14IXTD50PnD4OqtaENPRsaJUccAdKswIKBapFGMvAAeJriSu X-Received: by 2002:a0c:e6ab:0:b0:68f:8d9d:cca6 with SMTP id j11-20020a0ce6ab000000b0068f8d9dcca6mr3659334qvn.63.1709356689852; Fri, 01 Mar 2024 21:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356689; cv=none; d=google.com; s=arc-20160816; b=J50dZVXwwI0W/seOBTA3UCXIQth5Y/0qaH6CljS+WJHocxNCTQw/wdwbICJucSwYSZ HMIoSExvSpR9MTQ7V9oX9YJy3440kDtqBAbmtwM2CDCZbcx5a1uWgAr1Vtn5K9OZm2OA arvb0Xw64mHR65gZN1fophqOpBvDTogVzu42h0tM+/nv2B4Vadx/cr9gMEhxS5t7xr7i sQILRn9Fc30aw7GliBmE3ENNFyKrRkuYUBQCOpA0CDKkjWt1PCGmataWx3oXkMg6sw+I pW6/l6kBTL+mhMG0tCdtuyOgs2wBK04HVs21YRmg3WhHAL4xfLPu2zyj7LATSkRG2T+u aTXQ== 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=qNxa07cC8INqvWd4XruP0LHDrSHd5AgnEtvzh0cx2mQ=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=IQLXW/Ts6iQn27JXwYxqB0mV7K7OUnXSviFe7Xfv3+0psG7NvtXZjen5ujGxkwxHUj eVwTjUlUXi1XySPF6MZSoK67/Q/XvU95TXvuOrPdN58H8TsUNwXGICpi09hu41+ewY2I Z47R7LLVRGVmcHvX1LAc8G6IAIhjopGZf1ls/GN5PMGzwA8q8d38Aqdz42F5jn3xRmAj yNUeqBBVduMMOzyuRGdIUxW8B1UR+75HJi7p0f5HYGXpW/bxE1E0JMXVD/3BriC/koNU HvGIz+R4ZSL5C4FwBBbhVF91g20fUXTmXgBO4smPXsnAk8d9KdFTCIYv7Dm44OiS0yGH LXWw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PPUbHTC1; 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 a6-20020ad45c46000000b0068f01e212dcsi5552778qva.324.2024.03.01.21.18.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:09 -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=PPUbHTC1; 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 1rgHjW-0002QA-Cb; Sat, 02 Mar 2024 00:16:26 -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 1rgHjT-0002PI-JV for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:23 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjQ-0007V1-Bf for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:23 -0500 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-5cfd95130c6so1813755a12.1 for ; Fri, 01 Mar 2024 21:16:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356579; x=1709961379; 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=qNxa07cC8INqvWd4XruP0LHDrSHd5AgnEtvzh0cx2mQ=; b=PPUbHTC1kyh1gXKgQILGXMHo8G9ySJqXDFcOhAx8iamWV12hQEQCNXz99HwvMSSXou VapdhdijTZ8BcJKaNe+9f7EffbU9IoZT/zODSRpW/pA8+qWwEUITzDm+7Y8XZ0HSnUZv S9EVqRC9io52t8ORhMy5iv1ja9KAr3JzEguSRJlBS0Et/0P4JanjiJ8iSIeXKpgVJKqT j+XqyobJT4NeNMke1ffi+mZ7aPeA6lpGNN0HCTV1G324/Ql/WxDA1D3I2QlMjNnvphY2 rstGFFKP6BsJ+1uJha7431w+zEpNVczp2zj4g1GSKRIWXasBC+JnfzOCRYoABFy6/lU7 iLHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356579; x=1709961379; 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=qNxa07cC8INqvWd4XruP0LHDrSHd5AgnEtvzh0cx2mQ=; b=kX3RQDnkiRoZHJnd0wrR9dANexvpPu6PJ4E910w1WunbkOQ1l8z72AbOpxmlkS2eTI SBvt1xzjoQK7sLp7IZdKmxcufIVkt9XnpPJMho8UUt499gJt1cU4tAwKJ33KMyggzgaG Ev5iQp07YHCYx/ykZH2zo9u67rbHuXFQjatLeOMnmOChTM1Znl1H7JGJ/TPsP+TkBSR2 D0z0+FzWUwol9zr4tZkWjmP52Jj9YPLE9zCt3w7IW8lm/PvsUiRfROUmMiurDNsQPPkz 79UV3bZ4xz1UWT6LnBEyPsw8PipuRGcSdQuX4k/jE7DgfWLrCi6hTXAvRsxyJCkWxv9p XfjQ== X-Gm-Message-State: AOJu0YwvFqAF2ZBlMu4onot3EFOxompmG1OK/AOwb+ztiiRPpdZkLqrw e0l2GyHHulJ9AOojfw4j1OSKWLrAtwchtDQTINmFD+JmvCTAZ6HP7z790p3QJmrWWWRL+4srzZl + X-Received: by 2002:a17:90a:2e02:b0:29a:ac9d:a69d with SMTP id q2-20020a17090a2e0200b0029aac9da69dmr4218184pjd.34.1709356578912; Fri, 01 Mar 2024 21:16:18 -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.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 08/41] target/sparc: Perform DFPREG/QFPREG in decodetree Date: Fri, 1 Mar 2024 19:15:28 -1000 Message-Id: <20240302051601.53649-9-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::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.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 Form the proper register decoding from the start. Because we're removing the translation from the inner-most gen_load_fpr_* and gen_store_fpr_* routines, this must be done for all insns at once. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 18 ++-- target/sparc/insns.decode | 220 +++++++++++++++++++++++--------------- 2 files changed, 138 insertions(+), 100 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 6a6c259b06..97a5c636d2 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -241,34 +241,30 @@ static void gen_store_fpr_F(DisasContext *dc, unsigned int dst, TCGv_i32 v) static TCGv_i64 gen_load_fpr_D(DisasContext *dc, unsigned int src) { - src = DFPREG(src); return cpu_fpr[src / 2]; } static void gen_store_fpr_D(DisasContext *dc, unsigned int dst, TCGv_i64 v) { - dst = DFPREG(dst); tcg_gen_mov_i64(cpu_fpr[dst / 2], v); gen_update_fprs_dirty(dc, dst); } static TCGv_i64 gen_dest_fpr_D(DisasContext *dc, unsigned int dst) { - return cpu_fpr[DFPREG(dst) / 2]; + return cpu_fpr[dst / 2]; } static TCGv_i128 gen_load_fpr_Q(DisasContext *dc, unsigned int src) { TCGv_i128 ret = tcg_temp_new_i128(); - src = QFPREG(src); tcg_gen_concat_i64_i128(ret, cpu_fpr[src / 2 + 1], cpu_fpr[src / 2]); return ret; } static void gen_store_fpr_Q(DisasContext *dc, unsigned int dst, TCGv_i128 v) { - dst = DFPREG(dst); tcg_gen_extr_i128_i64(cpu_fpr[dst / 2 + 1], cpu_fpr[dst / 2], v); gen_update_fprs_dirty(dc, dst); } @@ -2002,16 +1998,14 @@ static void gen_fmovd(DisasContext *dc, DisasCompare *cmp, int rd, int rs) static void gen_fmovq(DisasContext *dc, DisasCompare *cmp, int rd, int rs) { #ifdef TARGET_SPARC64 - int qd = QFPREG(rd); - int qs = QFPREG(rs); TCGv c2 = tcg_constant_tl(cmp->c2); - tcg_gen_movcond_i64(cmp->cond, cpu_fpr[qd / 2], cmp->c1, c2, - cpu_fpr[qs / 2], cpu_fpr[qd / 2]); - tcg_gen_movcond_i64(cmp->cond, cpu_fpr[qd / 2 + 1], cmp->c1, c2, - cpu_fpr[qs / 2 + 1], cpu_fpr[qd / 2 + 1]); + tcg_gen_movcond_i64(cmp->cond, cpu_fpr[rd / 2], cmp->c1, c2, + cpu_fpr[rs / 2], cpu_fpr[rd / 2]); + tcg_gen_movcond_i64(cmp->cond, cpu_fpr[rd / 2 + 1], cmp->c1, c2, + cpu_fpr[rs / 2 + 1], cpu_fpr[rd / 2 + 1]); - gen_update_fprs_dirty(dc, qd); + gen_update_fprs_dirty(dc, rd); #else qemu_build_not_reached(); #endif diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index e2d8a07dc4..2c23868fc3 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -26,6 +26,14 @@ CALL 01 i:s30 ## Major Opcode 10 -- integer, floating-point, vis, and system insns. ## +%dfp_rd 25:5 !function=extract_dfpreg +%dfp_rs1 14:5 !function=extract_dfpreg +%dfp_rs2 0:5 !function=extract_dfpreg + +%qfp_rd 25:5 !function=extract_qfpreg +%qfp_rs1 14:5 !function=extract_qfpreg +%qfp_rs2 0:5 !function=extract_qfpreg + &r_r_ri rd rs1 rs2_or_imm imm:bool @n_r_ri .. ..... ...... rs1:5 imm:1 rs2_or_imm:s13 &r_r_ri rd=0 @r_r_ri .. rd:5 ...... rs1:5 imm:1 rs2_or_imm:s13 &r_r_ri @@ -37,11 +45,40 @@ CALL 01 i:s30 &r_r_r rd rs1 rs2 @r_r_r .. rd:5 ...... rs1:5 . ........ rs2:5 &r_r_r +@d_r_r .. ..... ...... rs1:5 . ........ rs2:5 \ + &r_r_r rd=%dfp_rd +@r_d_d .. rd:5 ...... ..... . ........ ..... \ + &r_r_r rs1=%dfp_rs1 rs2=%dfp_rs2 +@d_r_d .. ..... ...... rs1:5 . ........ ..... \ + &r_r_r rd=%dfp_rd rs2=%dfp_rs2 +@d_d_d .. ..... ...... ..... . ........ ..... \ + &r_r_r rd=%dfp_rd rs1=%dfp_rs1 rs2=%dfp_rs2 +@q_q_q .. ..... ...... ..... . ........ ..... \ + &r_r_r rd=%qfp_rd rs1=%qfp_rs1 rs2=%qfp_rs2 +@q_d_d .. ..... ...... ..... . ........ ..... \ + &r_r_r rd=%qfp_rd rs1=%dfp_rs1 rs2=%dfp_rs2 + @r_r_r_swap .. rd:5 ...... rs2:5 . ........ rs1:5 &r_r_r +@d_d_d_swap .. ..... ...... ..... . ........ ..... \ + &r_r_r rd=%dfp_rd rs1=%dfp_rs2 rs2=%dfp_rs1 &r_r rd rs @r_r1 .. rd:5 ...... rs:5 . ........ ..... &r_r @r_r2 .. rd:5 ...... ..... . ........ rs:5 &r_r +@r_d2 .. rd:5 ...... ..... . ........ ..... &r_r rs=%dfp_rs2 +@r_q2 .. rd:5 ...... ..... . ........ ..... &r_r rs=%qfp_rs2 +@d_r2 .. ..... ...... ..... . ........ rs:5 &r_r rd=%dfp_rd +@q_r2 .. ..... ...... ..... . ........ rs:5 &r_r rd=%qfp_rd +@d_d1 .. ..... ...... ..... . ........ ..... \ + &r_r rd=%dfp_rd rs=%dfp_rs1 +@d_d2 .. ..... ...... ..... . ........ ..... \ + &r_r rd=%dfp_rd rs=%dfp_rs2 +@d_q2 .. ..... ...... ..... . ........ ..... \ + &r_r rd=%dfp_rd rs=%qfp_rs2 +@q_q2 .. ..... ...... ..... . ........ ..... \ + &r_r rd=%qfp_rd rs=%qfp_rs2 +@q_d2 .. ..... ...... ..... . ........ ..... \ + &r_r rd=%qfp_rd rs=%dfp_rs2 { [ @@ -241,68 +278,78 @@ DONE 10 00000 111110 00000 0 0000000000000 RETRY 10 00001 111110 00000 0 0000000000000 FMOVs 10 ..... 110100 00000 0 0000 0001 ..... @r_r2 -FMOVd 10 ..... 110100 00000 0 0000 0010 ..... @r_r2 -FMOVq 10 ..... 110100 00000 0 0000 0011 ..... @r_r2 +FMOVd 10 ..... 110100 00000 0 0000 0010 ..... @d_d2 +FMOVq 10 ..... 110100 00000 0 0000 0011 ..... @q_q2 FNEGs 10 ..... 110100 00000 0 0000 0101 ..... @r_r2 -FNEGd 10 ..... 110100 00000 0 0000 0110 ..... @r_r2 -FNEGq 10 ..... 110100 00000 0 0000 0111 ..... @r_r2 +FNEGd 10 ..... 110100 00000 0 0000 0110 ..... @d_d2 +FNEGq 10 ..... 110100 00000 0 0000 0111 ..... @q_q2 FABSs 10 ..... 110100 00000 0 0000 1001 ..... @r_r2 -FABSd 10 ..... 110100 00000 0 0000 1010 ..... @r_r2 -FABSq 10 ..... 110100 00000 0 0000 1011 ..... @r_r2 +FABSd 10 ..... 110100 00000 0 0000 1010 ..... @d_d2 +FABSq 10 ..... 110100 00000 0 0000 1011 ..... @q_q2 FSQRTs 10 ..... 110100 00000 0 0010 1001 ..... @r_r2 -FSQRTd 10 ..... 110100 00000 0 0010 1010 ..... @r_r2 -FSQRTq 10 ..... 110100 00000 0 0010 1011 ..... @r_r2 +FSQRTd 10 ..... 110100 00000 0 0010 1010 ..... @d_d2 +FSQRTq 10 ..... 110100 00000 0 0010 1011 ..... @q_q2 FADDs 10 ..... 110100 ..... 0 0100 0001 ..... @r_r_r -FADDd 10 ..... 110100 ..... 0 0100 0010 ..... @r_r_r -FADDq 10 ..... 110100 ..... 0 0100 0011 ..... @r_r_r +FADDd 10 ..... 110100 ..... 0 0100 0010 ..... @d_d_d +FADDq 10 ..... 110100 ..... 0 0100 0011 ..... @q_q_q FSUBs 10 ..... 110100 ..... 0 0100 0101 ..... @r_r_r -FSUBd 10 ..... 110100 ..... 0 0100 0110 ..... @r_r_r -FSUBq 10 ..... 110100 ..... 0 0100 0111 ..... @r_r_r +FSUBd 10 ..... 110100 ..... 0 0100 0110 ..... @d_d_d +FSUBq 10 ..... 110100 ..... 0 0100 0111 ..... @q_q_q FMULs 10 ..... 110100 ..... 0 0100 1001 ..... @r_r_r -FMULd 10 ..... 110100 ..... 0 0100 1010 ..... @r_r_r -FMULq 10 ..... 110100 ..... 0 0100 1011 ..... @r_r_r +FMULd 10 ..... 110100 ..... 0 0100 1010 ..... @d_d_d +FMULq 10 ..... 110100 ..... 0 0100 1011 ..... @q_q_q FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @r_r_r -FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @r_r_r -FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @r_r_r -FsMULd 10 ..... 110100 ..... 0 0110 1001 ..... @r_r_r -FdMULq 10 ..... 110100 ..... 0 0110 1110 ..... @r_r_r +FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @d_d_d +FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @q_q_q +FsMULd 10 ..... 110100 ..... 0 0110 1001 ..... @d_r_r +FdMULq 10 ..... 110100 ..... 0 0110 1110 ..... @q_d_d FsTOx 10 ..... 110100 00000 0 1000 0001 ..... @r_r2 -FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2 -FqTOx 10 ..... 110100 00000 0 1000 0011 ..... @r_r2 +FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_d2 +FqTOx 10 ..... 110100 00000 0 1000 0011 ..... @r_q2 FxTOs 10 ..... 110100 00000 0 1000 0100 ..... @r_r2 -FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2 -FxTOq 10 ..... 110100 00000 0 1000 1100 ..... @r_r2 +FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @d_r2 +FxTOq 10 ..... 110100 00000 0 1000 1100 ..... @q_r2 FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2 -FdTOs 10 ..... 110100 00000 0 1100 0110 ..... @r_r2 -FqTOs 10 ..... 110100 00000 0 1100 0111 ..... @r_r2 -FiTOd 10 ..... 110100 00000 0 1100 1000 ..... @r_r2 -FsTOd 10 ..... 110100 00000 0 1100 1001 ..... @r_r2 -FqTOd 10 ..... 110100 00000 0 1100 1011 ..... @r_r2 -FiTOq 10 ..... 110100 00000 0 1100 1100 ..... @r_r2 -FsTOq 10 ..... 110100 00000 0 1100 1101 ..... @r_r2 -FdTOq 10 ..... 110100 00000 0 1100 1110 ..... @r_r2 +FdTOs 10 ..... 110100 00000 0 1100 0110 ..... @r_d2 +FqTOs 10 ..... 110100 00000 0 1100 0111 ..... @r_q2 +FiTOd 10 ..... 110100 00000 0 1100 1000 ..... @d_r2 +FsTOd 10 ..... 110100 00000 0 1100 1001 ..... @d_r2 +FqTOd 10 ..... 110100 00000 0 1100 1011 ..... @d_q2 +FiTOq 10 ..... 110100 00000 0 1100 1100 ..... @q_r2 +FsTOq 10 ..... 110100 00000 0 1100 1101 ..... @q_r2 +FdTOq 10 ..... 110100 00000 0 1100 1110 ..... @q_d2 FsTOi 10 ..... 110100 00000 0 1101 0001 ..... @r_r2 -FdTOi 10 ..... 110100 00000 0 1101 0010 ..... @r_r2 -FqTOi 10 ..... 110100 00000 0 1101 0011 ..... @r_r2 +FdTOi 10 ..... 110100 00000 0 1101 0010 ..... @r_d2 +FqTOi 10 ..... 110100 00000 0 1101 0011 ..... @r_q2 FMOVscc 10 rd:5 110101 0 cond:4 1 cc:1 0 000001 rs2:5 -FMOVdcc 10 rd:5 110101 0 cond:4 1 cc:1 0 000010 rs2:5 -FMOVqcc 10 rd:5 110101 0 cond:4 1 cc:1 0 000011 rs2:5 +FMOVdcc 10 ..... 110101 0 cond:4 1 cc:1 0 000010 ..... \ + rd=%dfp_rd rs2=%dfp_rs2 +FMOVqcc 10 ..... 110101 0 cond:4 1 cc:1 0 000011 ..... \ + rd=%qfp_rd rs2=%qfp_rs2 FMOVsfcc 10 rd:5 110101 0 cond:4 0 cc:2 000001 rs2:5 -FMOVdfcc 10 rd:5 110101 0 cond:4 0 cc:2 000010 rs2:5 -FMOVqfcc 10 rd:5 110101 0 cond:4 0 cc:2 000011 rs2:5 +FMOVdfcc 10 ..... 110101 0 cond:4 0 cc:2 000010 ..... \ + rd=%dfp_rd rs2=%dfp_rs2 +FMOVqfcc 10 ..... 110101 0 cond:4 0 cc:2 000011 ..... \ + rd=%qfp_rd rs2=%qfp_rs2 FMOVRs 10 rd:5 110101 rs1:5 0 cond:3 00101 rs2:5 -FMOVRd 10 rd:5 110101 rs1:5 0 cond:3 00110 rs2:5 -FMOVRq 10 rd:5 110101 rs1:5 0 cond:3 00111 rs2:5 +FMOVRd 10 ..... 110101 rs1:5 0 cond:3 00110 ..... \ + rd=%dfp_rd rs2=%dfp_rs2 +FMOVRq 10 ..... 110101 rs1:5 0 cond:3 00111 ..... \ + rd=%qfp_rd rs2=%qfp_rs2 FCMPs 10 000 cc:2 110101 rs1:5 0 0101 0001 rs2:5 -FCMPd 10 000 cc:2 110101 rs1:5 0 0101 0010 rs2:5 -FCMPq 10 000 cc:2 110101 rs1:5 0 0101 0011 rs2:5 +FCMPd 10 000 cc:2 110101 ..... 0 0101 0010 ..... \ + rs1=%dfp_rs1 rs2=%dfp_rs2 +FCMPq 10 000 cc:2 110101 ..... 0 0101 0011 ..... \ + rs1=%qfp_rs1 rs2=%qfp_rs2 FCMPEs 10 000 cc:2 110101 rs1:5 0 0101 0101 rs2:5 -FCMPEd 10 000 cc:2 110101 rs1:5 0 0101 0110 rs2:5 -FCMPEq 10 000 cc:2 110101 rs1:5 0 0101 0111 rs2:5 +FCMPEd 10 000 cc:2 110101 ..... 0 0101 0110 ..... \ + rs1=%dfp_rs1 rs2=%dfp_rs2 +FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ + rs1=%qfp_rs1 rs2=%qfp_rs2 { [ @@ -328,74 +375,74 @@ FCMPEq 10 000 cc:2 110101 rs1:5 0 0101 0111 rs2:5 BMASK 10 ..... 110110 ..... 0 0001 1001 ..... @r_r_r - FPCMPLE16 10 ..... 110110 ..... 0 0010 0000 ..... @r_r_r - FPCMPNE16 10 ..... 110110 ..... 0 0010 0010 ..... @r_r_r - FPCMPGT16 10 ..... 110110 ..... 0 0010 1000 ..... @r_r_r - FPCMPEQ16 10 ..... 110110 ..... 0 0010 1010 ..... @r_r_r - FPCMPLE32 10 ..... 110110 ..... 0 0010 0100 ..... @r_r_r - FPCMPNE32 10 ..... 110110 ..... 0 0010 0110 ..... @r_r_r - FPCMPGT32 10 ..... 110110 ..... 0 0010 1100 ..... @r_r_r - FPCMPEQ32 10 ..... 110110 ..... 0 0010 1110 ..... @r_r_r + FPCMPLE16 10 ..... 110110 ..... 0 0010 0000 ..... @r_d_d + FPCMPNE16 10 ..... 110110 ..... 0 0010 0010 ..... @r_d_d + FPCMPGT16 10 ..... 110110 ..... 0 0010 1000 ..... @r_d_d + FPCMPEQ16 10 ..... 110110 ..... 0 0010 1010 ..... @r_d_d + FPCMPLE32 10 ..... 110110 ..... 0 0010 0100 ..... @r_d_d + FPCMPNE32 10 ..... 110110 ..... 0 0010 0110 ..... @r_d_d + FPCMPGT32 10 ..... 110110 ..... 0 0010 1100 ..... @r_d_d + FPCMPEQ32 10 ..... 110110 ..... 0 0010 1110 ..... @r_d_d - FMUL8x16 10 ..... 110110 ..... 0 0011 0001 ..... @r_r_r - FMUL8x16AU 10 ..... 110110 ..... 0 0011 0011 ..... @r_r_r - FMUL8x16AL 10 ..... 110110 ..... 0 0011 0101 ..... @r_r_r - FMUL8SUx16 10 ..... 110110 ..... 0 0011 0110 ..... @r_r_r - FMUL8ULx16 10 ..... 110110 ..... 0 0011 0111 ..... @r_r_r - FMULD8SUx16 10 ..... 110110 ..... 0 0011 1000 ..... @r_r_r - FMULD8ULx16 10 ..... 110110 ..... 0 0011 1001 ..... @r_r_r - FPACK32 10 ..... 110110 ..... 0 0011 1010 ..... @r_r_r - FPACK16 10 ..... 110110 00000 0 0011 1011 ..... @r_r2 - FPACKFIX 10 ..... 110110 00000 0 0011 1101 ..... @r_r2 - PDIST 10 ..... 110110 ..... 0 0011 1110 ..... @r_r_r + FMUL8x16 10 ..... 110110 ..... 0 0011 0001 ..... @d_r_d + FMUL8x16AU 10 ..... 110110 ..... 0 0011 0011 ..... @d_r_r + FMUL8x16AL 10 ..... 110110 ..... 0 0011 0101 ..... @d_r_r + FMUL8SUx16 10 ..... 110110 ..... 0 0011 0110 ..... @d_d_d + FMUL8ULx16 10 ..... 110110 ..... 0 0011 0111 ..... @d_d_d + FMULD8SUx16 10 ..... 110110 ..... 0 0011 1000 ..... @d_r_r + FMULD8ULx16 10 ..... 110110 ..... 0 0011 1001 ..... @d_r_r + FPACK32 10 ..... 110110 ..... 0 0011 1010 ..... @d_d_d + FPACK16 10 ..... 110110 00000 0 0011 1011 ..... @d_d2 + FPACKFIX 10 ..... 110110 00000 0 0011 1101 ..... @d_d2 + PDIST 10 ..... 110110 ..... 0 0011 1110 ..... @d_d_d - FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @r_r_r - FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @r_r_r - BSHUFFLE 10 ..... 110110 ..... 0 0100 1100 ..... @r_r_r - FEXPAND 10 ..... 110110 00000 0 0100 1101 ..... @r_r2 + FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @d_d_d + FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @d_r_r + BSHUFFLE 10 ..... 110110 ..... 0 0100 1100 ..... @d_d_d + FEXPAND 10 ..... 110110 00000 0 0100 1101 ..... @r_d2 - FSRCd 10 ..... 110110 ..... 0 0111 0100 00000 @r_r1 # FSRC1d + FSRCd 10 ..... 110110 ..... 0 0111 0100 00000 @d_d1 # FSRC1d FSRCs 10 ..... 110110 ..... 0 0111 0101 00000 @r_r1 # FSRC1s - FSRCd 10 ..... 110110 00000 0 0111 1000 ..... @r_r2 # FSRC2d + FSRCd 10 ..... 110110 00000 0 0111 1000 ..... @d_d2 # FSRC2d FSRCs 10 ..... 110110 00000 0 0111 1001 ..... @r_r2 # FSRC2s - FNOTd 10 ..... 110110 ..... 0 0110 1010 00000 @r_r1 # FNOT1d + FNOTd 10 ..... 110110 ..... 0 0110 1010 00000 @d_d1 # FNOT1d FNOTs 10 ..... 110110 ..... 0 0110 1011 00000 @r_r1 # FNOT1s - FNOTd 10 ..... 110110 00000 0 0110 0110 ..... @r_r2 # FNOT2d + FNOTd 10 ..... 110110 00000 0 0110 0110 ..... @d_d2 # FNOT2d FNOTs 10 ..... 110110 00000 0 0110 0111 ..... @r_r2 # FNOT2s - FPADD16 10 ..... 110110 ..... 0 0101 0000 ..... @r_r_r + FPADD16 10 ..... 110110 ..... 0 0101 0000 ..... @d_d_d FPADD16s 10 ..... 110110 ..... 0 0101 0001 ..... @r_r_r - FPADD32 10 ..... 110110 ..... 0 0101 0010 ..... @r_r_r + FPADD32 10 ..... 110110 ..... 0 0101 0010 ..... @d_d_d FPADD32s 10 ..... 110110 ..... 0 0101 0011 ..... @r_r_r - FPSUB16 10 ..... 110110 ..... 0 0101 0100 ..... @r_r_r + FPSUB16 10 ..... 110110 ..... 0 0101 0100 ..... @d_d_d FPSUB16s 10 ..... 110110 ..... 0 0101 0101 ..... @r_r_r - FPSUB32 10 ..... 110110 ..... 0 0101 0110 ..... @r_r_r + FPSUB32 10 ..... 110110 ..... 0 0101 0110 ..... @d_d_d FPSUB32s 10 ..... 110110 ..... 0 0101 0111 ..... @r_r_r - FNORd 10 ..... 110110 ..... 0 0110 0010 ..... @r_r_r + FNORd 10 ..... 110110 ..... 0 0110 0010 ..... @d_d_d FNORs 10 ..... 110110 ..... 0 0110 0011 ..... @r_r_r - FANDNOTd 10 ..... 110110 ..... 0 0110 0100 ..... @r_r_r # FANDNOT2d + FANDNOTd 10 ..... 110110 ..... 0 0110 0100 ..... @d_d_d # FANDNOT2d FANDNOTs 10 ..... 110110 ..... 0 0110 0101 ..... @r_r_r # FANDNOT2s - FANDNOTd 10 ..... 110110 ..... 0 0110 1000 ..... @r_r_r_swap # ... 1d + FANDNOTd 10 ..... 110110 ..... 0 0110 1000 ..... @d_d_d_swap # ... 1d FANDNOTs 10 ..... 110110 ..... 0 0110 1001 ..... @r_r_r_swap # ... 1s - FXORd 10 ..... 110110 ..... 0 0110 1100 ..... @r_r_r + FXORd 10 ..... 110110 ..... 0 0110 1100 ..... @d_d_d FXORs 10 ..... 110110 ..... 0 0110 1101 ..... @r_r_r - FNANDd 10 ..... 110110 ..... 0 0110 1110 ..... @r_r_r + FNANDd 10 ..... 110110 ..... 0 0110 1110 ..... @d_d_d FNANDs 10 ..... 110110 ..... 0 0110 1111 ..... @r_r_r - FANDd 10 ..... 110110 ..... 0 0111 0000 ..... @r_r_r + FANDd 10 ..... 110110 ..... 0 0111 0000 ..... @d_d_d FANDs 10 ..... 110110 ..... 0 0111 0001 ..... @r_r_r - FXNORd 10 ..... 110110 ..... 0 0111 0010 ..... @r_r_r + FXNORd 10 ..... 110110 ..... 0 0111 0010 ..... @d_d_d FXNORs 10 ..... 110110 ..... 0 0111 0011 ..... @r_r_r - FORNOTd 10 ..... 110110 ..... 0 0111 0110 ..... @r_r_r # FORNOT2d + FORNOTd 10 ..... 110110 ..... 0 0111 0110 ..... @d_d_d # FORNOT2d FORNOTs 10 ..... 110110 ..... 0 0111 0111 ..... @r_r_r # FORNOT2s - FORNOTd 10 ..... 110110 ..... 0 0111 1010 ..... @r_r_r_swap # ... 1d + FORNOTd 10 ..... 110110 ..... 0 0111 1010 ..... @d_d_d_swap # ... 1d FORNOTs 10 ..... 110110 ..... 0 0111 1011 ..... @r_r_r_swap # ... 1s - FORd 10 ..... 110110 ..... 0 0111 1100 ..... @r_r_r + FORd 10 ..... 110110 ..... 0 0111 1100 ..... @d_d_d FORs 10 ..... 110110 ..... 0 0111 1101 ..... @r_r_r - FZEROd 10 rd:5 110110 00000 0 0110 0000 00000 + FZEROd 10 ..... 110110 00000 0 0110 0000 00000 rd=%dfp_rd FZEROs 10 rd:5 110110 00000 0 0110 0001 00000 - FONEd 10 rd:5 110110 00000 0 0111 1110 00000 + FONEd 10 ..... 110110 00000 0 0111 1110 00000 rd=%dfp_rd FONEs 10 rd:5 110110 00000 0 0111 1111 00000 ] NCP 10 ----- 110110 ----- --------- ----- # v8 CPop1 @@ -407,9 +454,6 @@ NCP 10 ----- 110111 ----- --------- ----- # v8 CPop2 ## Major Opcode 11 -- load and store instructions ## -%dfp_rd 25:5 !function=extract_dfpreg -%qfp_rd 25:5 !function=extract_qfpreg - &r_r_ri_asi rd rs1 rs2_or_imm asi imm:bool @r_r_ri_na .. rd:5 ...... rs1:5 imm:1 rs2_or_imm:s13 &r_r_ri_asi asi=-1 @d_r_ri_na .. ..... ...... rs1:5 imm:1 rs2_or_imm:s13 \ From patchwork Sat Mar 2 05:15:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777472 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694420wrn; Fri, 1 Mar 2024 21:18:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUOFxh4hx+D5BF+pA/8wMfZ7eKeGB8DORt1833tTd6LfwHWhSPnsgGgPHNonXONXZaXJkfrDDnqhMmIcsYOs4hz X-Google-Smtp-Source: AGHT+IH24IC2hXzpROzLp5BUiOfS0Zwr05WoSRUdW2nHOjKdC1Wy+Ktm7+AecPlN8X+0Hiko3dAG X-Received: by 2002:a05:622a:1c1:b0:42e:c3d8:384b with SMTP id t1-20020a05622a01c100b0042ec3d8384bmr3770051qtw.7.1709356684954; Fri, 01 Mar 2024 21:18:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356684; cv=none; d=google.com; s=arc-20160816; b=PtK1tN72Pi3JpWLmCAZVvzA+zWMkYd7nVjti3OWkPqhuewjDO27vtaecX+Ib1EjF0G DILuYazsXLt7fgKJqroMIfaR10L5jqjjXmp91KlKjJepjEeOQ42pCtjweJXKs0jsvUIx wuh8q3+bNm3N9Mzo+bro3eCryf/hYx3HDozBUROXmhqueS4sJi1sFy+3zC+IPeqa6Bkl DrEvMuHP/7q9T7isanGSis2hpuFQFL9MA/16dwwLMMqBD9yabEnWGUevNlQt9YBZAyV9 2aGcSZJHBurL2+3LFKNjPvcl207LvbCyTZH04m0aNaWuaGzQcBszT7RyhmmoHtgbZAbV Blpw== 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=3UUMLLXsAT9hxWNYnOEqNqemxeKUB6s4UmOAyXwA2RU=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=iuxwuHXJq4PBoZan5R074i5oGXDVhQmAucmgvQGpaJgwl7ozQ3bHZrNpuRiV3IaRBD jzinTqc+SzdWx6LG+I4zx4MTmqClSf8SXOESliiIz81NgFosToYyrLu7ODM3weIhIKXn m0qjIu7gu8CHL3astjdEOSM4orZxFEnIceJoDNLGFJIfP+/Gizzpnx2gWMCZ18Mn2Y3S /rfu82FLM5iO49bzNoF3O4sWbJKYPxEpnEQhYVB40FuvXihuTy4dt/B6klyw65AP7yYs wVXvk58TU05RtAkmYyTvX/1BxbXv3vmxmN8YeGnrpYA4qlKC3ReFBJLHVmipphiXYpZw egEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KvKu9Bjn; 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 y16-20020a05622a121000b0042e770d48dfsi5556206qtx.35.2024.03.01.21.18.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:04 -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=KvKu9Bjn; 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 1rgHjV-0002Q6-ME; Sat, 02 Mar 2024 00:16:25 -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 1rgHjU-0002PS-3R for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:24 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjS-0007VF-CL for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:23 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6d9f94b9186so2715095b3a.0 for ; Fri, 01 Mar 2024 21:16:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356581; x=1709961381; 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=3UUMLLXsAT9hxWNYnOEqNqemxeKUB6s4UmOAyXwA2RU=; b=KvKu9Bjn6be6Zv7DCJKCbG7z6wGHWl0J306qYYK3ZLeJ0m+KnQVXuwvq0ziJ5QCEP5 k6vS6lk0KosdLlZTH9k8zZFmX5zGFZFyjXr9RSoh21pJAyHLjoZqZG6PfuiNF6UuzqI4 NmMi/KfhoPdufhu0SwdRHZ7aPW6iI1xT1s/ZHJwMrhaBdEGPRr3asv6e/eKswQEqZnx7 NoR8U05d6sfBIS7OfjymgRi41nknyxsQnhWy18E+MF3Iye4JE6q6RlfOc3iwqKj3mONW hT2GRwMiRT3QhgOBx05OnJMOo0np4Ep6theBRlwEwP1Uf059gK2NUi108VUMsdBRkF00 XMMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356581; x=1709961381; 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=3UUMLLXsAT9hxWNYnOEqNqemxeKUB6s4UmOAyXwA2RU=; b=m5xiVZ2NWPfw6bCj+/IBUXVgtCZBy+QhsH7u6f8nZxHnuO3QAUy3S/ttsOQhtOvUFL O82ObQatS18mj0eTE4wHE8O/Brj7c8zNauJJxyXrnZ5J0d4+ivXxUNBG7iF4m0rU6aS1 BKxWDo29GkCmk2HKWf7c1qtOsbT2aUsVflbMsMoG4FIytH6jQuAh3LWTYI4CPMqoKsQS OjdSkSV51y+UI+16Zy8P+T20MSHFj0dEANpIonGekMjJO9ll9DuuAIYhORa60pRkmeYt q7Z1Df3dn/IdF8bxs09doeDlPA4w76VtsO3lDhmw5hR6XPLB8pARotYQysNuuPGr0mUT dblg== X-Gm-Message-State: AOJu0Yy8mStaR9EixwDXwDwBpRfD3Gp1SkMnW3QrgCrXnGvOGhREymOL B2v5S3Iu3/tiIqkbO0eM/qw5KncCmqePboEmm/Mu8iTkgyTbA74nAVP55pyjIUC1pZFADMjzog/ c X-Received: by 2002:a05:6a20:af11:b0:1a0:ff4d:eb2d with SMTP id dr17-20020a056a20af1100b001a0ff4deb2dmr3034169pzb.54.1709356580840; Fri, 01 Mar 2024 21:16:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 09/41] target/sparc: Remove gen_dest_fpr_D Date: Fri, 1 Mar 2024 19:15:29 -1000 Message-Id: <20240302051601.53649-10-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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 Replace with tcg_temp_new_i64. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 97a5c636d2..ddceb25b08 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -250,11 +250,6 @@ static void gen_store_fpr_D(DisasContext *dc, unsigned int dst, TCGv_i64 v) gen_update_fprs_dirty(dc, dst); } -static TCGv_i64 gen_dest_fpr_D(DisasContext *dc, unsigned int dst) -{ - return cpu_fpr[dst / 2]; -} - static TCGv_i128 gen_load_fpr_Q(DisasContext *dc, unsigned int src) { TCGv_i128 ret = tcg_temp_new_i128(); @@ -1985,7 +1980,7 @@ static void gen_fmovs(DisasContext *dc, DisasCompare *cmp, int rd, int rs) static void gen_fmovd(DisasContext *dc, DisasCompare *cmp, int rd, int rs) { #ifdef TARGET_SPARC64 - TCGv_i64 dst = gen_dest_fpr_D(dc, rd); + TCGv_i64 dst = tcg_temp_new_i64(); tcg_gen_movcond_i64(cmp->cond, dst, cmp->c1, tcg_constant_tl(cmp->c2), gen_load_fpr_D(dc, rs), gen_load_fpr_D(dc, rd)); @@ -4326,7 +4321,7 @@ static bool do_dd(DisasContext *dc, arg_r_r *a, return true; } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src = gen_load_fpr_D(dc, a->rs); func(dst, src); gen_store_fpr_D(dc, a->rd, dst); @@ -4348,7 +4343,7 @@ static bool do_env_dd(DisasContext *dc, arg_r_r *a, return true; } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src = gen_load_fpr_D(dc, a->rs); func(dst, tcg_env, src); gen_store_fpr_D(dc, a->rd, dst); @@ -4388,7 +4383,7 @@ static bool do_env_df(DisasContext *dc, arg_r_r *a, return true; } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src = gen_load_fpr_F(dc, a->rs); func(dst, tcg_env, src); gen_store_fpr_D(dc, a->rd, dst); @@ -4479,7 +4474,7 @@ static bool do_env_dq(DisasContext *dc, arg_r_r *a, } src = gen_load_fpr_Q(dc, a->rs); - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); func(dst, tcg_env, src); gen_store_fpr_D(dc, a->rd, dst); return advance_pc(dc); @@ -4594,7 +4589,7 @@ static bool do_dff(DisasContext *dc, arg_r_r_r *a, return true; } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src1 = gen_load_fpr_F(dc, a->rs1); src2 = gen_load_fpr_F(dc, a->rs2); func(dst, src1, src2); @@ -4618,7 +4613,7 @@ static bool do_dfd(DisasContext *dc, arg_r_r_r *a, return true; } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src1 = gen_load_fpr_F(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); func(dst, src1, src2); @@ -4637,7 +4632,7 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, return true; } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src1 = gen_load_fpr_D(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); func(dst, src1, src2); @@ -4702,7 +4697,7 @@ static bool do_env_ddd(DisasContext *dc, arg_r_r_r *a, return true; } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src1 = gen_load_fpr_D(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); func(dst, tcg_env, src1, src2); @@ -4727,7 +4722,7 @@ static bool trans_FsMULd(DisasContext *dc, arg_r_r_r *a) return raise_unimpfpop(dc); } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src1 = gen_load_fpr_F(dc, a->rs1); src2 = gen_load_fpr_F(dc, a->rs2); gen_helper_fsmuld(dst, tcg_env, src1, src2); @@ -4744,7 +4739,7 @@ static bool do_dddd(DisasContext *dc, arg_r_r_r *a, return true; } - dst = gen_dest_fpr_D(dc, a->rd); + dst = tcg_temp_new_i64(); src0 = gen_load_fpr_D(dc, a->rd); src1 = gen_load_fpr_D(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); From patchwork Sat Mar 2 05:15:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777494 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694970wrn; Fri, 1 Mar 2024 21:20:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUcZ/sN/YZmxORWsvTcEiLXFwvh1zh5CoKyFG1vgj0n5E4DIDaM/s9KVUq6qC9J+2RgIjO6lvbcOrdnpSitL+b8 X-Google-Smtp-Source: AGHT+IHG41hjeFHi2FMrhkqs8FiB38WUq+2tTC7fhK2wUGhIIzZE/OHBPRzFaT6Rbrw9rroch+Gt X-Received: by 2002:ac8:5b93:0:b0:42e:da71:1db with SMTP id a19-20020ac85b93000000b0042eda7101dbmr1240101qta.2.1709356820392; Fri, 01 Mar 2024 21:20:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356820; cv=none; d=google.com; s=arc-20160816; b=BmimzIkJNYru9vCby54fUsvOIrCc/fdDRA8Ocx59xdg+lOl9Nsy7oTSqoGuJlfeohf fNJh9cxWsbhjNBp05+LMKWjAvOK8R7QQETsbrhkcI5gZZc/SYrxrR+SW/jGLG/ZYaB7X If7sEpqy/GiWwVsi/F2d9oQTKc6IEp0eAai/SeCLBc/BEpgMwpYquCYOGlNoG4CrDwKT NNmUsvNdFisHwkGUP6GtZnDh0+0juiH6B7kX6E3r/Hulg4d+1GTTZvG+DosAWIw42zVd ZYGmZPteoMa2O+kmIF3jOctOmyv7dpa1hyoSLX1b0jYvmbT6lrwX5htbtZpn/a1B4n61 U89A== 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=owNJfP2XTjmUJ5ytXkwhG0KGsyIjTx1KJwB9+pwbDas=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=jRC1m9pQIn34leKgOwxiEFENbNiwMgfu/Kqyw6MZESs+d2TLZPQQ8TdnPpxliO/SxO HBRPHF5BkBmgMI3QQSWhKgaTdnaan6gxFNZXKKA2+keQ6J23nacSwnEcoXwMqI+bu7f9 Frg5zY6D946Ay6G3A5psHhH0IJ4PJgCEZ1UPVccxRMt5FElCjmbIO3RFFOygj3sVuWTa Mu3FcFZqISZH7NU18Wrw4Q+CPhtZwJ1LTmsqA2/TUIp6RLkOXu/LJU7XDlkdUnp7h0i+ umi31Gpf/3zUogmkrFcb9GFB19APf/Cm5H7TpFGPClDGGHneSzUQpbb3KWOKxmeJIgcj +L3Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xMPJMuhy; 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 jy11-20020a05622a818b00b0042c5ff0e29asi4894297qtb.740.2024.03.01.21.20.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:20: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=pass header.i=@linaro.org header.s=google header.b=xMPJMuhy; 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 1rgHja-0002RT-3X; Sat, 02 Mar 2024 00:16:30 -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 1rgHjX-0002R1-Qc for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:27 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjU-0007VO-DX for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:27 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-299e4b352cdso1970116a91.0 for ; Fri, 01 Mar 2024 21:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356583; x=1709961383; 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=owNJfP2XTjmUJ5ytXkwhG0KGsyIjTx1KJwB9+pwbDas=; b=xMPJMuhyrR0/+zWU7DE8o03pl7vZyPMfBPyXz4/LHVNP/NnHT3ma4ymEoXbL765868 xQw1C3WyIZIUCxWccutfRHoY+iRHM2Q8EGx2wgdO/Qb6oaaLyOod61ORWFwp9btOaq32 IS7BfyEnZq1Ggh/qvvGdAfc/7KWudif7mdz6wZ90Nz98s/JwFC4CAomG7Zt/G1AHZR1l ny1V5DLjWnFGXRz3QYTZ0WnknGMwk5kFVeY3lYqrr7W2qkODpdJuj/+TEtedNEY4VDIM 7Cx5hdmVMaUSEuVbN7N7ZgWOjMIliRB37KBHYO6ii41XNas12AoEos2nDsrRAyvSjL2l TJrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356583; x=1709961383; 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=owNJfP2XTjmUJ5ytXkwhG0KGsyIjTx1KJwB9+pwbDas=; b=SZaxrqy7tzpVTMZUHhBGOnnfpN3baI8xtlO8gaD5fvvjeomptT1XdikC/FLpNA8AiE U7t39/GhnCGmucHl+ReV9AjV5DQ6ylYGg3/yx4uSw3IASS/N2IvYJo1MMp3cJXdZs+a3 Ou9coVCHZ5KJ2oxb4+GCnWFBqJJChIbAQSWKj27ZD9tyEv9jgeuAQ+vj94Z6bAhTWwn7 58TMINivdNcsaNW61zZqhr2uR9I72hDPhev3YKu2sSiGcfbDoQWMQta0JQcpkV1kskFf eU2yh6y99ICuVHfmmbcYctqejyvkiVik7dCZNCsHBYohuXK/hd3V1+09t6iZb/uK1447 7bGg== X-Gm-Message-State: AOJu0YwFc/e/0KrCmbXmrgAF5tDr1sctY8Nfib1qf4B5UsMjE2buJ5ND zE/eilmZa18F4Q5G9hi6iDM/vghApy0gQMgrWYEpMQWZnvyPI+0PZUxGaWE+6M1syd31ZsPlhRJ B X-Received: by 2002:a17:90a:aa95:b0:29a:8ac0:9fd2 with SMTP id l21-20020a17090aaa9500b0029a8ac09fd2mr3067603pjq.49.1709356582847; Fri, 01 Mar 2024 21:16:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 10/41] target/sparc: Remove cpu_fpr[] Date: Fri, 1 Mar 2024 19:15:30 -1000 Message-Id: <20240302051601.53649-11-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::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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 Use explicit loads and stores to env instead. Signed-off-by: Richard Henderson --- target/sparc/translate.c | 158 +++++++++++++++++++++------------------ 1 file changed, 84 insertions(+), 74 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index ddceb25b08..981d9d9101 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -124,8 +124,7 @@ static TCGv cpu_gsr; #define cpu_xcc_C ({ qemu_build_not_reached(); NULL; }) #endif -/* Floating point registers */ -static TCGv_i64 cpu_fpr[TARGET_DPREGS]; +/* Floating point comparison registers */ static TCGv_i32 cpu_fcc[TARGET_FCCREGS]; #define env_field_offsetof(X) offsetof(CPUSPARCState, X) @@ -218,50 +217,72 @@ static void gen_update_fprs_dirty(DisasContext *dc, int rd) } /* floating point registers moves */ + +static int gen_offset_fpr_F(unsigned int reg) +{ + int ret; + + tcg_debug_assert(reg < 32); + ret= offsetof(CPUSPARCState, fpr[reg / 2]); + if (reg & 1) { + ret += offsetof(CPU_DoubleU, l.lower); + } else { + ret += offsetof(CPU_DoubleU, l.upper); + } + return ret; +} + static TCGv_i32 gen_load_fpr_F(DisasContext *dc, unsigned int src) { TCGv_i32 ret = tcg_temp_new_i32(); - if (src & 1) { - tcg_gen_extrl_i64_i32(ret, cpu_fpr[src / 2]); - } else { - tcg_gen_extrh_i64_i32(ret, cpu_fpr[src / 2]); - } + tcg_gen_ld_i32(ret, tcg_env, gen_offset_fpr_F(src)); return ret; } static void gen_store_fpr_F(DisasContext *dc, unsigned int dst, TCGv_i32 v) { - TCGv_i64 t = tcg_temp_new_i64(); - - tcg_gen_extu_i32_i64(t, v); - tcg_gen_deposit_i64(cpu_fpr[dst / 2], cpu_fpr[dst / 2], t, - (dst & 1 ? 0 : 32), 32); + tcg_gen_st_i32(v, tcg_env, gen_offset_fpr_F(dst)); gen_update_fprs_dirty(dc, dst); } +static int gen_offset_fpr_D(unsigned int reg) +{ + tcg_debug_assert(reg < 64); + tcg_debug_assert(reg % 2 == 0); + return offsetof(CPUSPARCState, fpr[reg / 2]); +} + static TCGv_i64 gen_load_fpr_D(DisasContext *dc, unsigned int src) { - return cpu_fpr[src / 2]; + TCGv_i64 ret = tcg_temp_new_i64(); + tcg_gen_ld_i64(ret, tcg_env, gen_offset_fpr_D(src)); + return ret; } static void gen_store_fpr_D(DisasContext *dc, unsigned int dst, TCGv_i64 v) { - tcg_gen_mov_i64(cpu_fpr[dst / 2], v); + tcg_gen_st_i64(v, tcg_env, gen_offset_fpr_D(dst)); gen_update_fprs_dirty(dc, dst); } static TCGv_i128 gen_load_fpr_Q(DisasContext *dc, unsigned int src) { TCGv_i128 ret = tcg_temp_new_i128(); + TCGv_i64 h = gen_load_fpr_D(dc, src); + TCGv_i64 l = gen_load_fpr_D(dc, src + 2); - tcg_gen_concat_i64_i128(ret, cpu_fpr[src / 2 + 1], cpu_fpr[src / 2]); + tcg_gen_concat_i64_i128(ret, l, h); return ret; } static void gen_store_fpr_Q(DisasContext *dc, unsigned int dst, TCGv_i128 v) { - tcg_gen_extr_i128_i64(cpu_fpr[dst / 2 + 1], cpu_fpr[dst / 2], v); - gen_update_fprs_dirty(dc, dst); + TCGv_i64 h = tcg_temp_new_i64(); + TCGv_i64 l = tcg_temp_new_i64(); + + tcg_gen_extr_i128_i64(l, h, v); + gen_store_fpr_D(dc, dst, h); + gen_store_fpr_D(dc, dst + 2, l); } /* moves */ @@ -1595,7 +1616,7 @@ static void gen_ldf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, MemOp memop = da->memop; MemOp size = memop & MO_SIZE; TCGv_i32 d32; - TCGv_i64 d64; + TCGv_i64 d64, l64; TCGv addr_tmp; /* TODO: Use 128-bit load/store below. */ @@ -1617,16 +1638,20 @@ static void gen_ldf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, break; case MO_64: - tcg_gen_qemu_ld_i64(cpu_fpr[rd / 2], addr, da->mem_idx, memop); + d64 = tcg_temp_new_i64(); + tcg_gen_qemu_ld_i64(d64, addr, da->mem_idx, memop); + gen_store_fpr_D(dc, rd, d64); break; case MO_128: d64 = tcg_temp_new_i64(); + l64 = tcg_temp_new_i64(); tcg_gen_qemu_ld_i64(d64, addr, da->mem_idx, memop); addr_tmp = tcg_temp_new(); tcg_gen_addi_tl(addr_tmp, addr, 8); - tcg_gen_qemu_ld_i64(cpu_fpr[rd / 2 + 1], addr_tmp, da->mem_idx, memop); - tcg_gen_mov_i64(cpu_fpr[rd / 2], d64); + tcg_gen_qemu_ld_i64(l64, addr_tmp, da->mem_idx, memop); + gen_store_fpr_D(dc, rd, d64); + gen_store_fpr_D(dc, rd + 2, l64); break; default: g_assert_not_reached(); @@ -1638,9 +1663,11 @@ static void gen_ldf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, if (orig_size == MO_64 && (rd & 7) == 0) { /* The first operation checks required alignment. */ addr_tmp = tcg_temp_new(); + d64 = tcg_temp_new_i64(); for (int i = 0; ; ++i) { - tcg_gen_qemu_ld_i64(cpu_fpr[rd / 2 + i], addr, da->mem_idx, + tcg_gen_qemu_ld_i64(d64, addr, da->mem_idx, memop | (i == 0 ? MO_ALIGN_64 : 0)); + gen_store_fpr_D(dc, rd + 2 * i, d64); if (i == 7) { break; } @@ -1655,8 +1682,9 @@ static void gen_ldf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, case GET_ASI_SHORT: /* Valid for lddfa only. */ if (orig_size == MO_64) { - tcg_gen_qemu_ld_i64(cpu_fpr[rd / 2], addr, da->mem_idx, - memop | MO_ALIGN); + d64 = tcg_temp_new_i64(); + tcg_gen_qemu_ld_i64(d64, addr, da->mem_idx, memop | MO_ALIGN); + gen_store_fpr_D(dc, rd, d64); } else { gen_exception(dc, TT_ILL_INSN); } @@ -1681,17 +1709,19 @@ static void gen_ldf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, gen_store_fpr_F(dc, rd, d32); break; case MO_64: - gen_helper_ld_asi(cpu_fpr[rd / 2], tcg_env, addr, - r_asi, r_mop); + d64 = tcg_temp_new_i64(); + gen_helper_ld_asi(d64, tcg_env, addr, r_asi, r_mop); + gen_store_fpr_D(dc, rd, d64); break; case MO_128: d64 = tcg_temp_new_i64(); + l64 = tcg_temp_new_i64(); gen_helper_ld_asi(d64, tcg_env, addr, r_asi, r_mop); addr_tmp = tcg_temp_new(); tcg_gen_addi_tl(addr_tmp, addr, 8); - gen_helper_ld_asi(cpu_fpr[rd / 2 + 1], tcg_env, addr_tmp, - r_asi, r_mop); - tcg_gen_mov_i64(cpu_fpr[rd / 2], d64); + gen_helper_ld_asi(l64, tcg_env, addr_tmp, r_asi, r_mop); + gen_store_fpr_D(dc, rd, d64); + gen_store_fpr_D(dc, rd + 2, l64); break; default: g_assert_not_reached(); @@ -1707,6 +1737,7 @@ static void gen_stf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, MemOp memop = da->memop; MemOp size = memop & MO_SIZE; TCGv_i32 d32; + TCGv_i64 d64; TCGv addr_tmp; /* TODO: Use 128-bit load/store below. */ @@ -1726,8 +1757,8 @@ static void gen_stf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, tcg_gen_qemu_st_i32(d32, addr, da->mem_idx, memop | MO_ALIGN); break; case MO_64: - tcg_gen_qemu_st_i64(cpu_fpr[rd / 2], addr, da->mem_idx, - memop | MO_ALIGN_4); + d64 = gen_load_fpr_D(dc, rd); + tcg_gen_qemu_st_i64(d64, addr, da->mem_idx, memop | MO_ALIGN_4); break; case MO_128: /* Only 4-byte alignment required. However, it is legal for the @@ -1735,11 +1766,12 @@ static void gen_stf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, required to fix it up. Requiring 16-byte alignment here avoids having to probe the second page before performing the first write. */ - tcg_gen_qemu_st_i64(cpu_fpr[rd / 2], addr, da->mem_idx, - memop | MO_ALIGN_16); + d64 = gen_load_fpr_D(dc, rd); + tcg_gen_qemu_st_i64(d64, addr, da->mem_idx, memop | MO_ALIGN_16); addr_tmp = tcg_temp_new(); tcg_gen_addi_tl(addr_tmp, addr, 8); - tcg_gen_qemu_st_i64(cpu_fpr[rd / 2 + 1], addr_tmp, da->mem_idx, memop); + d64 = gen_load_fpr_D(dc, rd + 2); + tcg_gen_qemu_st_i64(d64, addr_tmp, da->mem_idx, memop); break; default: g_assert_not_reached(); @@ -1752,7 +1784,8 @@ static void gen_stf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, /* The first operation checks required alignment. */ addr_tmp = tcg_temp_new(); for (int i = 0; ; ++i) { - tcg_gen_qemu_st_i64(cpu_fpr[rd / 2 + i], addr, da->mem_idx, + d64 = gen_load_fpr_D(dc, rd + 2 * i); + tcg_gen_qemu_st_i64(d64, addr, da->mem_idx, memop | (i == 0 ? MO_ALIGN_64 : 0)); if (i == 7) { break; @@ -1768,8 +1801,8 @@ static void gen_stf_asi(DisasContext *dc, DisasASI *da, MemOp orig_size, case GET_ASI_SHORT: /* Valid for stdfa only. */ if (orig_size == MO_64) { - tcg_gen_qemu_st_i64(cpu_fpr[rd / 2], addr, da->mem_idx, - memop | MO_ALIGN); + d64 = gen_load_fpr_D(dc, rd); + tcg_gen_qemu_st_i64(d64, addr, da->mem_idx, memop | MO_ALIGN); } else { gen_exception(dc, TT_ILL_INSN); } @@ -1994,13 +2027,17 @@ static void gen_fmovq(DisasContext *dc, DisasCompare *cmp, int rd, int rs) { #ifdef TARGET_SPARC64 TCGv c2 = tcg_constant_tl(cmp->c2); + TCGv_i64 h = tcg_temp_new_i64(); + TCGv_i64 l = tcg_temp_new_i64(); - tcg_gen_movcond_i64(cmp->cond, cpu_fpr[rd / 2], cmp->c1, c2, - cpu_fpr[rs / 2], cpu_fpr[rd / 2]); - tcg_gen_movcond_i64(cmp->cond, cpu_fpr[rd / 2 + 1], cmp->c1, c2, - cpu_fpr[rs / 2 + 1], cpu_fpr[rd / 2 + 1]); - - gen_update_fprs_dirty(dc, rd); + tcg_gen_movcond_i64(cmp->cond, h, cmp->c1, c2, + gen_load_fpr_D(dc, rs), + gen_load_fpr_D(dc, rd)); + tcg_gen_movcond_i64(cmp->cond, l, cmp->c1, c2, + gen_load_fpr_D(dc, rs + 2), + gen_load_fpr_D(dc, rd + 2)); + gen_store_fpr_D(dc, rd, h); + gen_store_fpr_D(dc, rd + 2, l); #else qemu_build_not_reached(); #endif @@ -4192,39 +4229,24 @@ static bool do_stfsr(DisasContext *dc, arg_r_r_ri *a, MemOp mop) TRANS(STFSR, ALL, do_stfsr, a, MO_TEUL) TRANS(STXFSR, 64, do_stfsr, a, MO_TEUQ) -static bool do_fc(DisasContext *dc, int rd, bool c) +static bool do_fc(DisasContext *dc, int rd, int32_t c) { - uint64_t mask; - if (gen_trap_ifnofpu(dc)) { return true; } - - if (rd & 1) { - mask = MAKE_64BIT_MASK(0, 32); - } else { - mask = MAKE_64BIT_MASK(32, 32); - } - if (c) { - tcg_gen_ori_i64(cpu_fpr[rd / 2], cpu_fpr[rd / 2], mask); - } else { - tcg_gen_andi_i64(cpu_fpr[rd / 2], cpu_fpr[rd / 2], ~mask); - } - gen_update_fprs_dirty(dc, rd); + gen_store_fpr_F(dc, rd, tcg_constant_i32(c)); return advance_pc(dc); } TRANS(FZEROs, VIS1, do_fc, a->rd, 0) -TRANS(FONEs, VIS1, do_fc, a->rd, 1) +TRANS(FONEs, VIS1, do_fc, a->rd, -1) static bool do_dc(DisasContext *dc, int rd, int64_t c) { if (gen_trap_ifnofpu(dc)) { return true; } - - tcg_gen_movi_i64(cpu_fpr[rd / 2], c); - gen_update_fprs_dirty(dc, rd); + gen_store_fpr_D(dc, rd, tcg_constant_i64(c)); return advance_pc(dc); } @@ -5128,12 +5150,6 @@ void sparc_tcg_init(void) "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", }; - static const char fregnames[32][4] = { - "f0", "f2", "f4", "f6", "f8", "f10", "f12", "f14", - "f16", "f18", "f20", "f22", "f24", "f26", "f28", "f30", - "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", - "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", - }; static const struct { TCGv_i32 *ptr; int off; const char *name; } r32[] = { #ifdef TARGET_SPARC64 @@ -5190,12 +5206,6 @@ void sparc_tcg_init(void) (i - 8) * sizeof(target_ulong), gregnames[i]); } - - for (i = 0; i < TARGET_DPREGS; i++) { - cpu_fpr[i] = tcg_global_mem_new_i64(tcg_env, - offsetof(CPUSPARCState, fpr[i]), - fregnames[i]); - } } void sparc_restore_state_to_opc(CPUState *cs, From patchwork Sat Mar 2 05:15:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777497 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695053wrn; Fri, 1 Mar 2024 21:20:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXHQsr0cmMxnedZfKHxx6URMPahxl8dR0HtMDqROkbfzOcBNGJ5o1Ol43dRCwtwV6z/uwn24r5veUE5NxMTJnhg X-Google-Smtp-Source: AGHT+IE4IFv8XH+IHemdmPwLVTaKjUz6Z2JstMeKhU8Yy/b55KJAo9HxNTSItvHYActrRJioXEco X-Received: by 2002:a05:620a:5e02:b0:788:193b:1283 with SMTP id xz2-20020a05620a5e0200b00788193b1283mr1008581qkn.19.1709356843155; Fri, 01 Mar 2024 21:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356843; cv=none; d=google.com; s=arc-20160816; b=xF6QR1sBqjrZucLKCWaihrqJfxn2vqtc8FnPRxHHo8DP74b7f7Xn5G+Ymm8E4Hcrh1 JGOR4axV5WE2ulZtuD3EnIi7PxKNnnGZ/h0LNWxKZAG7e5HMsQr5rr4v5C7YHkrubZMR 1V+Pew/xe6V8eGAIIgOWBAUz/MxuAlMkQ5sslEu9TGpwSvHTXWPK7zNMK6YkB1+BdLdj MUWN8r3CreJFLin9zno3LvpVE7Bkouy8WD09kHR7a9U0UK8hh4aBQ1egl4nHjW0Voij4 recf4vuGHjOvGqhlQKeb5uIq0gbXOUKYSSj/5M14OmkpDWrWX30gSIOsXT8jUGQtn/UT tW1g== 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=TFEdg7NNQgrayWD3SI3BgIOCHtplkk9gYK46g8nra+g=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=y2btxCaoFfZ+E/xMF7e5NujooZ1hrCT9yAubO8pS2j5+8tONL/4+5EdV/wFNbuzO8E z9s2Ym3tcgGmJY7azEa8seT5pRvB8j16/hn09MiIACrUsNWc9yXySO85hzm5qvY6jJMk 9IF/T49q+hqFa91bE8q+xahhx8Ib5dLlpUKezea753EhXyBzaTTeHU7/sG28m8ssVLtf lQNj0lWnUEHsIsPvvncT6PO10IkBC5Y+pAVc9DRf5bJ/BVmAnB0nnLOLS1ya5lEwaXFi sBK0MGBBHMzHLKLrR4f02cHMlvgG8/Ovt6thc+2K3MGAcnOAeOn6UEeLYzkKsM5XKtwZ ZvAw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=G0PRaYXx; 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 11-20020ad45b8b000000b00690047c614esi5042670qvp.593.2024.03.01.21.20.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:20:43 -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=G0PRaYXx; 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 1rgHjm-0002V5-L5; Sat, 02 Mar 2024 00:16:42 -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 1rgHjj-0002UU-Qb for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:39 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjV-0007Vd-Vx for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:39 -0500 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-5d8b519e438so2577351a12.1 for ; Fri, 01 Mar 2024 21:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356584; x=1709961384; 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=TFEdg7NNQgrayWD3SI3BgIOCHtplkk9gYK46g8nra+g=; b=G0PRaYXxD58R7+6KMBxs53LCV4yY4ZAu9FN0Zy3cIzRjIOsH0KIfkF6ju+IStmwz1u 4ZFVZwoS+t4TdtkP5B/8yuRTDNHnB4wG65IFONprNFAhXTjOjq7Ozhza/4FxwfCtO6jE q4eWWPXuVq94BsSpU+QCKAMdC0t3OZTTY6pikOtmP/5P438BlG+UrP/zLp3zx4yomxWJ E6cCIo75j6rxWhpfIBfRohn8cJIEWKP3FrohKCZZiWyloCuO/XoUIufWp0g9nGjYET7f 7VzZceIllGzChOMe5vIoYrQFm5fuMT2R7Ts6pyuB8LgxXPkwZLfujelfrKm7PnCQFEaf VFwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356584; x=1709961384; 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=TFEdg7NNQgrayWD3SI3BgIOCHtplkk9gYK46g8nra+g=; b=Hlm4Nxnu0VXy5NAM5JpwqsoHVuslPwlHT2SYURfe7fGFV/cHMOBX+xUG+8i6VG+Smj UXVUrBu3SWdcUs0JMTexy4FWvwMKlLXLo3QwZ9nwnwo8OUx/TrkxcHbeO7Px6B5BsHW9 tkkZGsgMr1eW7EUGnRzXJy0sXSpWhE3IQPwQpPMQWfqHIpDHRjSe7e7LMANYoVtOZul4 Hgb3dCiUu6R7BbGMkRxYEp+Deuuu34CbN4mh4CxHig1odwF+0ePk7gvJL/PG0lM5dMBq dDuDcCmLUMbOFeL5TCVFuiduyk693bteAW6T1hYem+qGlL3S6KW0K66Zcpv3hOHCJwAe 3o5w== X-Gm-Message-State: AOJu0Yy5EME1FMynwt6QIVnvRCE3YWM2BKkZANx9UQVgnzwydK72YCdX MtHK47vkMddKxEVMewiGxcpox+WxD2ZT0V6udpmRWufHU1JrJPsgNtv1JEPdAK2kpfkG9fciTHA Q X-Received: by 2002:a05:6a20:244d:b0:1a1:461a:331b with SMTP id t13-20020a056a20244d00b001a1461a331bmr1031194pzc.18.1709356584664; Fri, 01 Mar 2024 21:16:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 11/41] target/sparc: Use gvec for VIS1 parallel add/sub Date: Fri, 1 Mar 2024 19:15:31 -1000 Message-Id: <20240302051601.53649-12-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::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=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=no 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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 981d9d9101..ee3da73551 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4645,6 +4645,20 @@ static bool do_dfd(DisasContext *dc, arg_r_r_r *a, TRANS(FMUL8x16, VIS1, do_dfd, a, gen_helper_fmul8x16) +static bool do_gvec_ddd(DisasContext *dc, arg_r_r_r *a, MemOp vece, + void (*func)(unsigned, uint32_t, uint32_t, + uint32_t, uint32_t, uint32_t)) +{ + func(vece, gen_offset_fpr_D(a->rd), gen_offset_fpr_D(a->rs1), + gen_offset_fpr_D(a->rs2), 8, 8); + return advance_pc(dc); +} + +TRANS(FPADD16, VIS1, do_gvec_ddd, a, MO_16, tcg_gen_gvec_add) +TRANS(FPADD32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_add) +TRANS(FPSUB16, VIS1, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sub) +TRANS(FPSUB32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sub) + static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -4665,10 +4679,6 @@ static bool do_ddd(DisasContext *dc, arg_r_r_r *a, TRANS(FMUL8SUx16, VIS1, do_ddd, a, gen_helper_fmul8sux16) TRANS(FMUL8ULx16, VIS1, do_ddd, a, gen_helper_fmul8ulx16) -TRANS(FPADD16, VIS1, do_ddd, a, tcg_gen_vec_add16_i64) -TRANS(FPADD32, VIS1, do_ddd, a, tcg_gen_vec_add32_i64) -TRANS(FPSUB16, VIS1, do_ddd, a, tcg_gen_vec_sub16_i64) -TRANS(FPSUB32, VIS1, do_ddd, a, tcg_gen_vec_sub32_i64) TRANS(FNORd, VIS1, do_ddd, a, tcg_gen_nor_i64) TRANS(FANDNOTd, VIS1, do_ddd, a, tcg_gen_andc_i64) TRANS(FXORd, VIS1, do_ddd, a, tcg_gen_xor_i64) From patchwork Sat Mar 2 05:15:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777485 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694655wrn; Fri, 1 Mar 2024 21:18:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXjQofIhDftVphmjFR+uvcYQyQ56HVC2zENcHnjcCaTXv1N3qxFObJxTeHvJgVHX8rz0lCv9MK6NdnHoJE4RGlr X-Google-Smtp-Source: AGHT+IEoky1UrmHpVpFC1I9H+aWDwhYMQ4w2gLLlrILjNrJkiPWt0BIknmJh9aC48S3mgW6iKLXu X-Received: by 2002:a05:620a:1659:b0:787:6de6:cc64 with SMTP id c25-20020a05620a165900b007876de6cc64mr4413545qko.12.1709356739775; Fri, 01 Mar 2024 21:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356739; cv=none; d=google.com; s=arc-20160816; b=FixMpSO2obx1zIfIwNtvDR9he0legokaHjzkKfUEyHo4PHllJN/9/ne+VB/phLi4RE I7qHKTGHYsOzXysErE754xKYEZ5qt7keUgMoHY1m+CXRCG+RfHj4GIH6IXWFTImBC/1E 7JIiUYQAy8iEdmAFWTF0DPgx84MaskVpc+vPk/L59nwzZTcIFouFV3RgjZq4RZ3651xi r+OHQwjW1zH/EMvKV7qJGx9l9p+HTq83jE4bkK3gPu0ug9Ha9FEjcHZodqIj3jFIWgo7 GKhMSL3oeOgzOJO5qxiwJ5oCItTeqhLq7eAC3TP1iteajkMP6WH+ZR0H52K7SKSUs0Lo RsfA== 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=Dr6ncL5iBt4P85Tf/c0iqr6saqm7tCicZhRGl3n5Ps4=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=Uo9kRRdZYZ0ClWYNlCpmEQp7lcvLvwDwmcErOoAgovmR7a26CjzSZsB6yyAkBMhP3n 7BHwI4W7VYyq8BRUcmT2lhHfY0Zgf2/vjMEzCFmtZogPJffwT1ZGBq5qF1kE+GpynSYF GeNDjec2wnfeAGNncUklsz+U63bGSk1Fw4/g6OZnMJ68o/q9BEMGMPsMdCmG2gNe3jL4 QiFPe59lnifTYzUP8FdpQyxNb+cHLuYCt8dhSV9OvoShe4urtdGmoP4Rslw5/+GiZszd VxRGB0lI57fBK4ObYLvIgqZkF5wnJZ7PqK267nhlrlZAwpWgkESDM7UG2fDs2zuq3Ubi 3wtw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rCRCG+07; 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 wl21-20020a05620a57d500b00787c5a36a7bsi5155532qkn.611.2024.03.01.21.18.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:59 -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=rCRCG+07; 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 1rgHjb-0002Rj-SO; Sat, 02 Mar 2024 00:16:31 -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 1rgHja-0002RU-2r for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:30 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjX-0007Vi-VK for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:29 -0500 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so2315233a12.1 for ; Fri, 01 Mar 2024 21:16:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356586; x=1709961386; 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=Dr6ncL5iBt4P85Tf/c0iqr6saqm7tCicZhRGl3n5Ps4=; b=rCRCG+07vcDI3w2ogE84E0CT7OKOaq/W24COstK56pp7DtqObgj/scbKdNdliduja+ /T2RdJ4jAWdgKqIJ73IQUgG3uhNZJOo6xCq6ReC+48qElGcme9hpHpg3sTlUAVyk32Kl a2Jl3T5W4tAzzbOCvatRARls7v0gLmu4GFu8OHRsf6erzOEsh5epKX24rhoMv3/rC1nW kHaXBDvKHYUvtsjoxOMtOQciCb7d6MhpGK6VpJf/tIDaD7p4AGIU9U1qFCFuzoiR7SKV QZjjftGhf+lqLfWdhdzuIZ/nW69QwFQ20+kw1LXWkkiUO5EC2V0VV5CyM8roL2ToD8Db uTmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356586; x=1709961386; 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=Dr6ncL5iBt4P85Tf/c0iqr6saqm7tCicZhRGl3n5Ps4=; b=bSKia7TEN7SvBKWztIWiuUVx+jFaJRdErw4AnAHlA2wcDULFp3rEqDeoydv4Q1W7PW VbFsONRbD3s3alrluuXUeLCRzm4gU87VTAD4pAzz3nK9nV5nM8X0NBN81Fdbiq496MRP ObCN2tE5G+modtnJcUgs3VwTG+RNKgffQfqt2EUFDztTFExmH/gHZV6C8VEWXQnBwj7t rvaDUGiu1WG/3qsd/wqgTYS1e0epg0UfTS/P4tRQ54p6scy/l3Vn14QI+O9x8TaKk/86 Wva9jtc6ESTHp/fBS1HTlN4dBsM189P0oMT1baFCcxYl+OEEKtYFN5NKGXK1R9NLodnu CZXg== X-Gm-Message-State: AOJu0YzABDidu0Kt9PFwCpklwXmWcEJ8IENgDR9cQuUR2KjahvssLqK+ dxWH2bfzrGmtjiqc2LP2vm8K979+b3EuCMMv7YrGeOeldvvSnRms5T6yinCJyA9rFZEr8hUh9tw 4 X-Received: by 2002:a05:6a21:3989:b0:1a1:4491:7ff6 with SMTP id ad9-20020a056a21398900b001a144917ff6mr2332008pzc.41.1709356586294; Fri, 01 Mar 2024 21:16:26 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 12/41] target/sparc: Implement FMAf extension Date: Fri, 1 Mar 2024 19:15:32 -1000 Message-Id: <20240302051601.53649-13-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::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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 Rearrange PDIST so that do_dddd is general purpose and may be re-used for FMADDd etc. Signed-off-by: Richard Henderson --- target/sparc/helper.h | 2 + linux-user/elfload.c | 1 + target/sparc/cpu.c | 3 ++ target/sparc/fop_helper.c | 16 +++++++ target/sparc/translate.c | 84 ++++++++++++++++++++++++++++++++-- target/sparc/cpu-feature.h.inc | 1 + target/sparc/insns.decode | 23 +++++++++- 7 files changed, 124 insertions(+), 6 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index f0576fb748..63ae398841 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -53,6 +53,7 @@ DEF_HELPER_FLAGS_3(faddd, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fsubd, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fmuld, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fdivd, TCG_CALL_NO_WG, f64, env, f64, f64) +DEF_HELPER_FLAGS_5(fmaddd, TCG_CALL_NO_WG, f64, env, f64, f64, f64, i32) DEF_HELPER_FLAGS_3(faddq, TCG_CALL_NO_WG, i128, env, i128, i128) DEF_HELPER_FLAGS_3(fsubq, TCG_CALL_NO_WG, i128, env, i128, i128) @@ -63,6 +64,7 @@ DEF_HELPER_FLAGS_3(fadds, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fsubs, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fmuls, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fdivs, TCG_CALL_NO_WG, f32, env, f32, f32) +DEF_HELPER_FLAGS_5(fmadds, TCG_CALL_NO_WG, f32, env, f32, f32, f32, i32) DEF_HELPER_FLAGS_3(fsmuld, TCG_CALL_NO_WG, f64, env, f32, f32) DEF_HELPER_FLAGS_3(fdmulq, TCG_CALL_NO_WG, i128, env, f64, f64) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 6041270f1c..5ebf2bf789 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -997,6 +997,7 @@ static uint32_t get_elf_hwcap(void) r |= features & CPU_FEATURE_FSMULD ? HWCAP_SPARC_FSMULD : 0; r |= features & CPU_FEATURE_VIS1 ? HWCAP_SPARC_VIS : 0; r |= features & CPU_FEATURE_VIS2 ? HWCAP_SPARC_VIS2 : 0; + r |= features & CPU_FEATURE_FMAF ? HWCAP_SPARC_FMAF : 0; #endif return r; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 313ebc4c11..491e627899 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -551,6 +551,7 @@ static const char * const feature_name[] = { [CPU_FEATURE_BIT_HYPV] = "hypv", [CPU_FEATURE_BIT_VIS1] = "vis1", [CPU_FEATURE_BIT_VIS2] = "vis2", + [CPU_FEATURE_BIT_FMAF] = "fmaf", #else [CPU_FEATURE_BIT_MUL] = "mul", [CPU_FEATURE_BIT_DIV] = "div", @@ -873,6 +874,8 @@ static Property sparc_cpu_properties[] = { CPU_FEATURE_BIT_VIS1, false), DEFINE_PROP_BIT("vis2", SPARCCPU, env.def.features, CPU_FEATURE_BIT_VIS2, false), + DEFINE_PROP_BIT("fmaf", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_FMAF, false), #else DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features, CPU_FEATURE_BIT_MUL, false), diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c index 1205a599ef..1de44d79c1 100644 --- a/target/sparc/fop_helper.c +++ b/target/sparc/fop_helper.c @@ -343,6 +343,22 @@ Int128 helper_fsqrtq(CPUSPARCState *env, Int128 src) return f128_ret(ret); } +float32 helper_fmadds(CPUSPARCState *env, float32 s1, + float32 s2, float32 s3, uint32_t op) +{ + float32 ret = float32_muladd(s1, s2, s3, op, &env->fp_status); + check_ieee_exceptions(env, GETPC()); + return ret; +} + +float64 helper_fmaddd(CPUSPARCState *env, float64 s1, + float64 s2, float64 s3, uint32_t op) +{ + float64 ret = float64_muladd(s1, s2, s3, op, &env->fp_status); + check_ieee_exceptions(env, GETPC()); + return ret; +} + static uint32_t finish_fcmp(CPUSPARCState *env, FloatRelation r, uintptr_t ra) { check_ieee_exceptions(env, ra); diff --git a/target/sparc/translate.c b/target/sparc/translate.c index ee3da73551..1178fca9e3 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -29,6 +29,7 @@ #include "exec/helper-gen.h" #include "exec/translator.h" #include "exec/log.h" +#include "fpu/softfloat.h" #include "asi.h" #define HELPER_H "helper.h" @@ -1151,6 +1152,52 @@ static void gen_op_fabsq(TCGv_i128 dst, TCGv_i128 src) tcg_gen_concat_i64_i128(dst, l, h); } +static void gen_op_fmadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2, TCGv_i32 s3) +{ + gen_helper_fmadds(d, tcg_env, s1, s2, s3, tcg_constant_i32(0)); +} + +static void gen_op_fmaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) +{ + gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(0)); +} + +static void gen_op_fmsubs(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2, TCGv_i32 s3) +{ + int op = float_muladd_negate_c; + gen_helper_fmadds(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); +} + +static void gen_op_fmsubd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) +{ + int op = float_muladd_negate_c; + gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); +} + +static void gen_op_fnmsubs(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2, TCGv_i32 s3) +{ + int op = float_muladd_negate_c | float_muladd_negate_result; + gen_helper_fmadds(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); +} + +static void gen_op_fnmsubd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) +{ + int op = float_muladd_negate_c | float_muladd_negate_result; + gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); +} + +static void gen_op_fnmadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2, TCGv_i32 s3) +{ + int op = float_muladd_negate_result; + gen_helper_fmadds(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); +} + +static void gen_op_fnmaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) +{ + int op = float_muladd_negate_result; + gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); +} + static void gen_op_fpexception_im(DisasContext *dc, int ftt) { /* @@ -2093,6 +2140,7 @@ static int extract_qfpreg(DisasContext *dc, int x) # define avail_MUL(C) true # define avail_POWERDOWN(C) false # define avail_64(C) true +# define avail_FMAF(C) ((C)->def->features & CPU_FEATURE_FMAF) # define avail_GL(C) ((C)->def->features & CPU_FEATURE_GL) # define avail_HYPV(C) ((C)->def->features & CPU_FEATURE_HYPV) # define avail_VIS1(C) ((C)->def->features & CPU_FEATURE_VIS1) @@ -2105,6 +2153,7 @@ static int extract_qfpreg(DisasContext *dc, int x) # define avail_MUL(C) ((C)->def->features & CPU_FEATURE_MUL) # define avail_POWERDOWN(C) ((C)->def->features & CPU_FEATURE_POWERDOWN) # define avail_64(C) false +# define avail_FMAF(C) false # define avail_GL(C) false # define avail_HYPV(C) false # define avail_VIS1(C) false @@ -4762,25 +4811,52 @@ static bool trans_FsMULd(DisasContext *dc, arg_r_r_r *a) return advance_pc(dc); } -static bool do_dddd(DisasContext *dc, arg_r_r_r *a, +static bool do_ffff(DisasContext *dc, arg_r_r_r_r *a, + void (*func)(TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32)) +{ + TCGv_i32 dst, src1, src2, src3; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + + src1 = gen_load_fpr_F(dc, a->rs1); + src2 = gen_load_fpr_F(dc, a->rs2); + src3 = gen_load_fpr_F(dc, a->rs3); + dst = tcg_temp_new_i32(); + func(dst, src1, src2, src3); + gen_store_fpr_F(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(FMADDs, FMAF, do_ffff, a, gen_op_fmadds) +TRANS(FMSUBs, FMAF, do_ffff, a, gen_op_fmsubs) +TRANS(FNMSUBs, FMAF, do_ffff, a, gen_op_fnmsubs) +TRANS(FNMADDs, FMAF, do_ffff, a, gen_op_fnmadds) + +static bool do_dddd(DisasContext *dc, arg_r_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) { - TCGv_i64 dst, src0, src1, src2; + TCGv_i64 dst, src1, src2, src3; if (gen_trap_ifnofpu(dc)) { return true; } dst = tcg_temp_new_i64(); - src0 = gen_load_fpr_D(dc, a->rd); src1 = gen_load_fpr_D(dc, a->rs1); src2 = gen_load_fpr_D(dc, a->rs2); - func(dst, src0, src1, src2); + src3 = gen_load_fpr_D(dc, a->rs3); + func(dst, src1, src2, src3); gen_store_fpr_D(dc, a->rd, dst); return advance_pc(dc); } TRANS(PDIST, VIS1, do_dddd, a, gen_helper_pdist) +TRANS(FMADDd, FMAF, do_dddd, a, gen_op_fmaddd) +TRANS(FMSUBd, FMAF, do_dddd, a, gen_op_fmsubd) +TRANS(FNMSUBd, FMAF, do_dddd, a, gen_op_fnmsubd) +TRANS(FNMADDd, FMAF, do_dddd, a, gen_op_fnmaddd) static bool do_env_qqq(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i128, TCGv_env, TCGv_i128, TCGv_i128)) diff --git a/target/sparc/cpu-feature.h.inc b/target/sparc/cpu-feature.h.inc index d800f18c4e..a30b9255b2 100644 --- a/target/sparc/cpu-feature.h.inc +++ b/target/sparc/cpu-feature.h.inc @@ -12,3 +12,4 @@ FEATURE(ASR17) FEATURE(CACHE_CTRL) FEATURE(POWERDOWN) FEATURE(CASA) +FEATURE(FMAF) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 2c23868fc3..6d5fa26e90 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -29,6 +29,7 @@ CALL 01 i:s30 %dfp_rd 25:5 !function=extract_dfpreg %dfp_rs1 14:5 !function=extract_dfpreg %dfp_rs2 0:5 !function=extract_dfpreg +%dfp_rs3 9:5 !function=extract_dfpreg %qfp_rd 25:5 !function=extract_qfpreg %qfp_rs1 14:5 !function=extract_qfpreg @@ -80,6 +81,11 @@ CALL 01 i:s30 @q_d2 .. ..... ...... ..... . ........ ..... \ &r_r rd=%qfp_rd rs=%dfp_rs2 +&r_r_r_r rd rs1 rs2 rs3 +@r_r_r_r .. rd:5 ...... rs1:5 rs3:5 .... rs2:5 &r_r_r_r +@d_d_d_d .. ..... ...... ..... ..... .... ..... \ + &r_r_r_r rd=%dfp_rd rs1=%dfp_rs1 rs2=%dfp_rs2 rs3=%dfp_rs3 + { [ STBAR 10 00000 101000 01111 0 0000000000000 @@ -394,7 +400,8 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPACK32 10 ..... 110110 ..... 0 0011 1010 ..... @d_d_d FPACK16 10 ..... 110110 00000 0 0011 1011 ..... @d_d2 FPACKFIX 10 ..... 110110 00000 0 0011 1101 ..... @d_d2 - PDIST 10 ..... 110110 ..... 0 0011 1110 ..... @d_d_d + PDIST 10 ..... 110110 ..... 0 0011 1110 ..... \ + &r_r_r_r rd=%dfp_rd rs1=%dfp_rd rs2=%dfp_rs1 rs3=%dfp_rs2 FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @d_d_d FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @d_r_r @@ -448,7 +455,19 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ NCP 10 ----- 110110 ----- --------- ----- # v8 CPop1 } -NCP 10 ----- 110111 ----- --------- ----- # v8 CPop2 +{ + [ + FMADDs 10 ..... 110111 ..... ..... 0001 ..... @r_r_r_r + FMADDd 10 ..... 110111 ..... ..... 0010 ..... @d_d_d_d + FMSUBs 10 ..... 110111 ..... ..... 0101 ..... @r_r_r_r + FMSUBd 10 ..... 110111 ..... ..... 0110 ..... @d_d_d_d + FNMSUBs 10 ..... 110111 ..... ..... 1001 ..... @r_r_r_r + FNMSUBd 10 ..... 110111 ..... ..... 1010 ..... @d_d_d_d + FNMADDs 10 ..... 110111 ..... ..... 1101 ..... @r_r_r_r + FNMADDd 10 ..... 110111 ..... ..... 1110 ..... @d_d_d_d + ] + NCP 10 ----- 110111 ----- --------- ----- # v8 CPop2 +} ## ## Major Opcode 11 -- load and store instructions From patchwork Sat Mar 2 05:15:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777475 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694447wrn; Fri, 1 Mar 2024 21:18:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUQQI3fbp9zlpxE4/4Bkds13qjLPHFKvkxihohMnuyFkMFl1t46UYcJmjjGxAWxRb0pihxGWuN8w9mHWuKhkVrF X-Google-Smtp-Source: AGHT+IH9jx3wZc/40i8D8en38CrAAaj0TiBsQ/nIBmeAFolX0PK588khWY2+qo4bVfBNBPTPYd6e X-Received: by 2002:a05:6870:6b8d:b0:220:c30d:75e1 with SMTP id ms13-20020a0568706b8d00b00220c30d75e1mr3355943oab.2.1709356689657; Fri, 01 Mar 2024 21:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356689; cv=none; d=google.com; s=arc-20160816; b=zWjkuY3E2KZkRqmpL7scd4rNi/t4e8z0Cq4DjxR95m1ZfmVqwXHJrudB+iyWsfw8jl SgmYquEa4FJZ/3j/j1sXb6xtuFaOGDPK6TuG1qY4c77HKvXrneF8nA9OJ4VIhEztXJho pXIuLxeSTqdozFYiMQ14I4aEZFTmUaHj6V/PFwZSxfn4uJjlM9Pi9BrqA9736O7LIXzQ xd2FXqNJwC9nPxrBKzQunC/fgiB75dMfZiwe7MDD03EVJqwzw6rR2hwOMEccB5jvhd7u oEL5vwswncuEuavVuLULgGemQXjHxCVHjYmyBoqLMHwlL7U019onKUhvejVMiLgrD3d7 7wxA== 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=Y3Nnlz9fN+sLTLi0nggXUUY0sOM/rMTIsEeRdpJ4n4M=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=vAVos4290Wrq+wVL9aeuYhfCfSyirTKLlnJCwvW/nKJZkC4G6WK/11I8PJiiNAiaat rVcGp7VJp/v8v33wQrtSm6xknzShn2d1jYFWad8mUQEJJNn3qB+Jqtk2j78oH+NtCDhN +fCrUVyFLlDdBb0/rpN2deeesxmM5TSXHBjxQRK4jtUHon1CPUla4/hBahTcShSwFkcV iSMhNYWsuevGoXfhOi40sBjrZ3FTaQoy7gAYxjZrmzSQe5C4BmzG2vVYwE6MtuDwQry1 zdgoObpY1CY4OCqqsDsXNd+GnkXyRmlK1sHQx8b56HK8PkEuNEjY6YKUiIWpFc50+t7T ZsgA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BgTFTbTr; 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 q20-20020a05622a031400b0042e5ac5b52csi5394399qtw.382.2024.03.01.21.18.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:09 -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=BgTFTbTr; 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 1rgHjd-0002Si-Ju; Sat, 02 Mar 2024 00:16:33 -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 1rgHjc-0002Ry-7b for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:32 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHja-0007W5-P5 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:31 -0500 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5d8b887bb0cso2416652a12.2 for ; Fri, 01 Mar 2024 21:16:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356588; x=1709961388; 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=Y3Nnlz9fN+sLTLi0nggXUUY0sOM/rMTIsEeRdpJ4n4M=; b=BgTFTbTr6IYBfH9p+YElkWMm6UG+PA742OCBGFr6ui0cRxV4AxW/Guo00LxvQewOJn DOYUbQ375UHv/iCso0e69GrooGioizUJYgBjsDKPLsRFPUy6v7sTg6yB0bScXLUo9pRK RQwQ3lyFXD99jptFqqpKRJldGc8lJNBvHftzihqb77nRd9unRgkt/HwvgZa5a4A6uwtV mtDOraBLnKV/hv5DfbPExoPmcrJZPcP+3+0V7R5DQHpgDbiIEVDKxQw/AVwjUMK23MrR rfdgfseMixPoq2Z/UPqpCRDjrwiqIO8RPdrFMz3gWNgcbTqZ81AwhzieVF5mmgkB8Tgl Y+IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356588; x=1709961388; 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=Y3Nnlz9fN+sLTLi0nggXUUY0sOM/rMTIsEeRdpJ4n4M=; b=LyPC7yCcKd+I/3VCSFHulYiwlnaI3DTev1rSCfpEqKx+iUfNg4yh0RCCcd50p5HBhD QCqVOrmD7ktVO7LmGD6A6+74//rGOw5jc6FoeDHcpJsBRF4wvdpVYqfwO95D8eZa/4fj demj8hZS139Lg2kgzYZLNDv3mbd/mdN2OPcieAP22xcTFF0F6gD8CL8CyRSsUnHOEX9o FI7X6lA9fPiYxoatAI0yTTqme/3Ke+tc0N2uwNGUe8dtyyDEwYAhYnERVuGYaDOtWXJu 1oPlm8DioCgeEnqCD46hriY7nZgqz1eVJCqaJC63fe4L5u0JPJYLDOQG3Vih408LfzFK nYJw== X-Gm-Message-State: AOJu0Yw0W3Pu9vicz9vCjR8BY9+ZXsngmthD90k8CMaZ6guN+gXCnuTl 3uZx3OOwDJdMEsoZdEMJ9gVN2mU7MZIB9UFDobhm6TKmpp48T3blMzRiz/BkZrFDzhq5LXMKDG8 h X-Received: by 2002:a05:6a20:748a:b0:1a1:4794:9134 with SMTP id p10-20020a056a20748a00b001a147949134mr635230pzd.28.1709356588257; Fri, 01 Mar 2024 21:16:28 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 13/41] target/sparc: Add feature bits for VIS 3 Date: Fri, 1 Mar 2024 19:15:33 -1000 Message-Id: <20240302051601.53649-14-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::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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 The manual separates VIS 3 and VIS 3B, even though they are both present in all extant cpus. For clarity, let the translator match the manual but otherwise leave them on the same feature bit. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 4 ++++ target/sparc/cpu-feature.h.inc | 1 + 2 files changed, 5 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 1178fca9e3..0ebb9c3aa9 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2145,6 +2145,8 @@ static int extract_qfpreg(DisasContext *dc, int x) # define avail_HYPV(C) ((C)->def->features & CPU_FEATURE_HYPV) # define avail_VIS1(C) ((C)->def->features & CPU_FEATURE_VIS1) # define avail_VIS2(C) ((C)->def->features & CPU_FEATURE_VIS2) +# define avail_VIS3(C) ((C)->def->features & CPU_FEATURE_VIS3) +# define avail_VIS3B(C) avail_VIS3(C) #else # define avail_32(C) true # define avail_ASR17(C) ((C)->def->features & CPU_FEATURE_ASR17) @@ -2158,6 +2160,8 @@ static int extract_qfpreg(DisasContext *dc, int x) # define avail_HYPV(C) false # define avail_VIS1(C) false # define avail_VIS2(C) false +# define avail_VIS3(C) false +# define avail_VIS3B(C) false #endif /* Default case for non jump instructions. */ diff --git a/target/sparc/cpu-feature.h.inc b/target/sparc/cpu-feature.h.inc index a30b9255b2..3913fb4a54 100644 --- a/target/sparc/cpu-feature.h.inc +++ b/target/sparc/cpu-feature.h.inc @@ -13,3 +13,4 @@ FEATURE(CACHE_CTRL) FEATURE(POWERDOWN) FEATURE(CASA) FEATURE(FMAF) +FEATURE(VIS3) From patchwork Sat Mar 2 05:15:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777480 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694539wrn; Fri, 1 Mar 2024 21:18:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVi9mA0Vo/6ls+Xazj4Z1+Bhv17mq2drwvG0xHmX3r4R9WsACprxPOh36MhyqNi6A4BpvjLwN0ZH0UrqSnMOzk/ X-Google-Smtp-Source: AGHT+IGBxcFoRRHE69BI3Bd2LPaIKZ6knhqMXZ3O61uolhGnz78fLuJNYhMMIoTiZz74JIODuYle X-Received: by 2002:a0c:cb8d:0:b0:68f:c56a:c823 with SMTP id p13-20020a0ccb8d000000b0068fc56ac823mr3634789qvk.47.1709356709936; Fri, 01 Mar 2024 21:18:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356709; cv=none; d=google.com; s=arc-20160816; b=q7YOkFuO5/xH5/2yK/ooV8UldCJnzHPsJkPp2ghEOMMSu8yTWBvA1JiwMQ8q7TLOHR SxYlv9+xI2s4GmG6wpV9agS7fSeHhXKnAcdwvvRtLAhBDo0LZkIsL3cnxs6G9C3KFDb1 HRtr5Rr1brSDzXyLcMvk+RDgayd6FWQB4pFBJUkgWy8GEq64LZe1A38UBkK+wQ6CuDNW /Ah5ucIhkxXw9vdh6NlX67m5RS5KwHInkSW3+4n0X05AutUnOvueUIP7WPRxQP71Pyu2 eX6q1AKeZN/Hatbl6bbS43ts+6zQuIFBrAZu7il0QFA4w4ZKp+/kZKiuZAxbwCoFLC09 sXOw== 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=J8HyamXhbkNWazMUAhxBGWQB1mar+xWfEVCvqZkv23k=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=1JY9DXLbc576zFkjYF0qeART+2YClKFzWi1EXudNl3X7XiV1daTacUiwTQ0/8XhOcc Z1DVnS4L5mxJ24RvhS4T4LH3tNGY3Ak2mkniazrS124MlTVH54VyDq1sA+IkX3HFMgLa dZZS2jkIsEnjXhNBAJPEubZ2o809aOiunAPi+p6OEigkWXndBlLXWYCd3N8L26ZrM3Gz jl3rRy1dE3UDXtQEU+OSVz+pLe+AG364vpPcHKOOWnys8jfKLk+oOr+jW/CFbTreG4it vGdXVLsSw/RAGwkczuqvgD0EuIZXh+0RyuJM7boENgBySAeukrulnQ50CXNOlbOHGRlH q1og==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kWuRIlY1; 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 kj15-20020a056214528f00b0068cba3feed6si4976140qvb.507.2024.03.01.21.18.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:29 -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=kWuRIlY1; 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 1rgHje-0002TA-Vt; Sat, 02 Mar 2024 00:16:35 -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 1rgHjd-0002Sd-EB for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:33 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjb-0007WE-Fn for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:33 -0500 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6e58a984ea1so2075917b3a.2 for ; Fri, 01 Mar 2024 21:16:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356590; x=1709961390; 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=J8HyamXhbkNWazMUAhxBGWQB1mar+xWfEVCvqZkv23k=; b=kWuRIlY1kecl596CAO1HFovaTx221835Zxq6zazEO/5dmyq2jw8Dx9VYNTuLdAnZAL zH2PKluOVPDwJXs4pKkzmO6YwZiYn7hDZm/6MOIdvZEWfZEN1kBuA0AxZNS9+9Op/GYZ jF1DnetI01lZq3vBZg/qQjdjoipKYljUUP7PTpTTRWbTECvvtZ3GOEBujE/Nj+fMMxv/ ro/kR2fC8L8Iho8fVBnJ+q5Ag9Y7uM6zwG/PFzdcRJzPFUq3KImCECW0VeqYJ7XYDs3W fmgxd2IplM2KdyGIiVfpOWhQa359MN90H7SZRPNeiF8QHKg6FiqJE5AhwRfESdSkS7dJ /QGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356590; x=1709961390; 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=J8HyamXhbkNWazMUAhxBGWQB1mar+xWfEVCvqZkv23k=; b=GjOBWRLFlb+LQq2ZO7iosJlqjFq5Tk6OrsBpGh9hUq3oY/AS0MeqhVTz7VYIP+/sgO opNjndkXCgOS7/jAx0C6l5NgUxVv8seFYRQimEqELbYVn7zrTT+3dnEqirHrpMaWJIx1 0mg9NoUdB1bHF6lUDZwmSv5yHfbU9wMYGrkUcm8cn3qMO8PV3XA+pPhriFfKnbsf4f/l l21vHqj6CrZv3fZJ53cfFuu5QaAL6rPmhHA1MkviNpsXcuq9N92QReMz0K//ZNVakuEY MflPH5EmntODoIsXend3YvylhO4aPrtnPAFjK7o/VObab3+SkY4rigIThawM4g+FhMlw lrqQ== X-Gm-Message-State: AOJu0YyOF8NT6UGl8cZXz2EfZpPnznhK5q1SgCkG07iVFjWOemwsP/SS g5gMY74GwmuBhPfoaYmZNjXKFB6OvICDecgdXUHrw4WzUlgURVGFP9hgQkAuzZfIX7ceymNBOcK N X-Received: by 2002:a05:6a21:339f:b0:1a0:e3c7:963d with SMTP id yy31-20020a056a21339f00b001a0e3c7963dmr3626858pzb.23.1709356589877; Fri, 01 Mar 2024 21:16:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 14/41] target/sparc: Implement ADDXC, ADDXCcc Date: Fri, 1 Mar 2024 19:15:34 -1000 Message-Id: <20240302051601.53649-15-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 14 ++++++++++++++ target/sparc/insns.decode | 3 +++ 2 files changed, 17 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 0ebb9c3aa9..0b6d92d0a8 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -442,6 +442,17 @@ static void gen_op_addccc(TCGv dst, TCGv src1, TCGv src2) gen_op_addcc_int(dst, src1, src2, gen_carry32()); } +static void gen_op_addxc(TCGv dst, TCGv src1, TCGv src2) +{ + tcg_gen_add_tl(dst, src1, src2); + tcg_gen_add_tl(dst, dst, cpu_cc_C); +} + +static void gen_op_addxccc(TCGv dst, TCGv src1, TCGv src2) +{ + gen_op_addcc_int(dst, src1, src2, cpu_cc_C); +} + static void gen_op_subcc_int(TCGv dst, TCGv src1, TCGv src2, TCGv cin) { TCGv z = tcg_constant_tl(0); @@ -3673,6 +3684,9 @@ TRANS(ARRAY8, VIS1, do_rrr, a, gen_helper_array8) TRANS(ARRAY16, VIS1, do_rrr, a, gen_op_array16) TRANS(ARRAY32, VIS1, do_rrr, a, gen_op_array32) +TRANS(ADDXC, VIS3, do_rrr, a, gen_op_addxc) +TRANS(ADDXCcc, VIS3, do_rrr, a, gen_op_addxccc) + static void gen_op_alignaddr(TCGv dst, TCGv s1, TCGv s2) { #ifdef TARGET_SPARC64 diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 6d5fa26e90..07796b8fe2 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -376,6 +376,9 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ ARRAY16 10 ..... 110110 ..... 0 0001 0010 ..... @r_r_r ARRAY32 10 ..... 110110 ..... 0 0001 0100 ..... @r_r_r + ADDXC 10 ..... 110110 ..... 0 0001 0001 ..... @r_r_r + ADDXCcc 10 ..... 110110 ..... 0 0001 0011 ..... @r_r_r + ALIGNADDR 10 ..... 110110 ..... 0 0001 1000 ..... @r_r_r ALIGNADDRL 10 ..... 110110 ..... 0 0001 1010 ..... @r_r_r From patchwork Sat Mar 2 05:15:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777468 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694259wrn; Fri, 1 Mar 2024 21:17:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU8N/sP5kPZhiFfHaxbJKfOebeNO/HrFxwiNRYlpgrSiOQxB459Tp0QxkPexaF7aBl9SnBM4VqE0BPrUJkkB+DA X-Google-Smtp-Source: AGHT+IEwucCiRU9IeWnG2NdAZAU+nqUvB6do/KUekzKIyJQyM1G55cHxLBA8p81Jx2I9F3KABekL X-Received: by 2002:ac8:7c49:0:b0:42e:d2f0:57c4 with SMTP id o9-20020ac87c49000000b0042ed2f057c4mr2701842qtv.30.1709356645658; Fri, 01 Mar 2024 21:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356645; cv=none; d=google.com; s=arc-20160816; b=xmFjYVGq5aVdEzSI6BMr+fhNV5/iCEAGpyvJcvdjPbmAU8JXSgB0V/hPeHyQfnhIQL u9lFginYob+tGC3LynCRUTovX03TnrgbYf6PuKdE1SF4X4hSY5YljcXMZcJEQaPBHV1X ZgWSaAmCXN/obSnhsAnbX4yjR+As2QZiSf9o+RGnaH4cMLTgyXPI1zM/csSu3CNwHQuH JMwDmYQ+lZLj19nwriqomwCOGId7zDduYf1rMb7Tvzqlp/QWzQ7dYodfW2toBInkwAiO tocNJyn5yTFrNWyGUDxRN1d7YRhdnqc+7jCnXAKLb2RREn/6FDxYfhl334KtLHmB5YKt HzGg== 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=DPAeEx8+OxTe6Jw89kVULRnihVdAWVU7ziAjkLxIIcU=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=zaRjvw+ZpGmU1+/H59o3Da2kCuJcmvZZ0YAmPXUwAOZOQkmnml5stlbGEAUUmQ+lmt mkNBU/OklrKHF4oPOx/k653BHoVEoKRW3PG3YrC8tHnmp8h2alfOQT+H9asLuAZ9WGRP jxbRh2DBy+yrDhrS6SBzyVUMELPkPRj/wWHtypu288CysTkDbYpJ3wji2bPmPWygllq8 guJ7dEEF+o1c2IppGwaGGh7kOCMRBX0W6a9+NZdb1+8gyAiqM6Vg7wHtkeLsEaWyAv1M VryAHR1LrzFrm+eV9aSi76GJ3N6lcbirrxUM8SEOQ0qtkW/uXbMsfpU2uy8N1+SlvFDg Baqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Rewhh8jA; 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 l7-20020a05622a174700b0042edcf7dde6si411504qtk.271.2024.03.01.21.17.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:17: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=pass header.i=@linaro.org header.s=google header.b=Rewhh8jA; 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 1rgHjh-0002Td-9Q; Sat, 02 Mar 2024 00:16:37 -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 1rgHje-0002T0-PN for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:34 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjc-0007WQ-V4 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:34 -0500 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6e5a50d91b4so2350560b3a.2 for ; Fri, 01 Mar 2024 21:16:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356591; x=1709961391; 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=DPAeEx8+OxTe6Jw89kVULRnihVdAWVU7ziAjkLxIIcU=; b=Rewhh8jATkwe3MmbhIAEZeGwUG+QYxDULpq7S1SoXR1QX7HSJgKprkG6IJ4ioGI6Mc DbEoNY0fdqUcwg3LncyJ9Y4TMItbpHasounK9yon0ptKU0V43QNkYg4ApgQSA5s71Fvl Pi0xF05ii3nHWjX7dKFBGk9SPOo7uxA5MI/Q/ZO79V0WTPG7Bk+F3YELCLG36Fg7CRpI ZkX/eHQmNO3NQofb9VGSWv8w5NEjFQ7lNwA461g6+zY8qY1Eu8UkplO1FilIGO8fSAXo TTAIjlBLrjRUQT9pdIe11ttU3ZbLAqizahabKtXF8W1oB2dgaQjlOmLlr54GzrDjS34S RFyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356591; x=1709961391; 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=DPAeEx8+OxTe6Jw89kVULRnihVdAWVU7ziAjkLxIIcU=; b=So+6M52zx2IizpPruyau8zZE36OgqkJOYCVYlZ183JkYuAt92gFOyNsz5OcUf2ORq3 PgW0E2/k226HYsWvc4Gn+l4Br5COfGa43AFkt+bOmQGXz71ZOwrPkWrb/VrlXTSqcfJS 9gvIz6ZE660axWezx5HM5i2EU7EpDMJO57Ol+agsG8H99I2WhtGInIKsnSA9RrIJSaze v8Ajw2jPPQRmUQslbnSIiyTkrNUM8Ne5Q+OGDC5dN9XuLb7n1JSuH8TybrywzEpWPtNC gpe8jhEdYf6EuE/5EijSh17xGkCPDT2ABBhyq8eH6mSzGKLOPFv6SPoQcM7QSyKCN8Su 2/iA== X-Gm-Message-State: AOJu0YxFVUgwHPXsqDbSpQrwxojpVaCTOsmN11tmg7J5js9FTWFLIFqy NRuTcaBqXOkgtgXwJ3lf8GDukmh5D4+Zt+vkJ0Rik0nax5g0/9jqs/yvifPnvO3Ct6HBXxA04OZ m X-Received: by 2002:a05:6a20:7d84:b0:1a0:ef1e:a658 with SMTP id v4-20020a056a207d8400b001a0ef1ea658mr3780731pzj.11.1709356591535; Fri, 01 Mar 2024 21:16:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 15/41] target/sparc: Implement CMASK instructions Date: Fri, 1 Mar 2024 19:15:35 -1000 Message-Id: <20240302051601.53649-16-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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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 | 3 +++ target/sparc/translate.c | 13 +++++++++++++ target/sparc/vis_helper.c | 38 ++++++++++++++++++++++++++++++++++++++ target/sparc/insns.decode | 4 ++++ 4 files changed, 58 insertions(+) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 63ae398841..9cd9a81f03 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -104,6 +104,9 @@ DEF_HELPER_FLAGS_2(fpack16, TCG_CALL_NO_RWG_SE, i32, i64, i64) DEF_HELPER_FLAGS_3(fpack32, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) DEF_HELPER_FLAGS_2(fpackfix, TCG_CALL_NO_RWG_SE, i32, i64, i64) DEF_HELPER_FLAGS_3(bshuffle, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) +DEF_HELPER_FLAGS_2(cmask8, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(cmask16, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(cmask32, TCG_CALL_NO_RWG_SE, i64, i64, i64) #define VIS_CMPHELPER(name) \ DEF_HELPER_FLAGS_2(f##name##16, TCG_CALL_NO_RWG_SE, \ i64, i64, i64) \ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 0b6d92d0a8..fd85fd3e97 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -62,6 +62,9 @@ # define gen_helper_write_softint(E, S) qemu_build_not_reached() # define gen_helper_wrpil(E, S) qemu_build_not_reached() # define gen_helper_wrpstate(E, S) qemu_build_not_reached() +# define gen_helper_cmask8 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_cmask16 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_cmask32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpeq16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpeq32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpgt16 ({ qemu_build_not_reached(); NULL; }) @@ -3729,6 +3732,16 @@ static void gen_op_bmask(TCGv dst, TCGv s1, TCGv s2) TRANS(BMASK, VIS2, do_rrr, a, gen_op_bmask) +static bool do_cmask(DisasContext *dc, int rs2, void (*func)(TCGv, TCGv, TCGv)) +{ + func(cpu_gsr, cpu_gsr, gen_load_gpr(dc, rs2)); + return true; +} + +TRANS(CMASK8, VIS3, do_cmask, a->rs2, gen_helper_cmask8) +TRANS(CMASK16, VIS3, do_cmask, a->rs2, gen_helper_cmask16) +TRANS(CMASK32, VIS3, do_cmask, a->rs2, gen_helper_cmask32) + static bool do_shift_r(DisasContext *dc, arg_shiftr *a, bool l, bool u) { TCGv dst, src1, src2; diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index e15c6bb34e..0278caa25d 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -334,3 +334,41 @@ uint64_t helper_bshuffle(uint64_t gsr, uint64_t src1, uint64_t src2) return r.ll; } + +uint64_t helper_cmask8(uint64_t gsr, uint64_t src) +{ + uint32_t mask = 0; + + mask |= (src & 0x01 ? 0x00000007 : 0x0000000f); + mask |= (src & 0x02 ? 0x00000060 : 0x000000e0); + mask |= (src & 0x04 ? 0x00000500 : 0x00000d00); + mask |= (src & 0x08 ? 0x00004000 : 0x0000c000); + mask |= (src & 0x10 ? 0x00030000 : 0x000b0000); + mask |= (src & 0x20 ? 0x00200000 : 0x00a00000); + mask |= (src & 0x40 ? 0x01000000 : 0x09000000); + mask |= (src & 0x80 ? 0x00000000 : 0x80000000); + + return deposit64(gsr, 32, 32, mask); +} + +uint64_t helper_cmask16(uint64_t gsr, uint64_t src) +{ + uint32_t mask = 0; + + mask |= (src & 0x1 ? 0x00000067 : 0x000000ef); + mask |= (src & 0x2 ? 0x00004500 : 0x0000cd00); + mask |= (src & 0x4 ? 0x00230000 : 0x00ab0000); + mask |= (src & 0x8 ? 0x01000000 : 0x89000000); + + return deposit64(gsr, 32, 32, mask); +} + +uint64_t helper_cmask32(uint64_t gsr, uint64_t src) +{ + uint32_t mask = 0; + + mask |= (src & 0x1 ? 0x00004567 : 0x0000cdef); + mask |= (src & 0x2 ? 0x01230000 : 0x89ab0000); + + return deposit64(gsr, 32, 32, mask); +} diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 07796b8fe2..8f298ca675 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -384,6 +384,10 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ BMASK 10 ..... 110110 ..... 0 0001 1001 ..... @r_r_r + CMASK8 10 00000 110110 00000 0 0001 1011 rs2:5 + CMASK16 10 00000 110110 00000 0 0001 1101 rs2:5 + CMASK32 10 00000 110110 00000 0 0001 1111 rs2:5 + FPCMPLE16 10 ..... 110110 ..... 0 0010 0000 ..... @r_d_d FPCMPNE16 10 ..... 110110 ..... 0 0010 0010 ..... @r_d_d FPCMPGT16 10 ..... 110110 ..... 0 0010 1000 ..... @r_d_d From patchwork Sat Mar 2 05:15:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777467 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694258wrn; Fri, 1 Mar 2024 21:17:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVMQOnjW/rQ3OxceWvSg5yjWOlUkuIcMWEQmRR7jewGTIVzY//u0VaMXeTZv4KE+XocZL6GVijyHykIcWt/qmZU X-Google-Smtp-Source: AGHT+IHR4l0a6gKgH9x5LRhSkDRn26850ttTTdiAKv34FlzTe/p7XLuiT7WUDiRwEFPXkvO75jQj X-Received: by 2002:ac8:7fca:0:b0:42e:b2de:48cc with SMTP id b10-20020ac87fca000000b0042eb2de48ccmr4166076qtk.36.1709356645633; Fri, 01 Mar 2024 21:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356645; cv=none; d=google.com; s=arc-20160816; b=R5gDBMuGWYqKW5Q8AjN8LL39AIh1JZxf1p00LqtzNbSANy3VzIaJuwzJY+VKChN46s D8LianSnITENVSBHMt2h2yA6Xwqr4EN/fJ21BR/5xYv+IgYI+V0MmK1a5KDqPgJn7Ehr KVptZfnJtWtX1qFoOiKtXzHBLEfB04qw+E5LvknVuxAf2Go03hWFGUVbkJhVfwXq0lCM NYTxaFh+K23FLWoa0hYbf0K0dD9l43aFzssBmesTyT5QZ1OhpMUPOtijEnjpDj7tj9nD F5IkvcqLNtUGVZLwe+HNSU4coRxAupxlQHed3ynlefwu718+sJ4B84tvV8kA1zuctrii vRSw== 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=kQ3I8rYu6VW67Fi6xxt1l88oe9BrbgSqjwmsi4V6ivk=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=ZdFWbH++F9R1TcMt7oppFwXR7QxTEQQVx0ZzEtph3ph/nTxQXwsWs2967TUmEVymaI uyZKgllv7STy5WLmMIfE7211Lp7KI1B+e5swj5nhksOv848bEmw2EX2eHcOwOtN66c7h dH8Y+qzmJL28GppNObKMeCm+UpSi5a2b2Qkv1KnpsWTm+TaKwXLIPd0zL90syduU5+Da 1q2PbDQj8DQz+Iahvh+dr0flDJwLOyAep0b1fDuzrKpn8++kaCA2ynPRzgC41UJ/W+3h iJF4UEOOrH1FyXzFz/NlWy3w4eReRYZ5WT1dQJhiiSOHHMCkKcqcLZjzS54VCbyecCkk YLtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VpOlyCOl; 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 gm9-20020a056214268900b0068fd9fa7b83si4975560qvb.25.2024.03.01.21.17.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:17: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=pass header.i=@linaro.org header.s=google header.b=VpOlyCOl; 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 1rgHji-0002Tm-04; Sat, 02 Mar 2024 00:16:38 -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 1rgHjg-0002TU-HA for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:36 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHje-0007Wg-EB for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:35 -0500 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6e5c81ccfb9so931907b3a.3 for ; Fri, 01 Mar 2024 21:16:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356593; x=1709961393; 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=kQ3I8rYu6VW67Fi6xxt1l88oe9BrbgSqjwmsi4V6ivk=; b=VpOlyCOl6ztEFJ3zazGNuRE/fis4O8QjagNPMyYQ/zegtZw5x6st35zpHl4MVav7eE LwDyCdqFRzmfBSUhuOgPUlnCF6BlRs3S1OEiAucqXIPdz7NiQDOL9q7ZX0gBUB6cD6Zs TQiDXV5zEIKJUdLqK+OLcjUKDKPApNQ+5bAlnBRtGQXocV5Jv5dbDqPExA9JqhWyeHw+ TOHIDWGPJs+/8DQYAazghu40+tMlAGLLa9l9AwmbBz9N2YcMVUGPD1fPRKJpH99MpjzX M5IMe62cnBvUaQxVArS1paGnxyLjpENwmvOC4AqHZXJcAyqJqmZw/sU/8bVqwcprYPLF 7GAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356593; x=1709961393; 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=kQ3I8rYu6VW67Fi6xxt1l88oe9BrbgSqjwmsi4V6ivk=; b=UOkP5CO0npxmJjfcnE0Aa7DGXSQGLYOSoDTF5nFfDlccSZqIXrg2liIXsimfG5CMzE /nwYx3HCjWeUP4RDti6ohFb4MdvQ46vZOmDm9K3bRdjQkig5zSXt3WELzYtw0sDtNkm7 AvssJpZSkxbgAtm5oQ1+JJ0tgyl3XQSB54B3DbYBCwVaIZZ25D++e16YbRc+QcSyOmFX snlOIkzrr+wm1ubcHNluw7hJayz7AR2T449Fz03YUaCwmpiHwCdn+SrUfE6x/2TqN2by keYaxGOgBejl734jTFfgUZMiT9nO1K/yhBNd5+XWwyle/R7CZ4OmfLozDeDWElYBE67b bFjA== X-Gm-Message-State: AOJu0YwpI214MXLyQItH2hdTLSvT/7B+Fl3BV9g6nZxPu+aYRqd8RxQ4 jk518VBgT+9XH7hVNI40u2exICltk3JwoPveR4e6KyClzrlQwZaUr5rfmTAGhxpN7X06NIvHBrm L X-Received: by 2002:a05:6a20:6aa1:b0:1a1:2cba:baf2 with SMTP id bi33-20020a056a206aa100b001a12cbabaf2mr2779640pzb.52.1709356593250; Fri, 01 Mar 2024 21:16:33 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 16/41] target/sparc: Implement FCHKSM16 Date: Fri, 1 Mar 2024 19:15:36 -1000 Message-Id: <20240302051601.53649-17-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 | 1 + target/sparc/translate.c | 32 ++++++++++++++++++++++++++++++++ target/sparc/vis_helper.c | 23 +++++++++++++++++++++++ target/sparc/insns.decode | 1 + 4 files changed, 57 insertions(+) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 9cd9a81f03..37b22afd7f 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -107,6 +107,7 @@ DEF_HELPER_FLAGS_3(bshuffle, TCG_CALL_NO_RWG_SE, i64, i64, i64, i64) DEF_HELPER_FLAGS_2(cmask8, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(cmask16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(cmask32, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fchksm16, TCG_CALL_NO_RWG_SE, i64, i64, i64) #define VIS_CMPHELPER(name) \ DEF_HELPER_FLAGS_2(f##name##16, TCG_CALL_NO_RWG_SE, \ i64, i64, i64) \ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index fd85fd3e97..d6adbf9236 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -797,6 +797,37 @@ static void gen_op_fmuld8sux16(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) tcg_gen_concat_i32_i64(dst, t0, t1); } +#ifdef TARGET_SPARC64 +static void gen_vec_fchksm16(unsigned vece, TCGv_vec dst, + TCGv_vec src1, TCGv_vec src2) +{ + TCGv_vec a = tcg_temp_new_vec_matching(dst); + TCGv_vec c = tcg_temp_new_vec_matching(dst); + + tcg_gen_add_vec(vece, a, src1, src2); + tcg_gen_cmp_vec(TCG_COND_LTU, vece, c, a, src1); + /* Vector cmp produces -1 for true, so subtract to add carry. */ + tcg_gen_sub_vec(vece, dst, a, c); +} + +static void gen_op_fchksm16(unsigned vece, uint32_t dofs, uint32_t aofs, + uint32_t bofs, uint32_t oprsz, uint32_t maxsz) +{ + static const TCGOpcode vecop_list[] = { + INDEX_op_cmp_vec, INDEX_op_add_vec, INDEX_op_sub_vec, + }; + static const GVecGen3 op = { + .fni8 = gen_helper_fchksm16, + .fniv = gen_vec_fchksm16, + .opt_opc = vecop_list, + .vece = MO_16, + }; + tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &op); +} +#else +#define gen_op_fchksm16 ({ qemu_build_not_reached(); NULL; }) +#endif + static void finishing_insn(DisasContext *dc) { /* @@ -4738,6 +4769,7 @@ TRANS(FPADD16, VIS1, do_gvec_ddd, a, MO_16, tcg_gen_gvec_add) TRANS(FPADD32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_add) TRANS(FPSUB16, VIS1, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sub) TRANS(FPSUB32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sub) +TRANS(FCHKSM16, VIS3, do_gvec_ddd, a, MO_16, gen_op_fchksm16) static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 0278caa25d..c627bb1a1f 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -372,3 +372,26 @@ uint64_t helper_cmask32(uint64_t gsr, uint64_t src) return deposit64(gsr, 32, 32, mask); } + +static inline uint16_t do_fchksm16(uint16_t src1, uint16_t src2) +{ + uint16_t a = src1 + src2; + uint16_t c = a < src1; + return a + c; +} + +uint64_t helper_fchksm16(uint64_t src1, uint64_t src2) +{ + VIS64 r, s1, s2; + + s1.ll = src1; + s2.ll = src2; + r.ll = 0; + + r.VIS_W64(0) = do_fchksm16(s1.VIS_W64(0), s2.VIS_W64(0)); + r.VIS_W64(1) = do_fchksm16(s1.VIS_W64(1), s2.VIS_W64(1)); + r.VIS_W64(2) = do_fchksm16(s1.VIS_W64(2), s2.VIS_W64(2)); + r.VIS_W64(3) = do_fchksm16(s1.VIS_W64(3), s2.VIS_W64(3)); + + return r.ll; +} diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 8f298ca675..120713a28f 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -410,6 +410,7 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ PDIST 10 ..... 110110 ..... 0 0011 1110 ..... \ &r_r_r_r rd=%dfp_rd rs1=%dfp_rd rs2=%dfp_rs1 rs3=%dfp_rs2 + FCHKSM16 10 ..... 110110 ..... 0 0100 0100 ..... @d_d_d FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @d_d_d FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @d_r_r BSHUFFLE 10 ..... 110110 ..... 0 0100 1100 ..... @d_d_d From patchwork Sat Mar 2 05:15:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777490 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694747wrn; Fri, 1 Mar 2024 21:19:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVGmUBoAZjIYHNOtDVY4Rrk4wISyMRhWbdZRGsq+fvIu7VrNDy925t3Fjc4TCVb2LrMs9/hpf68CGyecaI/D7Yb X-Google-Smtp-Source: AGHT+IFYJYiEHdRRK0AwB0GFRhXrlnknbVcoECRgYCVFQfFUwIrEcJdghD+ppbgmPhx+RXqjOXq7 X-Received: by 2002:a05:622a:118b:b0:42e:d2de:aedc with SMTP id m11-20020a05622a118b00b0042ed2deaedcmr2717371qtk.42.1709356759990; Fri, 01 Mar 2024 21:19:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356759; cv=none; d=google.com; s=arc-20160816; b=H9Q1kFJP5dFYN2GXTu7EADzYRJ3GPjKNoMKJ/wiZiQzbMMUpdcBiIfUzjV4fhkCvOB ITDahflRJEyR9BXJLVXysx05/eWmKyqor1XSjdj+4srcdtN2Q5fM8jVj+BXpUpIBDz5e xufpOeLOh7S5b99R9tb4enJDmblXv7gTSUKM3/d2xZQntlujcOAUxl2LckB9z5w2508C 56JkWN4/MyqrTXcUUpQiocciOrX9OfdzGGn7r+raxkYaK9APm0my5nq/2iN0bSrenfnC nTL/KmB12Rmmw1x02seu1zJCngakwKPqsjxKAsnl6t0ONNcrAVvD2MI8Cw4i8DjTXpCk 2VXg== 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=O3lhfoCFirnepvvopi9QZLqqlY2uYLR9Y0owrTZTqqw=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=mfki8vq7K0TU9KZaTC8vSzVkvwosxT/tHbSowcVuEP9jPr14E6ljuVtThOyP+CfdNE gGcFhxkBvyFJHiWVFTfrTsKhSQYFFYHWBaKuE3VQNxxusWlt+T04a0vrFGl3VSseVCYL UjTSR0SbW4XzTPjVpcm0Z5Hje+EbCtvNWyj97b9xiaE+TalQ0Trq7Q079wtcTmysmJoM GRrXiSVkJDd4sXbARY3OrWaAs0yHVsUYmbNH1SwMhd0IHz5XY4pZU5KB8BpYviSJwfbI +K15OmrUTMhF1rP5IvuxJUj6MGUM09CwyBSB9DniczqQIUj4XPNJ1dFasqlUysR9bKS2 4M2A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jI7caolP; 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-20020ac851cf000000b0042c4aa6aa46si4820601qtn.186.2024.03.01.21.19.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:19: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=jI7caolP; 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 1rgHjk-0002Uk-Lo; Sat, 02 Mar 2024 00:16:40 -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 1rgHjh-0002Tk-Ro for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:37 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjg-0007YE-76 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:37 -0500 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5cddfe0cb64so2091985a12.0 for ; Fri, 01 Mar 2024 21:16:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356595; x=1709961395; 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=O3lhfoCFirnepvvopi9QZLqqlY2uYLR9Y0owrTZTqqw=; b=jI7caolP6WyFVgO6P1owrw8Mcg0jYzK3zU6cbUubREpcvFBLDoa1l0f9UusPmct1d2 xwpCah/vJG2KzZlfko7h0ZE3usvJaRCOo5MlmLOo9SEQCvyN4XOySdmY6RkOFtWPB+ns BEPNMD8zIbH2AXG6goizUxnRc9gEnnhN8yxE9DS20attdS4IJ93YvSApG/EQSvKnUgpV asMpNlkupisgN/vv1w7Yd1B77Y51YaB0gUhy1GIfevLaYzSwehTQ2KA/9kDtF2uWRgNB vYNdRVaCLQ0vI9ahc32Vo3Mc7zIYXHw6Dwox737JtB7Ry3prq753C7OYAfUfjJ6HwWLt AMWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356595; x=1709961395; 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=O3lhfoCFirnepvvopi9QZLqqlY2uYLR9Y0owrTZTqqw=; b=fTCX75madc5aTHim6KxU8S8tznaQtJ+zUKdQq6WrbRJQD4XgGtQSKwK/bIFvcbdDiw K5uU/EbiDkSvkue2peMUrq8YwelJ5vNpMMscww4Sf0eWrbhXaedxSXh/cpOVP3jTVJ4F a5T/N9mRQjAeeEO7zqv5W/9u18yYT/HfoCBwgwStzhHMXMZps0808+imgYWgviMIbKw7 53nfp7pZwPurmtcaFRxVVbYZ5ntm5AYLlnx/i4pK8SQf9raahISMzspneh1lMpoaTw5g g5NXfLktXFtC0DgDF3JQbqWaOPeVAlLPF+bW7p10GjNUHBUlU5jtzEsvXuLfYdXP/Dwu Id4g== X-Gm-Message-State: AOJu0Yzaqduwa9f8+djfeF1+nBV3rjQPLwWoa5xwHNsnY1e5vsOeK9N2 bUQiKVqG/W2MfmxydAaBGNSuDr04X08AJHHlHBQ6L01xABpPsVGZJKuxVoPtt40WYZDkByCVWb9 1 X-Received: by 2002:a05:6a20:1607:b0:1a1:3b27:4f40 with SMTP id l7-20020a056a20160700b001a13b274f40mr3434898pzj.10.1709356595014; Fri, 01 Mar 2024 21:16:35 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 17/41] target/sparc: Implement FHADD, FHSUB, FNHADD, FNADD Date: Fri, 1 Mar 2024 19:15:37 -1000 Message-Id: <20240302051601.53649-18-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::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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/translate.c | 70 +++++++++++++++++++++++++++++++++++++++ target/sparc/insns.decode | 8 +++++ 2 files changed, 78 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index d6adbf9236..877847b884 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1243,6 +1243,66 @@ static void gen_op_fnmaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2, TCGv_i64 s3) gen_helper_fmaddd(d, tcg_env, s1, s2, s3, tcg_constant_i32(op)); } +/* Use muladd to compute (1 * src1) + src2 / 2 with one rounding. */ +static void gen_op_fhadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) +{ + TCGv_i32 one = tcg_constant_i32(float32_one); + int op = float_muladd_halve_result; + gen_helper_fmadds(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); +} + +static void gen_op_fhaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2) +{ + TCGv_i64 one = tcg_constant_i64(float64_one); + int op = float_muladd_halve_result; + gen_helper_fmaddd(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); +} + +/* Use muladd to compute (1 * src1) - src2 / 2 with one rounding. */ +static void gen_op_fhsubs(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) +{ + TCGv_i32 one = tcg_constant_i32(float32_one); + int op = float_muladd_negate_c | float_muladd_halve_result; + gen_helper_fmadds(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); +} + +static void gen_op_fhsubd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2) +{ + TCGv_i64 one = tcg_constant_i64(float64_one); + int op = float_muladd_negate_c | float_muladd_halve_result; + gen_helper_fmaddd(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); +} + +/* Use muladd to compute -((1 * src1) + src2 / 2) with one rounding. */ +static void gen_op_fnhadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) +{ + TCGv_i32 one = tcg_constant_i32(float32_one); + int op = float_muladd_negate_result | float_muladd_halve_result; + gen_helper_fmadds(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); +} + +static void gen_op_fnhaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2) +{ + TCGv_i64 one = tcg_constant_i64(float64_one); + int op = float_muladd_negate_result | float_muladd_halve_result; + gen_helper_fmaddd(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); +} + +/* Use muladd to compute -((1 * src1) + src2). */ +static void gen_op_fnadds(TCGv_i32 d, TCGv_i32 s1, TCGv_i32 s2) +{ + TCGv_i32 one = tcg_constant_i32(float32_one); + int op = float_muladd_negate_result; + gen_helper_fmadds(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); +} + +static void gen_op_fnaddd(TCGv_i64 d, TCGv_i64 s1, TCGv_i64 s2) +{ + TCGv_i64 one = tcg_constant_i64(float64_one); + int op = float_muladd_negate_result; + gen_helper_fmaddd(d, tcg_env, one, s1, s2, tcg_constant_i32(op)); +} + static void gen_op_fpexception_im(DisasContext *dc, int ftt) { /* @@ -4691,6 +4751,11 @@ TRANS(FXNORs, VIS1, do_fff, a, tcg_gen_eqv_i32) TRANS(FORNOTs, VIS1, do_fff, a, tcg_gen_orc_i32) TRANS(FORs, VIS1, do_fff, a, tcg_gen_or_i32) +TRANS(FHADDs, VIS3, do_fff, a, gen_op_fhadds) +TRANS(FHSUBs, VIS3, do_fff, a, gen_op_fhsubs) +TRANS(FNHADDs, VIS3, do_fff, a, gen_op_fnhadds) +TRANS(FNADDs, VIS3, do_fff, a, gen_op_fnadds) + static bool do_env_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_env, TCGv_i32, TCGv_i32)) { @@ -4804,6 +4869,11 @@ TRANS(FPACK32, VIS1, do_ddd, a, gen_op_fpack32) TRANS(FALIGNDATAg, VIS1, do_ddd, a, gen_op_faligndata) TRANS(BSHUFFLE, VIS2, do_ddd, a, gen_op_bshuffle) +TRANS(FHADDd, VIS3, do_ddd, a, gen_op_fhaddd) +TRANS(FHSUBd, VIS3, do_ddd, a, gen_op_fhsubd) +TRANS(FNHADDd, VIS3, do_ddd, a, gen_op_fnhaddd) +TRANS(FNADDd, VIS3, do_ddd, a, gen_op_fnaddd) + static bool do_rdd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv, TCGv_i64, TCGv_i64)) { diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 120713a28f..dc524f5b8f 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -307,8 +307,16 @@ FMULq 10 ..... 110100 ..... 0 0100 1011 ..... @q_q_q FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @r_r_r FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @d_d_d FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @q_q_q +FNADDs 10 ..... 110100 ..... 0 0101 0001 ..... @r_r_r +FNADDd 10 ..... 110100 ..... 0 0101 0010 ..... @d_d_d +FHADDs 10 ..... 110100 ..... 0 0110 0001 ..... @r_r_r +FHADDd 10 ..... 110100 ..... 0 0110 0010 ..... @d_d_d +FHSUBs 10 ..... 110100 ..... 0 0110 0101 ..... @r_r_r +FHSUBd 10 ..... 110100 ..... 0 0110 0110 ..... @d_d_d FsMULd 10 ..... 110100 ..... 0 0110 1001 ..... @d_r_r FdMULq 10 ..... 110100 ..... 0 0110 1110 ..... @q_d_d +FNHADDs 10 ..... 110100 ..... 0 0111 0001 ..... @r_r_r +FNHADDd 10 ..... 110100 ..... 0 0111 0010 ..... @d_d_d FsTOx 10 ..... 110100 00000 0 1000 0001 ..... @r_r2 FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_d2 FqTOx 10 ..... 110100 00000 0 1000 0011 ..... @r_q2 From patchwork Sat Mar 2 05:15:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777493 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694858wrn; Fri, 1 Mar 2024 21:19:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWBpNQQNHuXoJBCo9Y4GA3EnJd5oSiZH+TK5SeQtRXgKBmhjJY1S1S1DvtVoBK/3AOsG8IrT5sIuuKUR+B9JD24 X-Google-Smtp-Source: AGHT+IGstVnpy/nac81Ae9At8iWR+oaBmQ3BpUr0b0Ho7vcG3mC+Dh+GzNP6CVoQEpgHWVHlKBIu X-Received: by 2002:ac8:58cd:0:b0:42e:ded3:9b3b with SMTP id u13-20020ac858cd000000b0042eded39b3bmr100990qta.31.1709356794514; Fri, 01 Mar 2024 21:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356794; cv=none; d=google.com; s=arc-20160816; b=T2hYbkvo8pLO3iJmlyuvov0PgudBnEznUE5VpJnj1TkN41wIwu+Ux1I2QorQ0O+EZk dzvP2AQuGAVI3gU+lW3uSESibAhVB9mOvjnWtx1iMmRvqZ9rMHitSI5qYV9cN7SV62Wt E6oaY53dS92jv8r7vtpx0BEdIgOMSgUopZdoL5UVlsMq/FWKKYT20TK0VpzMH+6uqgtM ijoFeGIUHMP9YzticEuyw6FmSfngk8Nwa4Sfng81vUaBPGXh/zLfkC6ka+nte0wVVjVH nhENzJj31UvpKt69QOZrcwVSBkD9Bbr1mtQDIqV7Z8qGrWFHaWLBeT6Aw/JY4hbs+r1G uSAg== 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=W+nsfbkq/6DuQu47ZwF+ORMIIrl2dVJeM+BgUxIZLGY=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=FloOkb0j+AzbJ+tEZMEE+YHzk4IJ52XEoUWkK2lVaP57QlpW1GPwrynj/r98DDCI7E Ge/DxQox0gHRTI8jjC7pNJJI0aeWd0bQ3K5iK+YRM1NcO2Qve/jPVgQo7HAiYpoOWcK9 TvIddcmKrvTpslYhBXmmwxtqVjbpg1fChNozFF6bfswIbBy7PP1T89nYiqEcQMSt9Nlb pWJqbz2+D688aB8F9Tw55sfkPUxZxc7waVQBQHAd0Z4ODKJFOWFeFqfqJg7vrxTEbMAY WtvbUSCTL4IqfwCMONNmJLTt76RcAuG34j78h8W6v6v/GJhHbfop2yuBPgrF4IWVQ37k +ZcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rQ4QCx0u; 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 d8-20020a05621421c800b0068c558d46f1si5193248qvh.435.2024.03.01.21.19.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:19:54 -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=rQ4QCx0u; 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 1rgHjn-0002Vo-F3; Sat, 02 Mar 2024 00:16:43 -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 1rgHjl-0002Uw-B7 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:41 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHji-0007YP-IB for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:40 -0500 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-29b31254820so403411a91.0 for ; Fri, 01 Mar 2024 21:16:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356597; x=1709961397; 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=W+nsfbkq/6DuQu47ZwF+ORMIIrl2dVJeM+BgUxIZLGY=; b=rQ4QCx0u3LV4LabAR5SUmjMD1xymlIrF6+D9DkRyqGqPBAlzr8mi3Wn+hwAZ+HY6fL 5Z7vYm7rWnRuvZz7Vv60Sg5mXCXOS8wjWZnhAd3537xW7SbJ9O6AA2AOyF8CxrrFf3FT mZMcwCS6kuyFhnBnyTEIRDWZETCaOgTtJX0hvr/C9C1JJuXf25Jl/SeyLctSY1OczVxY rGZQLQAHV3L+fHgWPae1Od3xlfEB97LTV1C17LTDuSTcV1/yKxrd7lKND5ycAIgHEP19 MEZuAZNT2eoUJ+GZswe5yoLrFSzfI/dXRu24tMMLtnHdheA/fyWNKUggk691Vb/jCPx2 pEJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356597; x=1709961397; 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=W+nsfbkq/6DuQu47ZwF+ORMIIrl2dVJeM+BgUxIZLGY=; b=PZVYjrpfddncfESMwVpJUv+CnDPoNDam9fz3Bvm8/7pDLVouXxRHyXfVJmfcS3UnN2 jP6zfHI5lOpGOhbQRiPK6WSdyxQWWedxXia8YuW2nq4shietqsaxFnJT4p0P5Ld2jol4 vebOnSP/kr9AJp8lr6KRAHfzNvWzLLR4bH1Pg5zRVpdTf2QExetzqkWfXYPjFN3JOOvp iExPDxc0mXG8YM6ZekTXa8ZmksepIkp12J/Z3v0FOvru86qYP8QkdMbHhKQqdUNBvWE4 zhy0H0CCIKWJUz/oWRBWgkSoxU+wElJOIK2Ux6UipFBt7Yy50KFsFOMWYH+kYSZgLARD 8H3Q== X-Gm-Message-State: AOJu0YzfZfMpb4gEa+tpf18J5xFHXLnMUZYkXHQA+XX+8s9p65DCvV8b 2EhjqLqN0kx0wfnebawCbJSntBmFp7ttKKIYyNcKXFEkH64Hlg2VPILkteNRorAd+lOXKsk8b83 5 X-Received: by 2002:a17:90a:8c8c:b0:299:522d:9158 with SMTP id b12-20020a17090a8c8c00b00299522d9158mr3153921pjo.13.1709356597175; Fri, 01 Mar 2024 21:16:37 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 18/41] target/sparc: Implement FNMUL Date: Fri, 1 Mar 2024 19:15:38 -1000 Message-Id: <20240302051601.53649-19-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::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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 Unlike FNADD, we cannot (ab)use muladd for this operation because -0.0 * +0.0 == -0.0 -0.0 + +0.0 == +0.0 the addition step will lose the -0.0 product result before negation. Signed-off-by: Richard Henderson --- target/sparc/helper.h | 3 +++ target/sparc/fop_helper.c | 36 ++++++++++++++++++++++++++++++++++++ target/sparc/translate.c | 21 +++++++++++++++++++++ target/sparc/insns.decode | 3 +++ 4 files changed, 63 insertions(+) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 37b22afd7f..926b579e97 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -54,6 +54,7 @@ DEF_HELPER_FLAGS_3(fsubd, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fmuld, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(fdivd, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_5(fmaddd, TCG_CALL_NO_WG, f64, env, f64, f64, f64, i32) +DEF_HELPER_FLAGS_3(fnmuld, TCG_CALL_NO_WG, f64, env, f64, f64) DEF_HELPER_FLAGS_3(faddq, TCG_CALL_NO_WG, i128, env, i128, i128) DEF_HELPER_FLAGS_3(fsubq, TCG_CALL_NO_WG, i128, env, i128, i128) @@ -65,8 +66,10 @@ DEF_HELPER_FLAGS_3(fsubs, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fmuls, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fdivs, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_5(fmadds, TCG_CALL_NO_WG, f32, env, f32, f32, f32, i32) +DEF_HELPER_FLAGS_3(fnmuls, TCG_CALL_NO_WG, f32, env, f32, f32) DEF_HELPER_FLAGS_3(fsmuld, TCG_CALL_NO_WG, f64, env, f32, f32) +DEF_HELPER_FLAGS_3(fnsmuld, TCG_CALL_NO_WG, f64, env, f32, f32) DEF_HELPER_FLAGS_3(fdmulq, TCG_CALL_NO_WG, i128, env, f64, f64) DEF_HELPER_FLAGS_2(fitod, TCG_CALL_NO_WG, f64, env, s32) diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c index 1de44d79c1..ea9d4ec235 100644 --- a/target/sparc/fop_helper.c +++ b/target/sparc/fop_helper.c @@ -359,6 +359,42 @@ float64 helper_fmaddd(CPUSPARCState *env, float64 s1, return ret; } +float32 helper_fnmuls(CPUSPARCState *env, float32 src1, float32 src2) +{ + float32 ret = float32_mul(src1, src2, &env->fp_status); + + /* NaN inputs or result do not get a sign change. */ + if (!(get_float_exception_flags(&env->fp_status) & float_flag_invalid)) { + ret = float32_chs(ret); + } + check_ieee_exceptions(env, GETPC()); + return ret; +} + +float64 helper_fnmuld(CPUSPARCState *env, float64 src1, float64 src2) +{ + float64 ret = float64_mul(src1, src2, &env->fp_status); + + if (!(get_float_exception_flags(&env->fp_status) & float_flag_invalid)) { + ret = float64_chs(ret); + } + check_ieee_exceptions(env, GETPC()); + return ret; +} + +float64 helper_fnsmuld(CPUSPARCState *env, float32 src1, float32 src2) +{ + float64 ret = float64_mul(float32_to_float64(src1, &env->fp_status), + float32_to_float64(src2, &env->fp_status), + &env->fp_status); + + if (!(get_float_exception_flags(&env->fp_status) & float_flag_invalid)) { + ret = float64_chs(ret); + } + check_ieee_exceptions(env, GETPC()); + return ret; +} + static uint32_t finish_fcmp(CPUSPARCState *env, FloatRelation r, uintptr_t ra) { check_ieee_exceptions(env, ra); diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 877847b884..b3714ada6a 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4776,6 +4776,7 @@ TRANS(FADDs, ALL, do_env_fff, a, gen_helper_fadds) TRANS(FSUBs, ALL, do_env_fff, a, gen_helper_fsubs) TRANS(FMULs, ALL, do_env_fff, a, gen_helper_fmuls) TRANS(FDIVs, ALL, do_env_fff, a, gen_helper_fdivs) +TRANS(FNMULs, VIS3, do_env_fff, a, gen_helper_fnmuls) static bool do_dff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i32, TCGv_i32)) @@ -4923,6 +4924,7 @@ TRANS(FADDd, ALL, do_env_ddd, a, gen_helper_faddd) TRANS(FSUBd, ALL, do_env_ddd, a, gen_helper_fsubd) TRANS(FMULd, ALL, do_env_ddd, a, gen_helper_fmuld) TRANS(FDIVd, ALL, do_env_ddd, a, gen_helper_fdivd) +TRANS(FNMULd, VIS3, do_env_ddd, a, gen_helper_fnmuld) static bool trans_FsMULd(DisasContext *dc, arg_r_r_r *a) { @@ -4944,6 +4946,25 @@ static bool trans_FsMULd(DisasContext *dc, arg_r_r_r *a) return advance_pc(dc); } +static bool trans_FNsMULd(DisasContext *dc, arg_r_r_r *a) +{ + TCGv_i64 dst; + TCGv_i32 src1, src2; + + if (!avail_VIS3(dc)) { + return false; + } + if (gen_trap_ifnofpu(dc)) { + return true; + } + dst = tcg_temp_new_i64(); + src1 = gen_load_fpr_F(dc, a->rs1); + src2 = gen_load_fpr_F(dc, a->rs2); + gen_helper_fnsmuld(dst, tcg_env, src1, src2); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + static bool do_ffff(DisasContext *dc, arg_r_r_r_r *a, void (*func)(TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32)) { diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index dc524f5b8f..8c0df3004d 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -309,6 +309,8 @@ FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @d_d_d FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @q_q_q FNADDs 10 ..... 110100 ..... 0 0101 0001 ..... @r_r_r FNADDd 10 ..... 110100 ..... 0 0101 0010 ..... @d_d_d +FNMULs 10 ..... 110100 ..... 0 0101 1001 ..... @r_r_r +FNMULd 10 ..... 110100 ..... 0 0101 1010 ..... @d_d_d FHADDs 10 ..... 110100 ..... 0 0110 0001 ..... @r_r_r FHADDd 10 ..... 110100 ..... 0 0110 0010 ..... @d_d_d FHSUBs 10 ..... 110100 ..... 0 0110 0101 ..... @r_r_r @@ -317,6 +319,7 @@ FsMULd 10 ..... 110100 ..... 0 0110 1001 ..... @d_r_r FdMULq 10 ..... 110100 ..... 0 0110 1110 ..... @q_d_d FNHADDs 10 ..... 110100 ..... 0 0111 0001 ..... @r_r_r FNHADDd 10 ..... 110100 ..... 0 0111 0010 ..... @d_d_d +FNsMULd 10 ..... 110100 ..... 0 0111 1001 ..... @d_r_r FsTOx 10 ..... 110100 00000 0 1000 0001 ..... @r_r2 FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_d2 FqTOx 10 ..... 110100 00000 0 1000 0011 ..... @r_q2 From patchwork Sat Mar 2 05:15:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777479 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694521wrn; Fri, 1 Mar 2024 21:18:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVneJY2LD3X8zfE6iwWq2gmG7NgOJv5tpaM6hvuKbxsIiZqahOVzBlRN1c1ddO5ARPQt47iGbVl9UwLUYKN8PTL X-Google-Smtp-Source: AGHT+IFwS0CyD9jc7VoElplWjTCWHWhN0LFqSil/6K4P4xNjsfG64Lr9JMmbYqKinxCT9HbOJ/2d X-Received: by 2002:ac8:5fca:0:b0:42e:def6:3b71 with SMTP id k10-20020ac85fca000000b0042edef63b71mr64532qta.4.1709356704230; Fri, 01 Mar 2024 21:18:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356704; cv=none; d=google.com; s=arc-20160816; b=NZfMfU4RQvT2pL6vPCBgJK13ZVzot54P90RIWE2tj1w85HaC/AnX2sH2KMQXTe8Nh+ lfwqzxpu5rZvqCVAamECd97jHCzTeESwJcp/8Mb+ah88lB14uGoY22qMzuOSELne269s 1jrsybWAP38+T9v9pVl+jkGr+R5/jQvku3vHjGvwMxjC3tibYPfiH51PV0trYT0sJEfR dyvmO/SnIBfSVnd5yxk1S0urun6jyTtQ9yfp5/nyCEA49Bco8+bub7VaiTu+tV8UarUD YpFw04fQEe+uT7HwFCrcyrQohWJQQWlg+AB3hEQPzf54IcsDXi9bx2NylWxRAuIHjTuX WF1A== 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=Jb3S9sAOtWQUrtkfEVb6TzNvEgYDzIjiOKbzwuL1fFg=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=qpp3HojGidYfJpcJr7PzTFB8lln7sy+Dw+Snzc/VoOBx6wdb0dQv0iXZJnLtEgEKCN lxrjzVvcwCJrig9wnJOcJ2XYHZphWxxLXw4trUBGIWLSqqQZleDCqw3SE6mrCLBHlq5C 4DrCoyvENesjoqa6ldudhpjuDdTVMkX95b5GgmnSa7cL5Z5D6wDZaqEJFzV9RiH2hv// 7LQiIqTZuqEqRssnIGbmfa0bdR5p0jZ1Tlcfx9NzwMjLPG8b0ZmDtBAzcthAznC6Htbj VyI5Kt3r54tTtRjiRp2aIM/uSNlPTm17MU4AIR3h/tGDbhHkdDoecmnt64G0Ld8UOJto M8gg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MeF5PULG; 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 k5-20020ac85fc5000000b0042ece346980si2276658qta.265.2024.03.01.21.18.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:24 -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=MeF5PULG; 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 1rgHjp-0002W2-7J; Sat, 02 Mar 2024 00:16:45 -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 1rgHjm-0002VM-Rx for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:42 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjl-0007YY-4Q for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:42 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-29a378040daso1962549a91.1 for ; Fri, 01 Mar 2024 21:16:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356598; x=1709961398; 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=Jb3S9sAOtWQUrtkfEVb6TzNvEgYDzIjiOKbzwuL1fFg=; b=MeF5PULGGmXCDAtcZZyldTxvULj3Y4DMfmb6wTIYwe3ufpPuze3nMXJxAmYttlEps4 xly2UQBrK/E36RBTMHWDXi5LrhVdA8NmO6pUN2akgy8rGV0Qh4wgDQ1aYq+oDQeSf/0U tR1coatDsbglxr8ubPLiJ2xVCblOroOqvnpm7MAWsNRjKE4BWjJlqAo2Lc/K5dchqJAF SsBFhhZunrbE8rrAX3L1pktxgMx8UqalFsGV7LzveqAKVeL5w345q5my5bj6iHMFXbsC 2DbL+H8zPHWNT5GPdcuRI6mJkkiRvGialFAcheViiHk5vtgXDvbQgASe26RTrgVOuE1v UUMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356598; x=1709961398; 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=Jb3S9sAOtWQUrtkfEVb6TzNvEgYDzIjiOKbzwuL1fFg=; b=Ycz1RI5STZ2h4UCv1jExFzW19MXQEsQVhe4e0VZiZt+JbQz+UqhYRtniPBN8fA37+6 dGOf1fYPWoJRiqPrFXdAOSwWH3+8pV3WnIBiNMMpEYSQVsG3wwHY1QHFoAB9Ndg5t6lV gN38kE4QeCgdWd18B/Hjl4LpPiJp6j9EFvkum6giFV1SiD3s3rrQQQG+rCg8ypPmTx/B Xvyin/IeyX2htzzs/nmDGMtp1WzGoESIahIX571+LtaF1A4UuozgUvG2TkyQ/kVhYxsF 2hAkEaeHc5Oxvj8fbHrD54TXP6463nXoRNDbVKDx6vdPQVfQYJ/u3SEmWjkKZmcjO6Tw W81Q== X-Gm-Message-State: AOJu0YxsegndpulOSEWSv/7I4fOh2rF2a/jSoJxVBUsZ1gr1SIir//z2 fbigxIzBycAyq1t+7JDxuIm84g62+oZC9GIbqMF2geIZQdJIoUxEYes7e0EoHdlq00YvioeYBXr x X-Received: by 2002:a17:90a:c397:b0:29b:178e:d9cb with SMTP id h23-20020a17090ac39700b0029b178ed9cbmr3112000pjt.44.1709356598608; Fri, 01 Mar 2024 21:16:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 19/41] target/sparc: Implement FLCMP Date: Fri, 1 Mar 2024 19:15:39 -1000 Message-Id: <20240302051601.53649-20-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::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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/fop_helper.c | 46 +++++++++++++++++++++++++++++++++++++++ target/sparc/translate.c | 34 +++++++++++++++++++++++++++++ target/sparc/insns.decode | 4 ++++ 4 files changed, 86 insertions(+) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 926b579e97..97b3c24fb3 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -47,6 +47,8 @@ DEF_HELPER_FLAGS_3(fcmpd, TCG_CALL_NO_WG, i32, env, f64, f64) DEF_HELPER_FLAGS_3(fcmped, TCG_CALL_NO_WG, i32, env, f64, f64) DEF_HELPER_FLAGS_3(fcmpq, TCG_CALL_NO_WG, i32, env, i128, i128) DEF_HELPER_FLAGS_3(fcmpeq, TCG_CALL_NO_WG, i32, env, i128, i128) +DEF_HELPER_FLAGS_2(flcmps, TCG_CALL_NO_RWG_SE, i32, f32, f32) +DEF_HELPER_FLAGS_2(flcmpd, TCG_CALL_NO_RWG_SE, i32, f64, f64) DEF_HELPER_2(raise_exception, noreturn, env, int) DEF_HELPER_FLAGS_3(faddd, TCG_CALL_NO_WG, f64, env, f64, f64) diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c index ea9d4ec235..8c07442ad6 100644 --- a/target/sparc/fop_helper.c +++ b/target/sparc/fop_helper.c @@ -458,6 +458,52 @@ uint32_t helper_fcmpeq(CPUSPARCState *env, Int128 src1, Int128 src2) return finish_fcmp(env, r, GETPC()); } +uint32_t helper_flcmps(float32 src1, float32 src2) +{ + /* + * FLCMP never raises an exception nor modifies any FSR fields. + * Perform the comparison with a dummy fp environment. + */ + float_status discard = { }; + FloatRelation r = float32_compare_quiet(src1, src2, &discard); + + switch (r) { + case float_relation_equal: + if (src2 == float32_zero && src1 != float32_zero) { + return 1; /* -0.0 < +0.0 */ + } + return 0; + case float_relation_less: + return 1; + case float_relation_greater: + return 0; + case float_relation_unordered: + return float32_is_any_nan(src2) ? 3 : 2; + } + g_assert_not_reached(); +} + +uint32_t helper_flcmpd(float64 src1, float64 src2) +{ + float_status discard = { }; + FloatRelation r = float64_compare_quiet(src1, src2, &discard); + + switch (r) { + case float_relation_equal: + if (src2 == float64_zero && src1 != float64_zero) { + return 1; /* -0.0 < +0.0 */ + } + return 0; + case float_relation_less: + return 1; + case float_relation_greater: + return 0; + case float_relation_unordered: + return float64_is_any_nan(src2) ? 3 : 2; + } + g_assert_not_reached(); +} + target_ulong cpu_get_fsr(CPUSPARCState *env) { target_ulong fsr = env->fsr | env->fsr_cexc_ftt; diff --git a/target/sparc/translate.c b/target/sparc/translate.c index b3714ada6a..6dba0fcca6 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5199,6 +5199,40 @@ static bool do_fcmpq(DisasContext *dc, arg_FCMPq *a, bool e) TRANS(FCMPq, ALL, do_fcmpq, a, false) TRANS(FCMPEq, ALL, do_fcmpq, a, true) +static bool trans_FLCMPs(DisasContext *dc, arg_FLCMPs *a) +{ + TCGv_i32 src1, src2; + + if (!avail_VIS3(dc)) { + return false; + } + if (gen_trap_ifnofpu(dc)) { + return true; + } + + src1 = gen_load_fpr_F(dc, a->rs1); + src2 = gen_load_fpr_F(dc, a->rs2); + gen_helper_flcmps(cpu_fcc[a->cc], src1, src2); + return advance_pc(dc); +} + +static bool trans_FLCMPd(DisasContext *dc, arg_FLCMPd *a) +{ + TCGv_i64 src1, src2; + + if (!avail_VIS3(dc)) { + return false; + } + if (gen_trap_ifnofpu(dc)) { + return true; + } + + src1 = gen_load_fpr_D(dc, a->rs1); + src2 = gen_load_fpr_D(dc, a->rs2); + gen_helper_flcmpd(cpu_fcc[a->cc], src1, src2); + return advance_pc(dc); +} + static void sparc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) { DisasContext *dc = container_of(dcbase, DisasContext, base); diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 8c0df3004d..51a7fb62fb 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -470,6 +470,10 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FZEROs 10 rd:5 110110 00000 0 0110 0001 00000 FONEd 10 ..... 110110 00000 0 0111 1110 00000 rd=%dfp_rd FONEs 10 rd:5 110110 00000 0 0111 1111 00000 + + FLCMPs 10 000 cc:2 110110 rs1:5 1 0101 0001 rs2:5 + FLCMPd 10 000 cc:2 110110 ..... 1 0101 0010 ..... \ + rs1=%dfp_rs1 rs2=%dfp_rs2 ] NCP 10 ----- 110110 ----- --------- ----- # v8 CPop1 } From patchwork Sat Mar 2 05:15:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777486 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694718wrn; Fri, 1 Mar 2024 21:19:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWWCW4p/zPF+oMZYSNT8cECPFTnUheY+zuQBZ1G4NbodKRtiMmf3Plu69joEZVcbmWUwkt04f5opAZxYvCvHBX4 X-Google-Smtp-Source: AGHT+IFwn/YpllWNGixon+uQm9ViX+5SSuqgNbMq/KVDvQaPHznA3tA6NCDxA/vpFmddBk6vJEq8 X-Received: by 2002:a05:620a:190d:b0:787:ed1d:b96e with SMTP id bj13-20020a05620a190d00b00787ed1db96emr4589011qkb.52.1709356753284; Fri, 01 Mar 2024 21:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356753; cv=none; d=google.com; s=arc-20160816; b=e5bVxP04jDBhLMOlWbGtRL4F2echKaxOBDiDhMvnhF6KTpl5JEBxNDSez/TodNRsXh eQAtRHA8JBAg+8IUDfFVEVgg4nIps6Yttu7VLhyyxZ/1Zz0TFP0m9SI8nvZ99nw1XbUH DujNGfzLp8KZ+DCNbrpL/WuIKUB5TFkewalHRGjWaK5/tcC6HHmLOmrLCwelR0qXLxk3 9xTb3kbrD3DEXH9b1WVVLc9YSS6bPGGwW+QfAM8JDbeQFhRjq51xxvimHMfqLLCN+PS8 N6hmLPpGJ73cZXuz4yNwe2J1Oy6SkW+f7YXjBs6IKszlXLViyRWDoVoAi62SmtHlb1Vg tX/w== 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=eFgQq/tUbJgjC/SMzYSpMDPxCXRaDcih395pAQkBr2M=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=sOgdfs6ZpGe1+g/o2I74V9fHrsRWGgaZQ2OdynywFIc9CPw637JbtV07Ch79NxG2ur D6r2iBTDmX5ADCm+cRye53OS5xp1rQdsu/r8C3Lhlf0ahzSTPYrecaQnliHvraGPYSAm 8kEiVK9s9yy5oVDoAQLNpiqxAXraG634nptR5IkvF/4EH2szUdYOvo2bDpE1OWC5yQ1E ODIZIJ01XcT15mBAnNx1IMaJdigfWo/RhPdtJ6Db5MX07+lX5hUFH/El9AniJWwzQkrs PktdGIqv9mqpEO4bm+eE3Hqb+vFmCbVEs9ZMlqB2s4tzpt8SOIUIDVtO+tV2K8pcOS9Z Y4Fg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PM3BSWxx; 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 bq17-20020a05620a469100b007881d25956fsi47357qkb.82.2024.03.01.21.19.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:19:13 -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=PM3BSWxx; 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 1rgHjr-0002Wh-98; Sat, 02 Mar 2024 00:16:47 -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 1rgHjo-0002Vq-59 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:44 -0500 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 1rgHjm-0007Yr-Cp for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:43 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6e56a5b2812so1862670b3a.1 for ; Fri, 01 Mar 2024 21:16:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356600; x=1709961400; 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=eFgQq/tUbJgjC/SMzYSpMDPxCXRaDcih395pAQkBr2M=; b=PM3BSWxxC1D3ciyGbEbysMDcuSVEkvvNUqD3ptZAt/dFB4P33mrmab0Nw0iXxqnv01 Eil6SGBUExbU2EVNCbX+nvDgrcfmylH30FWANAJKuMTLvsGNwt4Fy9JWLKymUGvVXdUL 8OPlHeYNqkTrVy3wkGKGidJqSRrDx5d1joo0KZe/UkGQe8JdIGU7WZHWx7oXGDMDt9k6 6XYU5VbSCWi2jVqo+zqH6jEoEnDKQk+MaJeSJCBisGvIIf1UTqH2xBtkbnbfwTMyp+1s RwO4UuScxnvE+3gImAR9Fez0ORaQLReOJDZddB4lp6jtdJVrTso7OdpNBhqPzIceLW+l 9qew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356600; x=1709961400; 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=eFgQq/tUbJgjC/SMzYSpMDPxCXRaDcih395pAQkBr2M=; b=rKVAkPD+8ctLUg5AxWut5GrLViFdbP3RepRMJHIIOkUBGZmc8NUaCh9AFGL+8Ze8CZ aUwDX/1czVcZM9KS+6hZwVMQ+doedTdnR4NrUerx2XGIO7L51CBtS0VBiFI/zKgZ8rRb IzBf7CGO0Te8WGrsZfh0mF44/LjCIgFOplfVNQPZb5ySQuWzGWuKR9ziFks6wMqcuAFh VqJT3c3AUnE1rl/l3As3nlZWFJxBES7SrfiWmh9qSCioWsJ6+VkkasQ6nHXYzUobxmit KMQm5/9nyLTClsOQ2CTERk67BmZvWj9Xr7H56l8oKPCb+B90WEi3ozXEq6rW+NPj8uhk 6YpQ== X-Gm-Message-State: AOJu0Yx+JvXz56sAjsv7K5ewAv7kAZIcF60UIIWGG5NSyQ8j6gvbzyJ6 eGbr7KAPNPRFVT/TK8vHadk5q0msTKY4sG0TqRqadJg3cr5M436KBdZ8ENZKRCSEJS5FAl304iR D X-Received: by 2002:a05:6a20:1582:b0:1a0:d57b:1c93 with SMTP id h2-20020a056a20158200b001a0d57b1c93mr4058590pzj.33.1709356599924; Fri, 01 Mar 2024 21:16:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 20/41] target/sparc: Implement FMEAN16 Date: Fri, 1 Mar 2024 19:15:40 -1000 Message-Id: <20240302051601.53649-21-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::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, 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 | 1 + target/sparc/translate.c | 30 ++++++++++++++++++++++++++++++ target/sparc/vis_helper.c | 21 +++++++++++++++++++++ target/sparc/insns.decode | 1 + 4 files changed, 53 insertions(+) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 97b3c24fb3..8a5191414e 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -113,6 +113,7 @@ DEF_HELPER_FLAGS_2(cmask8, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(cmask16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(cmask32, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fchksm16, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fmean16, TCG_CALL_NO_RWG_SE, i64, i64, i64) #define VIS_CMPHELPER(name) \ DEF_HELPER_FLAGS_2(f##name##16, TCG_CALL_NO_RWG_SE, \ i64, i64, i64) \ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 6dba0fcca6..4876d46ebb 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -824,8 +824,37 @@ static void gen_op_fchksm16(unsigned vece, uint32_t dofs, uint32_t aofs, }; tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &op); } + +static void gen_vec_fmean16(unsigned vece, TCGv_vec dst, + TCGv_vec src1, TCGv_vec src2) +{ + TCGv_vec t = tcg_temp_new_vec_matching(dst); + + tcg_gen_or_vec(vece, t, src1, src2); + tcg_gen_and_vec(vece, t, t, tcg_constant_vec_matching(dst, vece, 1)); + tcg_gen_sari_vec(vece, src1, src1, 1); + tcg_gen_sari_vec(vece, src2, src2, 1); + tcg_gen_add_vec(vece, dst, src1, src2); + tcg_gen_add_vec(vece, dst, dst, t); +} + +static void gen_op_fmean16(unsigned vece, uint32_t dofs, uint32_t aofs, + uint32_t bofs, uint32_t oprsz, uint32_t maxsz) +{ + static const TCGOpcode vecop_list[] = { + INDEX_op_add_vec, INDEX_op_sari_vec, + }; + static const GVecGen3 op = { + .fni8 = gen_helper_fmean16, + .fniv = gen_vec_fmean16, + .opt_opc = vecop_list, + .vece = MO_16, + }; + tcg_gen_gvec_3(dofs, aofs, bofs, oprsz, maxsz, &op); +} #else #define gen_op_fchksm16 ({ qemu_build_not_reached(); NULL; }) +#define gen_op_fmean16 ({ qemu_build_not_reached(); NULL; }) #endif static void finishing_insn(DisasContext *dc) @@ -4836,6 +4865,7 @@ TRANS(FPADD32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_add) TRANS(FPSUB16, VIS1, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sub) TRANS(FPSUB32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sub) TRANS(FCHKSM16, VIS3, do_gvec_ddd, a, MO_16, gen_op_fchksm16) +TRANS(FMEAN16, VIS3, do_gvec_ddd, a, MO_16, gen_op_fmean16) static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index c627bb1a1f..93a6239f41 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -395,3 +395,24 @@ uint64_t helper_fchksm16(uint64_t src1, uint64_t src2) return r.ll; } + +static inline int16_t do_fmean16(int16_t src1, int16_t src2) +{ + return (src1 + src2 + 1) / 2; +} + +uint64_t helper_fmean16(uint64_t src1, uint64_t src2) +{ + VIS64 r, s1, s2; + + s1.ll = src1; + s2.ll = src2; + r.ll = 0; + + r.VIS_SW64(0) = do_fmean16(s1.VIS_SW64(0), s2.VIS_SW64(0)); + r.VIS_SW64(1) = do_fmean16(s1.VIS_SW64(1), s2.VIS_SW64(1)); + r.VIS_SW64(2) = do_fmean16(s1.VIS_SW64(2), s2.VIS_SW64(2)); + r.VIS_SW64(3) = do_fmean16(s1.VIS_SW64(3), s2.VIS_SW64(3)); + + return r.ll; +} diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 51a7fb62fb..bc5640aa5f 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -421,6 +421,7 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ PDIST 10 ..... 110110 ..... 0 0011 1110 ..... \ &r_r_r_r rd=%dfp_rd rs1=%dfp_rd rs2=%dfp_rs1 rs3=%dfp_rs2 + FMEAN16 10 ..... 110110 ..... 0 0100 0000 ..... @d_d_d FCHKSM16 10 ..... 110110 ..... 0 0100 0100 ..... @d_d_d FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @d_d_d FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @d_r_r From patchwork Sat Mar 2 05:15:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777496 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695051wrn; Fri, 1 Mar 2024 21:20:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVpcG2jVyibxbV9j1PNgKQHjWAoA7VCA4WjVpa1bFH7iaDU1YtivBO72iCmPJecQ6jJL/gw8k15N26v1Ax1wviu X-Google-Smtp-Source: AGHT+IGEJ6vF2DGbHMCl9Gym/QzqKSEptb41oAo5aldbSiHi5G4UeEsN/07h7E5AzUQgmITrMMac X-Received: by 2002:a05:620a:3886:b0:787:a1a0:a447 with SMTP id qp6-20020a05620a388600b00787a1a0a447mr3428570qkn.75.1709356842890; Fri, 01 Mar 2024 21:20:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356842; cv=none; d=google.com; s=arc-20160816; b=qQSu68XD2xEMDhomR9bhMLOeocKgraSqc4Vqd9++rivVNb/93s4KWeK7lkyUdVldrQ zD+XKH7/uRqK2GCkwfBHP4y3SW3SOXyGI7lLVhJEI+AuT8eN/Y53KZdw8AZuxHdxxZ54 ArcFnugfWMIsei84XWwWnMmkosIgV41xo0I5l97qkjMRwFTfXgwwVAKuBiOOaexTZ6y1 K05/WCVUO4KsIhlQdAxC584+5LRstp6HLM1tC5wpIL5Gbafr4/q8ZrUMzWTzRFaH0Tg+ JCQGU7ZXm0s+Vft9aecgkRGGInjrvImXpsFRLqrWekLCeYC9REnYqDK6XtuGHkR/NHbg P+yg== 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=FpT0TxxiSn2UFTAP4U5DaTEU/B/NB8CZNMPlZnOT5fM=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=VmfTQ9nysHS7z6NjKcoQkJKkMnjVlXBO8xzRngIomtOdjMrW4z9sIfZrEEnDyNVTg8 KjcVbz685Kovk6vX3r/sto4Y+y+xpSpVkpJZ09BXFs2vpVPCkVSh23OiZHN3TOBC4YF9 5f8Z6dag2TlwE2BKyXzkJQa1GQjMBr2AE3Uc9mAn1ciC9Mj5J/jyEpZkBcQt0afOhgUm vM1T4Y9U+CL3ooG75+FoT2iwB5ZHOyhR5UZpFldYy6bZ1hQkj5ncec6+JZwdXHT6GNaV UajBwTUuoptJFSCo02BE5SOyskNIM3Mm3ElEqEWArnV1LEy6dSFYTW8nhqpyURCGAKtt m3ug==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nRokxzDr; 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 bs9-20020a05620a470900b007881cd0411bsi103699qkb.712.2024.03.01.21.20.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:20:42 -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=nRokxzDr; 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 1rgHjt-0002Xc-OC; Sat, 02 Mar 2024 00:16:50 -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 1rgHjq-0002WP-8f for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:46 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjn-0007Yu-LC for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:45 -0500 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-5d8ddbac4fbso2574438a12.0 for ; Fri, 01 Mar 2024 21:16:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356601; x=1709961401; 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=FpT0TxxiSn2UFTAP4U5DaTEU/B/NB8CZNMPlZnOT5fM=; b=nRokxzDrzONKJcwsQ+BOxQmzshsfmo2gr4JgjrYjRvA6Hn+FdrEUWdkNGLYlL9V5Ni Do9nztwkPwsGGoPteJEAtNy4VCsZ/QOwfCG9yCmyfAz5ZcMM8WZC4n+heD1DRqPrCN9N KIJWCCezNDoBOWUzjqG1Fl/G5hfAE6QUlJ8d2kRF+TGVcriZTsoOio+/Ilqu9CdqQY4/ ZrX+rplFuDsVfbQyJN1GHT3GUYuLt7gpyP6975BvQy7T31oE3GuObtjUqr2W2Vy7WTwU fFG3EqaK24PJlik+F4ElQtfsNB6ATntwBsce9Q0KPEewLAZERg2fJSaZ5vEUgqQsIuLd SMGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356601; x=1709961401; 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=FpT0TxxiSn2UFTAP4U5DaTEU/B/NB8CZNMPlZnOT5fM=; b=KPGuf3hMTwXe8EhL2kKNHW0cee3KQui7/S+UY3bH8ydGmwQ/okC9qewufmLD6p3pZV jVZr5ScqWDA8diwxWVYcqbIEGNmsiPI6VE2RlEtw0oXvA/LQNtmyxUqbttCkZhAAAjQZ VYS63Aia9c8NyNv8yjvTfSSiW6YT7ygIwQ0PKYJCEDi+W6s0kVFlclOuRNN2k4Wc72C0 we6pEPTwUqBot3k8pBPDPjlyL18kzoukx+rSXzC5mAGST6pi2MDMtCtxCYkbFgVqVL6g O4UQA+Tn+ACYxYD67pkt99yrGMpjGMvkNYEDFAeA5oZmYofWoRUjxG0eyAiurQBJwX5r Pyig== X-Gm-Message-State: AOJu0Yxfgax7OJkw26lBa3Miiv+IQtPEZOQhZ8hscu1jmIB7NaHzaOIq 29bYh0FuYql5Ea6CROVfsKGHkkfKUjHgICaMXiZnooL5CxGnwIJfEagH41sJLD/tBTthFYeaAky m X-Received: by 2002:a05:6a20:144b:b0:1a1:476b:8199 with SMTP id a11-20020a056a20144b00b001a1476b8199mr645733pzi.26.1709356601174; Fri, 01 Mar 2024 21:16:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 21/41] target/sparc: Implement FPADD64 FPSUB64 Date: Fri, 1 Mar 2024 19:15:41 -1000 Message-Id: <20240302051601.53649-22-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::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 3 +++ target/sparc/insns.decode | 2 ++ 2 files changed, 5 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 4876d46ebb..9af30d8fa7 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4905,6 +4905,9 @@ TRANS(FHSUBd, VIS3, do_ddd, a, gen_op_fhsubd) TRANS(FNHADDd, VIS3, do_ddd, a, gen_op_fnhaddd) TRANS(FNADDd, VIS3, do_ddd, a, gen_op_fnaddd) +TRANS(FPADD64, VIS3B, do_ddd, a, tcg_gen_add_i64) +TRANS(FPSUB64, VIS3B, do_ddd, a, tcg_gen_sub_i64) + static bool do_rdd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv, TCGv_i64, TCGv_i64)) { diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index bc5640aa5f..c9dab4236d 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -441,10 +441,12 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPADD16s 10 ..... 110110 ..... 0 0101 0001 ..... @r_r_r FPADD32 10 ..... 110110 ..... 0 0101 0010 ..... @d_d_d FPADD32s 10 ..... 110110 ..... 0 0101 0011 ..... @r_r_r + FPADD64 10 ..... 110110 ..... 0 0100 0010 ..... @d_d_d FPSUB16 10 ..... 110110 ..... 0 0101 0100 ..... @d_d_d FPSUB16s 10 ..... 110110 ..... 0 0101 0101 ..... @r_r_r FPSUB32 10 ..... 110110 ..... 0 0101 0110 ..... @d_d_d FPSUB32s 10 ..... 110110 ..... 0 0101 0111 ..... @r_r_r + FPSUB64 10 ..... 110110 ..... 0 0100 0110 ..... @d_d_d FNORd 10 ..... 110110 ..... 0 0110 0010 ..... @d_d_d FNORs 10 ..... 110110 ..... 0 0110 0011 ..... @r_r_r From patchwork Sat Mar 2 05:15:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777484 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694589wrn; Fri, 1 Mar 2024 21:18:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUdV1EnDVXjSuGNFPKwR+y6GzX24Glw43fg+/zWT0p3ota31gTDLawkrIEDS/mk5GNyUlGb+t8LUoI4iMenP7WH X-Google-Smtp-Source: AGHT+IG5vyxPKa1+S4K6X4jjAD/ocU9nNj8gmJJiIngeDT9c3xWSIwEo9rcVkAm6bT5ndDW23fkX X-Received: by 2002:a05:622a:1a0d:b0:42e:dd19:6225 with SMTP id f13-20020a05622a1a0d00b0042edd196225mr616465qtb.19.1709356722750; Fri, 01 Mar 2024 21:18:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356722; cv=none; d=google.com; s=arc-20160816; b=d18E9/VlK/Pnsb8h1ZHDva3O2RuD+6xAAOBz4zm9uFvs+WQ4NMqol8tO1c9wuuKBqt 6Qy8mZ2bGJo8adXzCb7qUNSghA/AL8GeQOMuSLsaA+s2RXX1SqPLXithM2yQ/T7aW6Ba 4M14/EMWQgleudFrGIbDjKhOj64xe50b/arjeHYDJBrLU1N8FdfkUI5iS1W7/bMJAosg /eWG+Doq6QCXdZCMW4VoOprioBn4vgySX6b2p1uAXpmHFleDzUvGvmY7eWdfw1krabuD Nse/1KstgPWmz/iigRV5oD0R3Z6aUvV4day3JCD6p4LqHRYtsf0du1k4n5Du0NGaiUhh dj6g== 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=1RSehTc+m5oVdh1J2W1mJGpLatyJrr2v8cOzcGv/GU4=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=lPUpk0dbUxzSS5Wyst378vi+gk7kSyvIStV/liO6gcG0x0qHTEgPvRuFtx1apW5w3O oxhFAXuLknj1eNWhgvcyH5V65drGw9Ukg73J4/AF1Hk0+YCodYQ2fT+LoI+kmIRFYmSX 22gVblx6BZ2baH0ZMgMFt1vNyyFGfQWwNgfI+5dQrj46e7IdkF1V3Xv0KVz61dYn18+7 yOCs/1ROiTSYRmymEnI9Ca8CRfSEF2b/yLKgIGwtCnNtnNjmZ28gBbLLwe4IddYiDabH J0EdZsuf30F7IdEbT7iltiveHiz1uaRCjmnM7Ha6CkT63TsHxUa79xQAOOZ5omYMHk5p Q8vg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H7AVPFBu; 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 z21-20020ac87f95000000b0042ece6fb883si2315868qtj.730.2024.03.01.21.18.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:42 -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=H7AVPFBu; 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 1rgHjr-0002WZ-S9; Sat, 02 Mar 2024 00:16:47 -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 1rgHjp-0002WE-GV for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:45 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjn-0007ZJ-In for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:45 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6e4d48a5823so2521546b3a.1 for ; Fri, 01 Mar 2024 21:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356602; x=1709961402; 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=1RSehTc+m5oVdh1J2W1mJGpLatyJrr2v8cOzcGv/GU4=; b=H7AVPFBu54Q4EKBACy1E/RX4Xtd9m6X/45c44w5je1PtRM+DvS7QckCpw82YB6cIA+ D5QBOqc4GPOtvTDhvB0VfvtsvG645a7mN13DDxLsAciIYFMKGJNliD3Sd5kppBTSwHd7 9oLBBZYfj2Cw5/qvKMUwM+9VU/TbGC+CVz01ejeGjU6ByHjqFVfqTg/NVU5DVDEIOYMS YqL/Y6Ev3mh2lllZ6k8DgklhkiDqMmZT3428D231F9vVXUT/qz85gfrf7ADZRYgEPBpz 1bNB8h8o7qYNuEiYhCFr593cirrJPfuMhkWCnh0NyAlkiExf+66BW709NGDcrs1rNgA1 NtxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356602; x=1709961402; 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=1RSehTc+m5oVdh1J2W1mJGpLatyJrr2v8cOzcGv/GU4=; b=gd0dG+Aomh9DHg0ecp9u/JNnQ6CBXP3HXeVj8KYy9Hxs3RI5p+JHC7A0ftIjhTUGyH /7kp11Za8x0/1Kq1Rf9dcQce4dfkwKRsSHjrViEwBcS5q8IrSpOK3Xn1Hy6eeZ+xwitG r/9dwEq4bcRWG4yxqLVzJKwlo+yC0tVJ/dt8YVWZUgjXbLKaVs0TWJm0pnypH1i2kgZC tCvjZke8N4oZW9/8KsV3gLHeb+rWiE4oYnmYA45cxtaFtWubu1VZjHuRo5FaEe3Gxwmw sjbNDUtea9ZWK3GGlgfRhoQWyF9ZcPKIygD6UiqfSlG+g1WSz0O+EaIk7AwNokehwwgS kp9g== X-Gm-Message-State: AOJu0YzIkDfzimOOCYGvUIt1KNBBv49HDSljNuXVVJX4IaBRz5X5/Njk USn1PoAsypGSzaxAC54WjvLKODl1Wmc0gkL1gswol8l6KRoC0JsSO8JP3WSgX+HnhgRX8uOKqzg m X-Received: by 2002:a05:6a20:1609:b0:1a1:2092:8868 with SMTP id l9-20020a056a20160900b001a120928868mr3894028pzj.1.1709356602427; Fri, 01 Mar 2024 21:16:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 22/41] target/sparc: Implement FPADDS, FPSUBS Date: Fri, 1 Mar 2024 19:15:42 -1000 Message-Id: <20240302051601.53649-23-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::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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/translate.c | 82 +++++++++++++++++++++++++++++++++++++++ target/sparc/insns.decode | 9 +++++ 2 files changed, 91 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 9af30d8fa7..0dc02a3d6e 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -707,6 +707,78 @@ static void gen_op_fpack32(TCGv_i64 dst, TCGv_i64 src1, TCGv_i64 src2) #endif } +static void gen_op_fpadds16s(TCGv_i32 d, TCGv_i32 src1, TCGv_i32 src2) +{ + TCGv_i32 t[2]; + + for (int i = 0; i < 2; i++) { + TCGv_i32 u = tcg_temp_new_i32(); + TCGv_i32 v = tcg_temp_new_i32(); + + tcg_gen_sextract_i32(u, src1, i * 16, 16); + tcg_gen_sextract_i32(v, src2, i * 16, 16); + tcg_gen_add_i32(u, u, v); + tcg_gen_smax_i32(u, u, tcg_constant_i32(INT16_MIN)); + tcg_gen_smin_i32(u, u, tcg_constant_i32(INT16_MAX)); + t[i] = u; + } + tcg_gen_deposit_i32(d, t[0], t[1], 16, 16); +} + +static void gen_op_fpsubs16s(TCGv_i32 d, TCGv_i32 src1, TCGv_i32 src2) +{ + TCGv_i32 t[2]; + + for (int i = 0; i < 2; i++) { + TCGv_i32 u = tcg_temp_new_i32(); + TCGv_i32 v = tcg_temp_new_i32(); + + tcg_gen_sextract_i32(u, src1, i * 16, 16); + tcg_gen_sextract_i32(v, src2, i * 16, 16); + tcg_gen_sub_i32(u, u, v); + tcg_gen_smax_i32(u, u, tcg_constant_i32(INT16_MIN)); + tcg_gen_smin_i32(u, u, tcg_constant_i32(INT16_MAX)); + t[i] = u; + } + tcg_gen_deposit_i32(d, t[0], t[1], 16, 16); +} + +static void gen_op_fpadds32s(TCGv_i32 d, TCGv_i32 src1, TCGv_i32 src2) +{ + TCGv_i32 r = tcg_temp_new_i32(); + TCGv_i32 t = tcg_temp_new_i32(); + TCGv_i32 v = tcg_temp_new_i32(); + TCGv_i32 z = tcg_constant_i32(0); + + tcg_gen_add_i32(r, src1, src2); + tcg_gen_xor_i32(t, src1, src2); + tcg_gen_xor_i32(v, r, src2); + tcg_gen_andc_i32(v, v, t); + + tcg_gen_setcond_i32(TCG_COND_GE, t, r, z); + tcg_gen_addi_i32(t, t, INT32_MAX); + + tcg_gen_movcond_i32(TCG_COND_LT, d, v, z, t, r); +} + +static void gen_op_fpsubs32s(TCGv_i32 d, TCGv_i32 src1, TCGv_i32 src2) +{ + TCGv_i32 r = tcg_temp_new_i32(); + TCGv_i32 t = tcg_temp_new_i32(); + TCGv_i32 v = tcg_temp_new_i32(); + TCGv_i32 z = tcg_constant_i32(0); + + tcg_gen_sub_i32(r, src1, src2); + tcg_gen_xor_i32(t, src1, src2); + tcg_gen_xor_i32(v, r, src2); + tcg_gen_and_i32(v, v, t); + + tcg_gen_setcond_i32(TCG_COND_GE, t, r, z); + tcg_gen_addi_i32(t, t, INT32_MAX); + + tcg_gen_movcond_i32(TCG_COND_LT, d, v, z, t, r); +} + static void gen_op_faligndata(TCGv_i64 dst, TCGv_i64 s1, TCGv_i64 s2) { #ifdef TARGET_SPARC64 @@ -4785,6 +4857,11 @@ TRANS(FHSUBs, VIS3, do_fff, a, gen_op_fhsubs) TRANS(FNHADDs, VIS3, do_fff, a, gen_op_fnhadds) TRANS(FNADDs, VIS3, do_fff, a, gen_op_fnadds) +TRANS(FPADDS16s, VIS3, do_fff, a, gen_op_fpadds16s) +TRANS(FPSUBS16s, VIS3, do_fff, a, gen_op_fpsubs16s) +TRANS(FPADDS32s, VIS3, do_fff, a, gen_op_fpadds32s) +TRANS(FPSUBS32s, VIS3, do_fff, a, gen_op_fpsubs32s) + static bool do_env_fff(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i32, TCGv_env, TCGv_i32, TCGv_i32)) { @@ -4867,6 +4944,11 @@ TRANS(FPSUB32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sub) TRANS(FCHKSM16, VIS3, do_gvec_ddd, a, MO_16, gen_op_fchksm16) TRANS(FMEAN16, VIS3, do_gvec_ddd, a, MO_16, gen_op_fmean16) +TRANS(FPADDS16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_ssadd) +TRANS(FPADDS32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_ssadd) +TRANS(FPSUBS16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sssub) +TRANS(FPSUBS32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sssub) + static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) { diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index c9dab4236d..602b4cc648 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -448,6 +448,15 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPSUB32s 10 ..... 110110 ..... 0 0101 0111 ..... @r_r_r FPSUB64 10 ..... 110110 ..... 0 0100 0110 ..... @d_d_d + FPADDS16 10 ..... 110110 ..... 0 0101 1000 ..... @d_d_d + FPADDS16s 10 ..... 110110 ..... 0 0101 1001 ..... @r_r_r + FPADDS32 10 ..... 110110 ..... 0 0101 1010 ..... @d_d_d + FPADDS32s 10 ..... 110110 ..... 0 0101 1011 ..... @r_r_r + FPSUBS16 10 ..... 110110 ..... 0 0101 1100 ..... @d_d_d + FPSUBS16s 10 ..... 110110 ..... 0 0101 1101 ..... @r_r_r + FPSUBS32 10 ..... 110110 ..... 0 0101 1110 ..... @d_d_d + FPSUBS32s 10 ..... 110110 ..... 0 0101 1111 ..... @r_r_r + FNORd 10 ..... 110110 ..... 0 0110 0010 ..... @d_d_d FNORs 10 ..... 110110 ..... 0 0110 0011 ..... @r_r_r FANDNOTd 10 ..... 110110 ..... 0 0110 0100 ..... @d_d_d # FANDNOT2d From patchwork Sat Mar 2 05:15:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777501 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695126wrn; Fri, 1 Mar 2024 21:21:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV7V5v9sYB6KMplbIAsS3C6dt3ItsM6qxJaYwdVqmPSg/MWwNE3A7HP9KmHG8erQ3eFYJcHob5fzy1T+7senPok X-Google-Smtp-Source: AGHT+IEVwanAsoqKb7MJthfLSr0Te3uiXG9pdqbpJc8Eqd1M2a/rg6IRWlv/IVI2jEflXMTxM59x X-Received: by 2002:a05:620a:580b:b0:787:eb72:2167 with SMTP id wm11-20020a05620a580b00b00787eb722167mr3927815qkn.42.1709356863719; Fri, 01 Mar 2024 21:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356863; cv=none; d=google.com; s=arc-20160816; b=nlIcxfkOHVTprmwux8buXYLFS6vB44acgHPOhVYeqe9LEf5iNzILg6D94zpGYpA7AH qgushFQlZerq0lDbUVhl17ClqV6W64uWPmqjXbWfByutd313oEQ2qKzwNDNZkbNBKT6/ tQzs9iq4oGkxasRS6eZ38vTJiK8LHfHmTBqLdnwI1zoQmffNt12gx3wefrFWEvL3kE1v rrjZKfMtzm2gvMj/kVcD77Zh00icEXonie/fa4htqmwuR6L4Js0lwOuIOBz5ucKHlT9r aFI/gUZ+AFEQrjnZ9W6cx/zsSyTGhODHpcpXl7j4Jab6baq1hWWyiXoMETKiMLs6WJ+M 3kvQ== 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=ezQMK+llLfRLQ91YJ8mCm3WDoIQicf2yyAeX5SZzp54=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=rQUQEqqMd9XmobM3+u0EeFxL7kfJhcYTpygW7yBEY1G4TbWG10jOzrWCxaJaIFAmWO YXYj+ZdAKoBV83QZsLhN1rI44tEK6B7tqCOHd2QzOz+6vl/g6lUOvEKdKrjdiIEam7Ne 7J9DFsTjkLbrhgRtohrA2BrS+jucORMt6aspFt9Lt2F/d921pssoUQrek9nw130xjWvE x82J31hJJ+r1+Fgdou4AGz4F/BOrxMvQy1bhT4hljQpFhLh/Ofx+6kOoM84cc91JPDWU /J9rLbSbOl9q9l8QcyLIDFP/tnScPhXXibSd3RI1M9H5XrDahKN+vJ1XRUZd5Lh/McIq cGng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JosCyprx; 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 q27-20020a05620a039b00b0078725883460si5030370qkm.390.2024.03.01.21.21.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:21:03 -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=JosCyprx; 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 1rgHjt-0002YJ-0B; Sat, 02 Mar 2024 00:16:49 -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 1rgHjr-0002XE-Q6 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:47 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjq-0007Zb-4N for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:47 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-299c11b250fso1957064a91.2 for ; Fri, 01 Mar 2024 21:16:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356604; x=1709961404; 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=ezQMK+llLfRLQ91YJ8mCm3WDoIQicf2yyAeX5SZzp54=; b=JosCyprxSjq0IN0Ff2Kbf8lydi9uRvRdiQIpzXU8hQtkav1bNIxTnSpfbHc9YaDJLs nmwz2PVju2IHOb8HS14bTulsEralHiXpAG+tMa+brsnkUkYxc8FyqTIt6TzEs5q9Kn7w U6PW4z3+eWiGkScy+ZX+1UigYoAik3YOWurG0PWjIxQeI9fr0MLV345TojyJmy+m9G6z MDiE2Lz/VTXw+nO3E0fkaiecY3r6zGu38bYQQsl2PS+5pQ9XkQ9oLhTlBAb20TSjrD0d XKsR+BX0GdiK2iA2bMUopCKFM8IqQZynAJ02WjXP8SD6Nd4pdhDIyx4bYC+M5651bo3V 2X1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356604; x=1709961404; 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=ezQMK+llLfRLQ91YJ8mCm3WDoIQicf2yyAeX5SZzp54=; b=Z0eHfm35aTDJ+h7tbwoDfj2cF9IqqvPsET8Jxv4k+vRETqTHNI4PD0lh4rMImLYl07 lytv7w9znpmgsWDuDlZBnhV+kr72BOzgUyw3USm03oepVfHgFpGbHEgMjoYGzcfUnYs9 hy5RdAcoUrgpOoCePx2VIz5iuqTcujnHl1V+vEgZjHbf2k+/i5MQFTpGmNdVBLsCwRbZ wyLXn+4smr8urqPXc9VDkh80KUx3JFFurVm5bSRzFut9W4y0IipRl/1A/YbHom6yVMLd sru57kOxRiqp6iTW228ATqfWlUFk0g9qopLLKvHOknUFZxSPwDMnUj0AJ5+BxQgh5Lfz TCmw== X-Gm-Message-State: AOJu0YxagVpfTbNzZU8PwCgIyiUA+AVlEAiOFidP/mguMdMQW8i/VroX J0ucNIo4LmJuGElEu23REQ6dIdMGcupMD6LNFaiD17UXlJECz/aTM+0996hsOw/qiTFvT6NK4Ss n X-Received: by 2002:a17:90a:1049:b0:29a:264b:8853 with SMTP id y9-20020a17090a104900b0029a264b8853mr3212210pjd.12.1709356603864; Fri, 01 Mar 2024 21:16:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 23/41] target/sparc: Implement FPCMPEQ8, FPCMPNE8, FPCMPULE8, FPCMPUGT8 Date: Fri, 1 Mar 2024 19:15:43 -1000 Message-Id: <20240302051601.53649-24-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::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.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 | 4 ++++ target/sparc/translate.c | 9 +++++++++ target/sparc/vis_helper.c | 40 +++++++++++++++++++++++++++++++++++++++ target/sparc/insns.decode | 5 +++++ 4 files changed, 58 insertions(+) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 8a5191414e..fb52f31666 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -123,6 +123,10 @@ VIS_CMPHELPER(cmpgt) VIS_CMPHELPER(cmpeq) VIS_CMPHELPER(cmple) VIS_CMPHELPER(cmpne) +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) #endif #undef VIS_HELPER #undef VIS_CMPHELPER diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 0dc02a3d6e..bc8c314d4c 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -65,14 +65,18 @@ # define gen_helper_cmask8 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_cmask16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_cmask32 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpeq8 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpeq16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpeq32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpgt16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpgt32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmple16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmple32 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpne8 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpne16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpne32 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpule8 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpugt8 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fdtox ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fexpand ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmul8sux16 ({ qemu_build_not_reached(); NULL; }) @@ -5018,6 +5022,11 @@ TRANS(FPCMPNE32, VIS1, do_rdd, a, gen_helper_fcmpne32) TRANS(FPCMPGT32, VIS1, do_rdd, a, gen_helper_fcmpgt32) TRANS(FPCMPEQ32, VIS1, do_rdd, a, gen_helper_fcmpeq32) +TRANS(FPCMPEQ8, VIS3B, do_rdd, a, gen_helper_fcmpeq8) +TRANS(FPCMPNE8, VIS3B, do_rdd, a, gen_helper_fcmpne8) +TRANS(FPCMPULE8, VIS3B, do_rdd, a, gen_helper_fcmpule8) +TRANS(FPCMPUGT8, VIS3B, do_rdd, a, gen_helper_fcmpugt8) + 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 93a6239f41..2d290a440e 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -221,6 +221,46 @@ VIS_CMPHELPER(helper_fcmpeq, FCMPEQ) VIS_CMPHELPER(helper_fcmple, FCMPLE) VIS_CMPHELPER(helper_fcmpne, FCMPNE) +uint64_t helper_fcmpeq8(uint64_t src1, uint64_t src2) +{ + uint64_t a = src1 ^ src2; + uint64_t m = 0x7f7f7f7f7f7f7f7fULL; + uint64_t c = ~(((a & m) + m) | a | m); + + /* a.......b.......c.......d.......e.......f.......g.......h....... */ + c |= c << 7; + /* ab......bc......cd......de......ef......fg......gh......h....... */ + c |= c << 14; + /* abcd....bcde....cdef....defg....efgh....fgh.....gh......h....... */ + c |= c << 28; + /* abcdefghbcdefgh.cdefgh..defgh...efgh....fgh.....gh......h....... */ + return c >> 56; +} + +uint64_t helper_fcmpne8(uint64_t src1, uint64_t src2) +{ + return helper_fcmpeq8(src1, src2) ^ 0xff; +} + +uint64_t helper_fcmpule8(uint64_t src1, uint64_t src2) +{ + VIS64 s1, s2; + uint64_t r = 0; + + s1.ll = src1; + s2.ll = src2; + + for (int i = 0; i < 8; ++i) { + r |= (s1.VIS_B64(i) <= s2.VIS_B64(i)) << i; + } + return r; +} + +uint64_t helper_fcmpugt8(uint64_t src1, uint64_t src2) +{ + return helper_fcmpule8(src1, src2) ^ 0xff; +} + uint64_t helper_pdist(uint64_t sum, uint64_t src1, uint64_t src2) { int i; diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 602b4cc648..c94007bf95 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -408,6 +408,11 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPCMPGT32 10 ..... 110110 ..... 0 0010 1100 ..... @r_d_d FPCMPEQ32 10 ..... 110110 ..... 0 0010 1110 ..... @r_d_d + FPCMPULE8 10 ..... 110110 ..... 1 0010 0000 ..... @r_d_d + FPCMPUGT8 10 ..... 110110 ..... 1 0010 1000 ..... @r_d_d + FPCMPEQ8 10 ..... 110110 ..... 1 0010 0010 ..... @r_d_d + FPCMPNE8 10 ..... 110110 ..... 1 0010 1010 ..... @r_d_d + FMUL8x16 10 ..... 110110 ..... 0 0011 0001 ..... @d_r_d FMUL8x16AU 10 ..... 110110 ..... 0 0011 0011 ..... @d_r_r FMUL8x16AL 10 ..... 110110 ..... 0 0011 0101 ..... @d_r_r From patchwork Sat Mar 2 05:15:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777471 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694349wrn; Fri, 1 Mar 2024 21:17:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVzbeYtvYhyxZ584S09MlhvY0Rm4Jn4cNWgzJAa3WHse4UK74CjhpmJ4w8vN0Zt6RFII3/pn6ytUuL9DuAvEnbI X-Google-Smtp-Source: AGHT+IGGsH48HR8KGpIAkHKvso7HNrR2JEk666gCp9BcixdNz9DTqk2HPLWkXwL4WN0vZATRdSvo X-Received: by 2002:a05:620a:4803:b0:788:d59:434a with SMTP id eb3-20020a05620a480300b007880d59434amr4172297qkb.7.1709356671094; Fri, 01 Mar 2024 21:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356671; cv=none; d=google.com; s=arc-20160816; b=PXCaTcgTR+fFsD81dviu6mS9U59BArSlES1S6IUulfIxlzPYktyaxSjRa6hk9FMN59 3sGTxes11ZJactI1+e7XggwYMwcWjvdIDNaL2034863vE5JrXEpcF92meTAdXEBjn2j3 eM6mdHOMmxy2p+iKyNdKVFVTzld0/uEA+HyYuygsiJql1Skn7c+4tI2bTWiSZsWJHDMw NQo0nUxEYZ1kGLA5N1l0rsP2OBYfbcLAcMM4kJkzFOFi7XXfoeQJQ3UsmPwOmQIvX5tA PWU2ttXckPEbtPavq2mHj9BHBbzQkn3s5WNNs2LPC4xDpBAC+iM0aTRwqMmYVgcAJuEH EpMg== 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=AfPuJ4tPZVWL/yf2b4Ij0h3eS67hS3Izz9+5EX1nnYU=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=ukhEkM/GFCK1jugo28CCNYEST+RxwzVcxrTXNwo6wioXHMpFRk5TlcYP2Xya2xRWDc QNcLiDOWbIqseNjP9uubuqp7L05IDXUErUz1Xf2WDVLt2vpf7KbVSURF2z7F85Qg8VFQ /r44NuvPvTAvH77EwUrfOkIrtVz5hwrrcTV58CvnzIqapJ/kzYly2lt3hVNL6BNnby9A xHAXqU1QDyMhrcPNSCXHwgitYVHP+dUA/JcUbzRGGIuLAXP0nKviuzZjFDfI30hK32eZ PqEi6HSMamsmmA/M2oNYzuHdPrh7udzVWg+MUFdXBNZfMtAmXqMDeOGGhUs9/vlChy2u Ke/g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dh29xP1e; 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 s13-20020a05620a030d00b007872024671csi5073589qkm.732.2024.03.01.21.17.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:17:51 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Dh29xP1e; 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 1rgHjw-0002vk-JC; Sat, 02 Mar 2024 00:16:52 -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 1rgHjv-0002mh-1d for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:51 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjr-0007Zo-9K for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:50 -0500 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-29a74c88f74so1955673a91.3 for ; Fri, 01 Mar 2024 21:16:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356605; x=1709961405; 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=AfPuJ4tPZVWL/yf2b4Ij0h3eS67hS3Izz9+5EX1nnYU=; b=Dh29xP1etwvS+p5kujf00XmOjs66tLCBFu+IJOmSnCNzKBabrKqJlbuZYZ3bMJALfY osyq6Xb2X7p5OaIo5r6i10MqShV465fA0Y2kgjKa5V0AOeyeNWknFBe4rImh/hbOf4ih ShkDdJvODM2qqKfOu7/97eHF+JpTMEzGEnz0xxsmZ02CnmW99fIW1l+JtMelYLtYjRhD Xb38scrqh7IGRyzbIrDEffxKKXv6etFuJ9nSvxWkwry3xrfDdbuTt5IfdDDihgZTKJY+ Wv6EsuKP0FuHWj7ALEeQMQJR1dZl0s9yTpx85678iMW4rlPgST7GxjDYJoq/0H/FggVv mY9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356605; x=1709961405; 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=AfPuJ4tPZVWL/yf2b4Ij0h3eS67hS3Izz9+5EX1nnYU=; b=JtedQVEdCLv4ZOt0U3J/VKCMU4cXV5rrvsMAZcWsnW/3dvth9YQ7mkjNLaVBqHSAR3 sYUiuRMsOn8pi7DStrdy5QBA+oGk4PCZWQyIPsr9DO8Gg/hKaxPzCFO1ZypvTR8XVV29 qxE1FTwKkkPt6zYOVdvUoIc41nT8UNN7WfObBPpOw4i9x/iWlkfrMPnE6+6TRxHQ779g f/TMpWZVhIejEjwoAjUm9VJ61So9XROFQhpLlgb8D/m41wCNrDmIHuVufaU8x25f/Fns YCBQZjyWtHMXK8ZAqUgKaowHqSfjvcIkpTPQ0FLsQRbAuecisZKmL8Ab156/bARP0uTa +qPw== X-Gm-Message-State: AOJu0YzlhpaVUcv24DqMfrCS2ipQQjlLCHY9WcdT03JxUlU101qw1Q8Q XAT8iR6+KrRU0/O+puhUoeJJPjfZkkEkaBBUa/cHOL1L8YrvnYp+bYtCVhJsvwIvNoTXv7qzjC+ 0 X-Received: by 2002:a17:90a:7187:b0:29b:a75:9930 with SMTP id i7-20020a17090a718700b0029b0a759930mr3400919pjk.5.1709356605120; Fri, 01 Mar 2024 21:16:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 24/41] target/sparc: Implement FSLL, FSRL, FSRA, FSLAS Date: Fri, 1 Mar 2024 19:15:44 -1000 Message-Id: <20240302051601.53649-25-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::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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 | 11 +++++++++++ target/sparc/vis_helper.c | 36 ++++++++++++++++++++++++++++++++++++ target/sparc/insns.decode | 9 +++++++++ 4 files changed, 58 insertions(+) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index fb52f31666..331acbe8d0 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -114,6 +114,8 @@ DEF_HELPER_FLAGS_2(cmask16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(cmask32, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fchksm16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmean16, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fslas16, TCG_CALL_NO_RWG_SE, i64, i64, i64) +DEF_HELPER_FLAGS_2(fslas32, TCG_CALL_NO_RWG_SE, i64, i64, i64) #define VIS_CMPHELPER(name) \ DEF_HELPER_FLAGS_2(f##name##16, TCG_CALL_NO_RWG_SE, \ i64, i64, i64) \ diff --git a/target/sparc/translate.c b/target/sparc/translate.c index bc8c314d4c..cab177190a 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -84,6 +84,8 @@ # define gen_helper_fmul8x16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fpmerge ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fqtox ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fslas16 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fslas32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fstox ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fxtod ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fxtoq ({ qemu_build_not_reached(); NULL; }) @@ -4953,6 +4955,13 @@ TRANS(FPADDS32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_ssadd) TRANS(FPSUBS16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sssub) TRANS(FPSUBS32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sssub) +TRANS(FSLL16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_shlv) +TRANS(FSLL32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_shlv) +TRANS(FSRL16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_shrv) +TRANS(FSRL32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_shrv) +TRANS(FSRA16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sarv) +TRANS(FSRA32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sarv) + static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) { @@ -4993,6 +5002,8 @@ TRANS(FNADDd, VIS3, do_ddd, a, gen_op_fnaddd) TRANS(FPADD64, VIS3B, do_ddd, a, tcg_gen_add_i64) TRANS(FPSUB64, VIS3B, do_ddd, a, tcg_gen_sub_i64) +TRANS(FSLAS16, VIS3, do_ddd, a, gen_helper_fslas16) +TRANS(FSLAS32, VIS3, do_ddd, a, gen_helper_fslas32) static bool do_rdd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv, TCGv_i64, TCGv_i64)) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 2d290a440e..8675ac64b3 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -456,3 +456,39 @@ uint64_t helper_fmean16(uint64_t src1, uint64_t src2) return r.ll; } + +uint64_t helper_fslas16(uint64_t src1, uint64_t src2) +{ + VIS64 r, s1, s2; + + s1.ll = src1; + s2.ll = src2; + r.ll = 0; + + for (int i = 0; i < 4; ++i) { + int t = s1.VIS_SW64(i) << (s2.VIS_W64(i) % 16); + t = MIN(t, INT16_MAX); + t = MAX(t, INT16_MIN); + r.VIS_SW64(i) = t; + } + + return r.ll; +} + +uint64_t helper_fslas32(uint64_t src1, uint64_t src2) +{ + VIS64 r, s1, s2; + + s1.ll = src1; + s2.ll = src2; + r.ll = 0; + + for (int i = 0; i < 2; ++i) { + int64_t t = (int64_t)(int32_t)s1.VIS_L64(i) << (s2.VIS_L64(i) % 32); + t = MIN(t, INT32_MAX); + t = MAX(t, INT32_MIN); + r.VIS_L64(i) = t; + } + + return r.ll; +} diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index c94007bf95..67591b7df9 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -408,6 +408,15 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPCMPGT32 10 ..... 110110 ..... 0 0010 1100 ..... @r_d_d FPCMPEQ32 10 ..... 110110 ..... 0 0010 1110 ..... @r_d_d + FSLL16 10 ..... 110110 ..... 0 0010 0001 ..... @d_d_d + FSRL16 10 ..... 110110 ..... 0 0010 0011 ..... @d_d_d + FSLAS16 10 ..... 110110 ..... 0 0010 1001 ..... @d_d_d + FSRA16 10 ..... 110110 ..... 0 0010 1011 ..... @d_d_d + FSLL32 10 ..... 110110 ..... 0 0010 0101 ..... @d_d_d + FSRL32 10 ..... 110110 ..... 0 0010 0111 ..... @d_d_d + FSLAS32 10 ..... 110110 ..... 0 0010 1101 ..... @d_d_d + FSRA32 10 ..... 110110 ..... 0 0010 1111 ..... @d_d_d + FPCMPULE8 10 ..... 110110 ..... 1 0010 0000 ..... @r_d_d FPCMPUGT8 10 ..... 110110 ..... 1 0010 1000 ..... @r_d_d FPCMPEQ8 10 ..... 110110 ..... 1 0010 0010 ..... @r_d_d From patchwork Sat Mar 2 05:15:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777502 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695159wrn; Fri, 1 Mar 2024 21:21:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUedyiBA0ISolYLlg+rRYmGf95nXnWboR+xCH8JM+JR0Gx43vfXndeJpQmCH0R+8gJgbxnyRLkqG1UG3wMot0be X-Google-Smtp-Source: AGHT+IGN6CDYnHQI/xLFKczYRR7ks7uusXpWe7E+9N6/69+ZAwFnTP4VohSAlpqYtmD7G5msO7e2 X-Received: by 2002:a05:620a:574c:b0:787:da0e:515d with SMTP id wj12-20020a05620a574c00b00787da0e515dmr3606202qkn.20.1709356869751; Fri, 01 Mar 2024 21:21:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356869; cv=none; d=google.com; s=arc-20160816; b=YM+Z/9I6Q3g8zdKgBv2VQj5fnDVJ7SyY9jNuu9ts4XYPM4ouVi8ySKL6yJ9DzikHd3 WOm/D1CvT/N9WgOFM4ljgTMGBl3p2RT4+izo0Vlknt3f4h/7VSj17CPNVO6CplPy/m+T DP/Fnnu35V3iLss9iJ6AVg7IU5HPMv3kkJCXEctfprJMUVzt1xmhRuHRqj2rAJ9wAW4k A6Q6WefavpEmD3dfqUz93LNtsZG4rSkTg9i/wxcgBdtdrHAhw5vwObbSCYvaR8jyjONL x4UR8D5JCtThK7p3LUZsl63eDM5tmb4WXmcG0ibUSJOWGTmaJp89+bse26CrVHswKrDn QA2A== 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=t3J4u4o+ZiZhoYzI/EAUQNnJq1yCqdu7R1cfUSbRF4M=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=LwaFouTGLqy5Bxm/cX99rL0K06eA4/+0KOywI8KMCFHwqouoIl4GDLXCg2dnJ4TGYw ehzt72ZEUrf9C+kh4eW0bEIPvKz4CDFgZjM8lOcGgvtRx26GnigWvZ56wyKaMChbu9d2 J0n8Hk8xowTpXK2BhISymJRUDU3SDmOKWVm52JmwW7WeAwdungLSIPPAO1+nOh15Ytqx EZon8RGmtB+xPKesVu31S/IbrocrzhraWek7Z0qMLS/SjfXsgdWENL3VL1aDBBQe3q1Q iIofPaE7PUQdxR/V6uRFK+mCmomXIVZQx4UYhuOAb6KLgnq6eenT4NDq6JyDVXv1C8j2 CzPw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Wo3Pb39k; 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 o25-20020a05620a0d5900b007871f6e9e57si5001448qkl.721.2024.03.01.21.21.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:21:09 -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=Wo3Pb39k; 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 1rgHjv-0002qU-Oh; Sat, 02 Mar 2024 00:16:51 -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 1rgHjt-0002bz-6i for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:49 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjr-0007a0-J9 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:48 -0500 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6de3141f041so2145160b3a.0 for ; Fri, 01 Mar 2024 21:16:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356606; x=1709961406; 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=t3J4u4o+ZiZhoYzI/EAUQNnJq1yCqdu7R1cfUSbRF4M=; b=Wo3Pb39kJjqUvK+hwOOPmAGu76J5R+pT+TwiUr4/Uw+KXZ6q8dn21FYnNCPSPdgucl xGWjaeEo59X6HYnzaA1QFCP3J/iL3Uyb5+O+B5mVhc4M4FwcDAde25l97QgAULlKbXiT VrSh7YjDUr5b7fn6WHhrXl2tBwR35NE+7CUu3PV1Efg0RNNEbsJQ/Mo4NqW1blMCrmpX aHxWVUBuBJSmz5j6BtIQhttwzOUStZ26TSfqCeDr0Niz4KtoMQb9soMOa4BBSFpXdhgW FoQp4XkNlr+8J3KCEO+APw11pJ/eOtyLAxD8AxFnBRt1z0fIdDdYbIYvjG79krnIlIgF R3jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356606; x=1709961406; 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=t3J4u4o+ZiZhoYzI/EAUQNnJq1yCqdu7R1cfUSbRF4M=; b=lp52jnpd9RwAkBSrkBXqaXXnHtGDkgLsrUX5er2eZ+R+DMHfb4dQ5RQBdbv1VFEdmX zs9AUm63MlmUkcdfI9dHAePsq4/A3X1LJpVA/Na0R0npdcJ6dfIorKHFmexS02xVyLXc SIfo6x9qSi2sHrHiJrFO3ZHGq0KfzMP0MLx0xM2ct6p2YBnjyA84WJuQmWZNBczEdRQ4 La6H5ELO5c0dKxXWsOH+C1DeqGgJgkpGICFE7W3dMvTtn+nglxrwoGbd+p0r99Z7lqYL MygUZx5IXStX22egwP94mzwBwonYWGbVc5Hl652b4PXIOlNkwbZF1Rs8i5iotPHpIYiS zKhA== X-Gm-Message-State: AOJu0YwsrXPrWJgWaSALxmGAfoBhsHx3UD5IA384tmJ0ShMLbxdP4jTQ d1BvwJ+w8vfSDq6lExABtEKbMQ8MDHaSq8CsZAiBghhiAMckPD76BnOmGCpqZdXlaYV69T8IFPS p X-Received: by 2002:a05:6a20:3955:b0:1a0:d956:5590 with SMTP id r21-20020a056a20395500b001a0d9565590mr4472195pzg.20.1709356606408; Fri, 01 Mar 2024 21:16:46 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 25/41] target/sparc: Implement LDXEFSR Date: Fri, 1 Mar 2024 19:15:45 -1000 Message-Id: <20240302051601.53649-26-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 | 1 + target/sparc/fop_helper.c | 6 ++++++ target/sparc/translate.c | 11 +++++++++-- target/sparc/insns.decode | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 331acbe8d0..56daf2ad01 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -37,6 +37,7 @@ DEF_HELPER_FLAGS_4(ld_asi, TCG_CALL_NO_WG, i64, env, tl, int, i32) DEF_HELPER_FLAGS_5(st_asi, TCG_CALL_NO_WG, void, env, tl, i64, int, i32) #endif DEF_HELPER_FLAGS_1(get_fsr, TCG_CALL_NO_WG_SE, tl, env) +DEF_HELPER_FLAGS_2(set_fsr_nofcc, TCG_CALL_NO_RWG, void, env, i32) DEF_HELPER_FLAGS_2(set_fsr_nofcc_noftt, TCG_CALL_NO_RWG, void, env, i32) DEF_HELPER_FLAGS_2(fsqrts, TCG_CALL_NO_WG, f32, env, f32) DEF_HELPER_FLAGS_2(fsqrtd, TCG_CALL_NO_WG, f64, env, f64) diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c index 8c07442ad6..a483d69ab7 100644 --- a/target/sparc/fop_helper.c +++ b/target/sparc/fop_helper.c @@ -570,3 +570,9 @@ void helper_set_fsr_nofcc_noftt(CPUSPARCState *env, uint32_t fsr) env->fsr_cexc_ftt |= fsr & FSR_CEXC_MASK; set_fsr_nonsplit(env, fsr); } + +void helper_set_fsr_nofcc(CPUSPARCState *env, uint32_t fsr) +{ + env->fsr_cexc_ftt = fsr & (FSR_CEXC_MASK | FSR_FTT_MASK); + set_fsr_nonsplit(env, fsr); +} diff --git a/target/sparc/translate.c b/target/sparc/translate.c index cab177190a..c26fd04598 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -4454,7 +4454,7 @@ static bool trans_LDFSR(DisasContext *dc, arg_r_r_ri *a) return advance_pc(dc); } -static bool trans_LDXFSR(DisasContext *dc, arg_r_r_ri *a) +static bool do_ldxfsr(DisasContext *dc, arg_r_r_ri *a, bool entire) { #ifdef TARGET_SPARC64 TCGv addr = gen_ldst_addr(dc, a->rs1, a->imm, a->rs2_or_imm); @@ -4479,13 +4479,20 @@ static bool trans_LDXFSR(DisasContext *dc, arg_r_r_ri *a) tcg_gen_extract_i32(cpu_fcc[2], hi, FSR_FCC2_SHIFT - 32, 2); tcg_gen_extract_i32(cpu_fcc[3], hi, FSR_FCC3_SHIFT - 32, 2); - gen_helper_set_fsr_nofcc_noftt(tcg_env, lo); + if (entire) { + gen_helper_set_fsr_nofcc(tcg_env, lo); + } else { + gen_helper_set_fsr_nofcc_noftt(tcg_env, lo); + } return advance_pc(dc); #else return false; #endif } +TRANS(LDXFSR, 64, do_ldxfsr, a, false) +TRANS(LDXEFSR, VIS3B, do_ldxfsr, a, true) + static bool do_stfsr(DisasContext *dc, arg_r_r_ri *a, MemOp mop) { TCGv addr = gen_ldst_addr(dc, a->rs1, a->imm, a->rs2_or_imm); diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 67591b7df9..353d26b9e6 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -589,6 +589,7 @@ STX 11 ..... 011110 ..... . ............. @r_r_i_asi # STXA LDF 11 ..... 100000 ..... . ............. @r_r_ri_na LDFSR 11 00000 100001 ..... . ............. @n_r_ri LDXFSR 11 00001 100001 ..... . ............. @n_r_ri +LDXEFSR 11 00011 100001 ..... . ............. @n_r_ri LDQF 11 ..... 100010 ..... . ............. @q_r_ri_na LDDF 11 ..... 100011 ..... . ............. @d_r_ri_na From patchwork Sat Mar 2 05:15:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777499 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695064wrn; Fri, 1 Mar 2024 21:20:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVVafnRyuDczQZeAiRVlveOhqIcci/R9rRZ2XkSaBF5e0JuupzpbbhuYUwpLzykKVO6NCkTGqh9URJpsrIqH67+ X-Google-Smtp-Source: AGHT+IFa7QOLAoUojvFcI0FrQWRty+YrrzvWDRh5tdBSvfpZ20A5LqwltIJb2ivqC9Jxz4ePgkBn X-Received: by 2002:ad4:5599:0:b0:690:4764:eff6 with SMTP id f25-20020ad45599000000b006904764eff6mr5588343qvx.6.1709356845280; Fri, 01 Mar 2024 21:20:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356845; cv=none; d=google.com; s=arc-20160816; b=uLl6HkdOxoQUs/LrprDMl5npSK/cfl3K/ZXppCTQC0jhKCQl0tFgBs3xm8YQFx1csd R8aJVQ58qqyrmBrLnxE12Ir+vPIVOIBMawo2GzPpHDul0o+aB3O/2PdOtqOoApT0w1IS QwLa+DSbz0UqkQpA9TxB4ub3wJr6KHjpsYv9bXBHLJ7+YseShZB3QAHYMGZMP0JfWD1s KmaH9jeJwCSqTVcOEHZsj8KiiS4BMZV4tqd/V370OaelgVopQxSiE9caL0dghF2MIlXi OSSM4GqywSBsKMuPCdios0iLR5b87QYFikLMfSR9Z71GWI8cH58aZdmEJXOsX9RUxBtp UXew== 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=d0v55yt+Y5Qgy/d3Wvq5QB26rXcnuWZXIdsB8/jEczw=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=O4oGsyQatOtqlnKrx137ZBc90XT1uWhVLT5HKAOk0CRLTHAoCd2EHD/aD+iad96jvn Yv4BahO2LllDYsNSu7RX65wkCKAXTOWsQ+47hxkCgptIehkT1I7bB6BICEldwfPkqjly hwbZGzwKmZka1AbiZNvKbBLHPJ0Ndk2TWdY+Dtc+0Wzex99KNBLsVzriYafv/zUss2Rs m9I3GcWP+vD4sW8mKiKF4pR84YxrG+YIbcYUJ9XVJGXf5BAsINUdvm8x8+E/yknaTem7 PJ7E7T0GPV9SjnAZcbp0ZS85MJii6SJFhK+DutOSw3oMPX6lzmoerv5c6T1CM4P4RSoa 2zRA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iypoZYdk; 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 kl13-20020a056214518d00b006903065874csi5050249qvb.199.2024.03.01.21.20.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:20: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=pass header.i=@linaro.org header.s=google header.b=iypoZYdk; 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 1rgHjx-0002x5-1t; Sat, 02 Mar 2024 00:16:53 -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 1rgHjv-0002rz-NR for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:51 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHju-0007aA-1d for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:51 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-299354e5f01so3095172a91.1 for ; Fri, 01 Mar 2024 21:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356607; x=1709961407; 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=d0v55yt+Y5Qgy/d3Wvq5QB26rXcnuWZXIdsB8/jEczw=; b=iypoZYdkjLzcPG6GVUbvuzFX9Au5RvcBuK4nNclNc5jheygsCScL1OXTQNdCv84XDc 72xclDgJI15VJ2Qqif7QvKAcZpbs+78N+qMJdps88iaoq2RueSIQRaT+dEn/0+5la03G UhfyPr2mirr3TUl9TiMRgr0IxMmjLfqvBNm/XaD4dDkVdENehYNBcBLeyK78GBTukcVh hagDWxdlu+bu95FNtt3dDOw0Dq6eYEOTgqpfN7Z96gcSvQDlTUzgl0ch8slhfiIbOolw UvVtkKecNS99oLNCWYQ6eX2f2T8+qS3tBfe9nXj+ySpfL2xvu1iAZZDbb/qyEK2rWjpg Ymgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356607; x=1709961407; 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=d0v55yt+Y5Qgy/d3Wvq5QB26rXcnuWZXIdsB8/jEczw=; b=VpMh/zLfnKfjNKYYtMcNIyZRkPwk/oQGT1Jd03nSnXv6LC34a7mM0hmxN/h+goTHDP dOv+DHNraE8ekTMGvsZHDKeoZizMYW3HX0zaJB2AtafmrZMVARWgpjoOff9cNlNPy0lR 7/ODXyEpUTo8Q4IIq4TyX3ROnzDcErvR6CgHrZO2IJp1B2hZMwntXo34/W3Rx7o5zRmP eI0TqZXKVbK8CTYp3CqMZ+sIPGiIvcbfY4ankJdr4Pq4cVyg78SlbgEbf9woDPq1tYhD OT7OWkKUZ2h5THZ0CDgLflmjhYeCFJEmIGGr0qEgLwx0oJgROizvBJBMcpCdpAM9c0gi MIvw== X-Gm-Message-State: AOJu0YzxHQ4E1oEuA8JYCKEdpKY918BFmm9t1mUt3h9TzYh4TfI0sa4n /wEoVfsJr/j8WMX/7Vp/bW1PskeucjxHWyV5/8SdxZPHcZzyEhLNuKyS+mzjwjze2aoN3WxRzzW z X-Received: by 2002:a17:90a:c08c:b0:29b:25ba:2586 with SMTP id o12-20020a17090ac08c00b0029b25ba2586mr4995669pjs.15.1709356607690; Fri, 01 Mar 2024 21:16:47 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 26/41] target/sparc: Implement LZCNT Date: Fri, 1 Mar 2024 19:15:46 -1000 Message-Id: <20240302051601.53649-27-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::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 18 ++++++++++++++++++ target/sparc/insns.decode | 1 + 2 files changed, 19 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index c26fd04598..761ae204b9 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -667,6 +667,11 @@ static void gen_op_popc(TCGv dst, TCGv src1, TCGv src2) tcg_gen_ctpop_tl(dst, src2); } +static void gen_op_lzcnt(TCGv dst, TCGv src) +{ + tcg_gen_clzi_tl(dst, src, TARGET_LONG_BITS); +} + #ifndef TARGET_SPARC64 static void gen_helper_array8(TCGv dst, TCGv src1, TCGv src2) { @@ -3869,6 +3874,19 @@ TRANS(EDGE16LN, VIS2, gen_edge, a, 16, 0, 1) TRANS(EDGE32N, VIS2, gen_edge, a, 32, 0, 0) TRANS(EDGE32LN, VIS2, gen_edge, a, 32, 0, 1) +static bool do_rr(DisasContext *dc, arg_r_r *a, + void (*func)(TCGv, TCGv)) +{ + TCGv dst = gen_dest_gpr(dc, a->rd); + TCGv src = gen_load_gpr(dc, a->rs); + + func(dst, src); + gen_store_gpr(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(LZCNT, VIS3, do_rr, a, gen_op_lzcnt) + static bool do_rrr(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv, TCGv, TCGv)) { diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 353d26b9e6..f7f532002a 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -389,6 +389,7 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ ADDXC 10 ..... 110110 ..... 0 0001 0001 ..... @r_r_r ADDXCcc 10 ..... 110110 ..... 0 0001 0011 ..... @r_r_r + LZCNT 10 ..... 110110 00000 0 0001 0111 ..... @r_r2 ALIGNADDR 10 ..... 110110 ..... 0 0001 1000 ..... @r_r_r ALIGNADDRL 10 ..... 110110 ..... 0 0001 1010 ..... @r_r_r From patchwork Sat Mar 2 05:15:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777489 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694726wrn; Fri, 1 Mar 2024 21:19:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVhyi3ImaNAggS5odriAmAGEuPPzNNpHdfWUKZcrr7LutktZQ0kM9cEqWpvCMTbhJ9kuXx765D+qUavH0dsZm72 X-Google-Smtp-Source: AGHT+IEu9kRe/ibFvcLCzh6/AOL+3+qw8jjowWzL1pyHCU+aUNHdI/c6Ti27GIqKloVeMfIE/GeN X-Received: by 2002:a05:620a:215e:b0:787:f993:845a with SMTP id m30-20020a05620a215e00b00787f993845amr3930190qkm.61.1709356755354; Fri, 01 Mar 2024 21:19:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356755; cv=none; d=google.com; s=arc-20160816; b=Y02I1QEb7ZW4Zd48vsOF3Wo6Dnx0mHCo5CjkQFxvgpDwfBiFdTi4Iof76eJRTFq5Y8 dOEi4i4yGojl1eoO+O4oenP0tQeSq/WYt/2QhhSNij29o2wP3LZgv9wHKPbRNCiExAax qVaCXIN3VCA5WPiZRUKWP+VwrD12UHZYzCExnEd8yNYdXPU7iMdFZXZ6FolvYTdILZux k4pSlZvi9aRTPvXTR3kG0CDR2d266R0xBmyFfRmA8+JFiPFiOaSQ7aKj82jwTaLTyhhK U1NyxEkKUiLE+9h+Vwzv62pgz6jCU4NsTYcyLdrL6dN+uWx0jGZGU2ZcTDVyfYF7267g DFCQ== 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=l1ra1voUNK7VumvOysSOTdB5wAQkGxh/tYoZzjk/66s=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=Wjb69ZiJN/u8qesjyT71nihe4VJ2B2fLAOYIVqgVrNmsCYMRTFo34nDxQDVXMsugPp ixH+Ce0LhQsVj4m5MpKgxDe+Vf/ZwoOt7CbgTk8Tw3FJ4Swppj+pzfSvsVffA6I7+3Pu ruPioLoHzG2S+WtKPex/Bx9QuizjP494n/+0KwOoA3kafUC6FDsiKMP9DuAiTdkUf10G 525Sr/5YqL2v59FLGyN1OEEY/t9ZVh1jorrlHSZytZM4WSKoTMc3gOm2JjFGevynkPsS aCba3j7knCeUjmH4UlujgWUxjsylRztAF2LP+r2oX1wlv5UzOVX1Mh2JDIXpG2w1vGua Eg6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OGW891Ut; 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 pa24-20020a05620a831800b00785bfe14653si4915183qkn.187.2024.03.01.21.19.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:19:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OGW891Ut; 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 1rgHjy-0002z6-Ra; Sat, 02 Mar 2024 00:16:54 -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 1rgHjw-0002vt-IF for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:52 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHju-0007aM-Tx for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:52 -0500 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5e42b4bbfa4so2055218a12.1 for ; Fri, 01 Mar 2024 21:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356609; x=1709961409; 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=l1ra1voUNK7VumvOysSOTdB5wAQkGxh/tYoZzjk/66s=; b=OGW891UtAj3u/rccOtn4aiQTDI5v+Wa7RrnE8ZmKoknRjLW0AGiL4opbOxJ+8eXU9d 4rTKLVb5q1r3x1qpBNuLUxLNHN8wWTZCJHVo5mA56NdSj7zFBaCR40q5qqzoS1j4I4P9 /YEcdg7Q3J+sxQkJokLEhPZCTUwqUM0QfmR+nTpCJQAx87fZrSFdgRdunVr3/fhjsy99 6PvjMxDem+wycFXf+RUapPoPQuTwlHlzgcUFX4xxibJl1eNYUE1q6CLMeC6FdvrDbe8S 9uzHM3Dxx02g24iubqXNAGzAyMoNJlpvGrmsrW0XV1KDYpGtHl92nj3RRKJRx0VulMHS Sh0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356609; x=1709961409; 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=l1ra1voUNK7VumvOysSOTdB5wAQkGxh/tYoZzjk/66s=; b=rxRywirzSNju/xhXXt+PLmqH7nq818qaRPTvAk+PBWLyecXoYID1UL0HeHItcpvgYq q5Auy3QETJEfdsglEfzawznVRT8TgCgyyMhPRHaXvECJN0NRgNhCaVehq6oW6Uq4PYCY F0u2WQFf9DYIJ7fFzvvMq34JdnaTNOUPSAFBioNodZl3mdyxSMbMQMSA4Y+YGd09k948 KOWBaqM/hQvyPauBs2pexVWv77Pe5PMDQSd5BzcvpOpoV/scn1RHh/mpnJxK1bcpTCai Fr5IapNolkk3fJl4QQGecxw1n6px949xO9BMAvrDCddQ2mCsd8ajm9p04gw6OeRr4CZm RN3w== X-Gm-Message-State: AOJu0YwVWiwmYqLJVtpQDrRDIM9yaN0kyTHVxCTFOVy0XcYDWKJQdAwB vKf4NS/I2E8LIGi4DV5RNcg2PnYdOzjkQchRke0gNjSNcHv4463nosDLkuosG7y5G/+weaD1Ehz J X-Received: by 2002:a05:6a20:4296:b0:1a1:45f1:562c with SMTP id o22-20020a056a20429600b001a145f1562cmr1234868pzj.6.1709356608993; Fri, 01 Mar 2024 21:16:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 27/41] target/sparc: Implement MOVsTOw, MOVdTOx, MOVwTOs, MOVxTOd Date: Fri, 1 Mar 2024 19:15:47 -1000 Message-Id: <20240302051601.53649-28-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::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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/translate.c | 36 ++++++++++++++++++++++++++++++++++++ target/sparc/insns.decode | 6 ++++++ 2 files changed, 42 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 761ae204b9..70d87a68cc 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5393,6 +5393,42 @@ static bool trans_FLCMPd(DisasContext *dc, arg_FLCMPd *a) return advance_pc(dc); } +static bool do_movf2r(DisasContext *dc, arg_r_r *a, + int (*offset)(unsigned int), + void (*load)(TCGv, TCGv_ptr, tcg_target_long)) +{ + TCGv dst; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + dst = gen_dest_gpr(dc, a->rd); + load(dst, tcg_env, offset(a->rs)); + gen_store_gpr(dc, a->rd, dst); + return advance_pc(dc); +} + +TRANS(MOVsTOsw, VIS3B, do_movf2r, a, gen_offset_fpr_F, tcg_gen_ld32s_tl) +TRANS(MOVsTOuw, VIS3B, do_movf2r, a, gen_offset_fpr_F, tcg_gen_ld32u_tl) +TRANS(MOVdTOx, VIS3B, do_movf2r, a, gen_offset_fpr_D, tcg_gen_ld_tl) + +static bool do_movr2f(DisasContext *dc, arg_r_r *a, + int (*offset)(unsigned int), + void (*store)(TCGv, TCGv_ptr, tcg_target_long)) +{ + TCGv src; + + if (gen_trap_ifnofpu(dc)) { + return true; + } + src = gen_load_gpr(dc, a->rs); + store(src, tcg_env, offset(a->rd)); + return advance_pc(dc); +} + +TRANS(MOVwTOs, VIS3B, do_movr2f, a, gen_offset_fpr_F, tcg_gen_st32_tl) +TRANS(MOVxTOd, VIS3B, do_movr2f, a, gen_offset_fpr_D, tcg_gen_st_tl) + static void sparc_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) { DisasContext *dc = container_of(dcbase, DisasContext, base); diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index f7f532002a..1189ad4c87 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -498,6 +498,12 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FONEd 10 ..... 110110 00000 0 0111 1110 00000 rd=%dfp_rd FONEs 10 rd:5 110110 00000 0 0111 1111 00000 + MOVsTOuw 10 ..... 110110 00000 1 0001 0001 ..... @r_r2 + MOVsTOsw 10 ..... 110110 00000 1 0001 0011 ..... @r_r2 + MOVwTOs 10 ..... 110110 00000 1 0001 1001 ..... @r_r2 + MOVdTOx 10 ..... 110110 00000 1 0001 0000 ..... @r_d2 + MOVxTOd 10 ..... 110110 00000 1 0001 1000 ..... @d_r2 + FLCMPs 10 000 cc:2 110110 rs1:5 1 0101 0001 rs2:5 FLCMPd 10 000 cc:2 110110 ..... 1 0101 0010 ..... \ rs1=%dfp_rs1 rs2=%dfp_rs2 From patchwork Sat Mar 2 05:15:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777478 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694518wrn; Fri, 1 Mar 2024 21:18:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV3QX9vZyLNWRUNqDk+MgIW3rYaLt5SW6nzabIH2Ma1CquFGOIHDt6++vdFa87/5YPwN0M/KFTm8BFAO7X9KGWz X-Google-Smtp-Source: AGHT+IHxVbhJ4Q1eKWWDyYA48CRGq3ZKKSM1E8ltd6eVWKJB73BFacZaTxoPSVrxuI6hz1oGCXbH X-Received: by 2002:a05:6358:4429:b0:17b:f2ae:e561 with SMTP id z41-20020a056358442900b0017bf2aee561mr3459978rwc.30.1709356703504; Fri, 01 Mar 2024 21:18:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356703; cv=none; d=google.com; s=arc-20160816; b=bSMH6rE+Vbg2SGg/UFhirllDH2Jevq+8IQlAHjOLNUyPF+FHKBus1RdyAvBp2QXpuF OAoR+MEjalzJfcSps0pjhPvdjyc+yUNEHqFB9nIuM/9502lCFOryjnDK5Frj7qrFlNB2 YkFrZRNMQ6VN56j56PrVySivsuT33HAqktX0C4JSIHAz2oKvWO3oq83M5WvzSt9m1OBA Qvgb9H5pdr3CNXG+iCvrEyBSFUnEFIii/ta4jGd4ixRoAXaTaRY7zcz+jR2kU8xF/9gZ 1h/giT/5Ztip716qI9X3bCvuRnjPJD1pvuWQgLzda6i9PO8pkDbnYU4ZZ7g0PL9ef9Qh YCcA== 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=N80bNyHooYY1s+fX14oiEH8Mu2Y5C8TRiT0CJYJBJ3g=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=jPBl2wnp4fbcAaG03h0cOzlWbpOI89J17uFrpsbym+cZ2v7L1oDfbcXMWvgrAPHcaP rB7w4Frw1WD7F35a1UUfZIa/O39myQD6wUAEmhvJn/kXL1GyAdklb5r6T3PXwys8vDA6 xqvs7vgIEQbontT2rhBcEaQ+p5zI1+OAAZr/CR59iMSluy2NI0o309y/IA7ZUmosFZnI 6ZfQiUTyxt0gUZQy0MbHLdTGB87EwA7DOP5vE4/zgl0k7Qm2yGGc0R6MmcWRFTFYnpP0 3cyOQl2mWtO34/TB6gX3eOzZC7flTAvtrQMk9t8CvNABFy7qFlol56h9Aq+v2CZOKid8 fesw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VVIahRiO; 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 ay42-20020a05622a22aa00b0042edd854d83si281244qtb.336.2024.03.01.21.18.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:18:23 -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=VVIahRiO; 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 1rgHjz-0002zp-Ex; Sat, 02 Mar 2024 00:16:55 -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 1rgHjx-0002xN-5y for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:53 -0500 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjv-0007aP-IQ for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:52 -0500 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-29a7951c6faso2074562a91.1 for ; Fri, 01 Mar 2024 21:16:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356610; x=1709961410; 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=N80bNyHooYY1s+fX14oiEH8Mu2Y5C8TRiT0CJYJBJ3g=; b=VVIahRiOmHnSrroc58MgPldVGAT6uHXk86c/tY9O5qXoqqDHb52LNVQVd53VF7UCHi hRUjFvvvbbBGhp4sSKtNcpMIF/oM5z26Py+ycVR8dR/dY23VXdUp9DZc7NlQ6LI8477r ewp3VAhsN3WdRD+pEibeyGArZJ0O2yjblD9jqNDRgDMQMiH/PdsBYvJfwHsVrmVIGBYT FNsOyvikSlwgqNqjXN9DdIHW/fnYRepXAKh0AuBbVhIrjd/kjJPqmAgwies//4KHYknL SeX8AwIdSGA3gEMY4xPM3Z8z4h9By2twfnC5nC2BxfEb74NSotV13tSwFnH1UgFSesUQ p0Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356610; x=1709961410; 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=N80bNyHooYY1s+fX14oiEH8Mu2Y5C8TRiT0CJYJBJ3g=; b=HLxVqjjMJviw+HbgNrMr7Y7wyLqrdKpBw//lE0SDu9isB7intOkUqAQHxoNKcKFHO5 qlmeHxHQZUbxQoDF4XGF/87NhVyt/p42kMnk6fO2iOzb/xMxN5sWMB5cOl2+KlmAeoYh VcaldMmEVaUsGP5P2YQAdVP6hUM346c/4mqrra6H9S3VD9BzoDxW/ON+qCLRh1oyHgFC MTdHXqXOKK1x6IKTWkKeXlhN1LmZsajsWL7T/7II5de3XzqtjHiK6vJVyeQ6Ra9eZQEg Wzdqpyq8bQNomNFwsfDAp/gW+Ksc6I6Op/1RAQ2LNalfS4Uq/V8/AYU1/WVril7Sf9aG zE1A== X-Gm-Message-State: AOJu0Yy7ILT19r+AsLuPlbqfc8Rt0BtmklfiRWJKntgvusjbFeReB9K/ yk1bmFgxRyqS4xSN6aK6IyaFZUEmBAGI486uxt/MMGOgqwk0EF36S7yeTenqZOiDUZOcyjgfVCg g X-Received: by 2002:a17:90b:103:b0:29a:e097:50b4 with SMTP id p3-20020a17090b010300b0029ae09750b4mr2890709pjz.46.1709356610250; Fri, 01 Mar 2024 21:16:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 28/41] target/sparc: Implement PDISTN Date: Fri, 1 Mar 2024 19:15:48 -1000 Message-Id: <20240302051601.53649-29-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::1035; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1035.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 11 +++++++++++ target/sparc/insns.decode | 1 + 2 files changed, 12 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 70d87a68cc..8241676174 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -826,6 +826,15 @@ static void gen_op_bshuffle(TCGv_i64 dst, TCGv_i64 src1, TCGv_i64 src2) #endif } +static void gen_op_pdistn(TCGv dst, TCGv_i64 src1, TCGv_i64 src2) +{ +#ifdef TARGET_SPARC64 + gen_helper_pdist(dst, tcg_constant_i64(0), src1, src2); +#else + g_assert_not_reached(); +#endif +} + static void gen_op_fmul8x16al(TCGv_i64 dst, TCGv_i32 src1, TCGv_i32 src2) { tcg_gen_ext16s_i32(src2, src2); @@ -5063,6 +5072,8 @@ TRANS(FPCMPNE8, VIS3B, do_rdd, a, gen_helper_fcmpne8) 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) + 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/insns.decode b/target/sparc/insns.decode index 1189ad4c87..e46c5f7dc4 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -435,6 +435,7 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPACKFIX 10 ..... 110110 00000 0 0011 1101 ..... @d_d2 PDIST 10 ..... 110110 ..... 0 0011 1110 ..... \ &r_r_r_r rd=%dfp_rd rs1=%dfp_rd rs2=%dfp_rs1 rs3=%dfp_rs2 + PDISTN 10 ..... 110110 ..... 0 0011 1111 ..... @r_d_d FMEAN16 10 ..... 110110 ..... 0 0100 0000 ..... @d_d_d FCHKSM16 10 ..... 110110 ..... 0 0100 0100 ..... @d_d_d From patchwork Sat Mar 2 05:15: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: 777500 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695127wrn; Fri, 1 Mar 2024 21:21:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUkOTE6qCyboC3ZTx/lQQtRfopBfyNhzw8w4C4tKwiFhE/3tnPuaDmB+PjekkQ+DDOsdkwhiOBbCMwOZPITlCYK X-Google-Smtp-Source: AGHT+IHZfkxWGfe2V8Mu61koUMRMOjnBVB32fgRXubrPPNzhKo5c7niE8QeFHhQV2MuYCAa6llGX X-Received: by 2002:a05:620a:4959:b0:787:b846:4598 with SMTP id vz25-20020a05620a495900b00787b8464598mr3784432qkn.16.1709356863847; Fri, 01 Mar 2024 21:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356863; cv=none; d=google.com; s=arc-20160816; b=XPTgh5XkgYoq3ON2C2dxgEXxdgKaflXBlUwFLcoaNPlvTTUjd28017DPV8j3J/L98Z U+wiM0WBo7zeo4dJJSL+kMx0z/hUY9iS+CqY25dTc/rKQYMEPb4UQShYjv3181qrT6Cy A5BQivKpmtkRwTvY6RPmqUhuZFrFgO17OkuxdU5Lcm6jrTN/fmOCExC3wBzlCLCnpJ+T DDkA3ih7Tvc2A4/P2akqs3SUTWTHYGKxeuGNXABsOInLcOGDORpGtYoXpMLWJ0lGBkut o9E3YNC0bJyDAFID/I9bgkAQT7D497QrwkUp4VwT5N2wC5L/gFHSNwFgbLyejhrn7Eij TkWg== 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=2pIlJxFLyrRgHEnS/zal5GTDruioP6mNtA/lWa/a6+4=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=0ITOQQX4jpSiVWNg+f1kHPYdBJbuQbduG9lOUuuExC++LfGUaLCOBcmJ9/HMOM0pQN xcMKBGZIy6JRUlYI9oC/EQ4euz8qi+U5L7XEiqFjPP+iaD/txC3JDeeQtGf3+5kZTzmv vhTSFcErZ0xmB5HN8WQgmNHG9lo2zoy1PLLA40tGUPWZh4omBXzAI9GwLaVvr7PMdRei ZP1PU6UlKsEiWkStC6+/enKwKqUTDtdAJOWEawYP0dyHWzmNY99Dv9ZLlfczh+vB3yZX De8UdW5BRib8s+VNSVbcgr3alkqnuXW3PYjDGZ3qP5Y9fMSkD3x8BmndhLbzEfP6BZ3t TfyA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yb1xk0z+; 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 s17-20020a05620a081100b00787ba29c6e4si4911112qks.718.2024.03.01.21.21.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:21:03 -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=yb1xk0z+; 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 1rgHk0-00030I-G6; Sat, 02 Mar 2024 00:16:56 -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 1rgHjz-0002za-0y for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:55 -0500 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjx-0007ah-GV for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:54 -0500 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-5e152c757a5so1988100a12.2 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=1709356611; x=1709961411; 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=2pIlJxFLyrRgHEnS/zal5GTDruioP6mNtA/lWa/a6+4=; b=yb1xk0z+x//86oxFVwhRNL+cYsbMhitaBN1j6X+PHye3Q7+JlVmyq1gONT5qkbtwOj fin9ktE6gCdEK7EeaGqbxXlLdu+ZulFLs/ATykTsReexkBHZe1FwgeA1JYwfkjwN/8MF I4lFgyvQ5kdWYo+bgSl8vzdVMPMGDGkVxCEd3Gp9QxGpPtb+B0H3DPPnSB/aLLW01I4m geEtMNUYUHDVtNX+o3/Pul3w2UGtAlh3FgaftaQyCjEVE+kevxhEHn2T0gYFIy5EbJO5 QynTtdDl0iq+9p50gm+wu9mYudvFrtlwTE4FJrZFRTnv4/PQ4WsNn/tV0dwoAAHhHWEI HO5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356611; x=1709961411; 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=2pIlJxFLyrRgHEnS/zal5GTDruioP6mNtA/lWa/a6+4=; b=bp8ocj2J1/+rFpP6t9St4Jx/yvQTnj4DIFHRlOsF4G6fYVNzBvftDfVJg25jUtnMsV pz7OvHRp0nUv7jiP189enJHR6rVw2Xhwequdrgtamr1ILDsxDwG9FaEnPcRZsFAW8O6I uhP6cEDuG1hw3pn1oHPzd4McKnTghFAOOcMwH8aOt2CTY5dXnVwkh78RAGUrQt5SSQE7 mE3CHUM+uZ0f1EoYUSEKbxMYKKEi2IN8CQYn9yQr7or5qiT1a/1CkMOmYBndUMvdtZBT e1m/WRK6G4OltRM7h0Yp1AJImzmRkeWTdQKP4HmzpBjz++0Bn+O1BwIq0zXsxJD6oHOi 3Plw== X-Gm-Message-State: AOJu0YyuTzqdFg14X/dQslc0rGO9FsDeTMwDyNDUniDwe9yPxcGDOKTG Z4Bl8uAyIoaR8lPkIdNi7AxtPIoWC9ft/KKBXKknOna0qzeN1lqZZ1KN4qIHr4Pv2tlimBO/F2R n X-Received: by 2002:a17:90b:3c1:b0:29a:6903:e6d4 with SMTP id go1-20020a17090b03c100b0029a6903e6d4mr3342057pjb.39.1709356611575; Fri, 01 Mar 2024 21:16:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 29/41] target/sparc: Implement UMULXHI Date: Fri, 1 Mar 2024 19:15:49 -1000 Message-Id: <20240302051601.53649-30-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::52e; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52e.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/translate.c | 8 ++++++++ target/sparc/insns.decode | 1 + 2 files changed, 9 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 8241676174..2d697d2020 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -590,6 +590,12 @@ static void gen_op_smul(TCGv dst, TCGv src1, TCGv src2) gen_op_multiply(dst, src1, src2, 1); } +static void gen_op_umulxhi(TCGv dst, TCGv src1, TCGv src2) +{ + TCGv discard = tcg_temp_new(); + tcg_gen_mulu2_tl(discard, dst, src1, src2); +} + static void gen_op_sdiv(TCGv dst, TCGv src1, TCGv src2) { #ifdef TARGET_SPARC64 @@ -3915,6 +3921,8 @@ TRANS(ARRAY32, VIS1, do_rrr, a, gen_op_array32) TRANS(ADDXC, VIS3, do_rrr, a, gen_op_addxc) TRANS(ADDXCcc, VIS3, do_rrr, a, gen_op_addxccc) +TRANS(UMULXHI, VIS3, do_rrr, a, gen_op_umulxhi) + static void gen_op_alignaddr(TCGv dst, TCGv s1, TCGv s2) { #ifdef TARGET_SPARC64 diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index e46c5f7dc4..0cd1cffe18 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -389,6 +389,7 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ ADDXC 10 ..... 110110 ..... 0 0001 0001 ..... @r_r_r 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 ALIGNADDR 10 ..... 110110 ..... 0 0001 1000 ..... @r_r_r 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 From patchwork Sat Mar 2 05:15:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777503 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695168wrn; Fri, 1 Mar 2024 21:21:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXk0iLVC5bpU0n72pJB76idnSv55RSZCiHP4A51W+txYOFvAdLmVN9CN8OXbOTk+J5MUeq3ONmzfwyXJmJr3Iwu X-Google-Smtp-Source: AGHT+IH46NRrU/Bgztj7A25gKcBi2ML/LhxPToAFgHYVFWl3x6xptUner2hzhK0jmyv/6qEWMXYB X-Received: by 2002:a0c:cd86:0:b0:68f:8921:692c with SMTP id v6-20020a0ccd86000000b0068f8921692cmr3941097qvm.7.1709356872100; Fri, 01 Mar 2024 21:21:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356872; cv=none; d=google.com; s=arc-20160816; b=bAhgYxypXuN2iaEtv3kaLvEs+9eqyYS5Y1gi2NUUY/PoEySo+sQrVNLuFrhoQKpifB qRx4F0VeNX+Og7uvB0tap++lHmxQG3ZX+B0ksDdkBSf+jmNkFep/tk4VqGuYuuvtcCsn w3/qiGHsl/BWAfHb3WpdKvWnKPm0dh7UKdp2xXdUR/0vkjF6gN9S0a3ZIsJ9L84WJnl0 8ed3oPgsNIHukOKJrnMBr5XtC/nNrv8wHisjl8pVjudBMiJUqxpXRdw0TgFSCF6g3bfJ oOsW+DpAeCniITKszy3NezPn/8NlFY2DiPGLw2sCl1h33wGKHnFrPX00JAXD5ZdTAr5/ 9FCA== 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=/AMTS8IZGBJLGJhh9QFN8+rJCfUK9CllRktS73q6w48=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=hjszSJTCvAkTbkQ2G/XJrF9wcO5QiEim20QnXp7Ova2IVrZWmTL3WJ1oogwIsFWddK dNeHGShPfrnApUrl9TK6TkLioxlsyDw1Zh6zHmJxkRHeKB5chJxKHRmc7b+X8yySXSbs DWRIySAC/ew93oWs0oMQZHOV8lAzVLpevKjlB4oyH8GTqPXdGVLpN4PAWg8CuCdgplRs hIBlzWRNwlk0NJfWG1rovClEqqMhIDwjicOeQzVJGgPOFUpTTKDgcU8EgUjLv1DU9A9i MVncuaG0EMzkVKVP8BFiwt0wGILeZkfxPFEfLcj9nPYAGpuVgZeOkebj8X8HbjBgApw5 s0Xw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pt44Azfa; 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 j10-20020a05621419ca00b0068fdc47fd29si5046408qvc.601.2024.03.01.21.21.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:21: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=pass header.i=@linaro.org header.s=google header.b=pt44Azfa; 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 1rgHk3-00031D-4A; Sat, 02 Mar 2024 00:16:59 -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 1rgHk0-00030L-Mv for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:56 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHjz-0007b2-9F for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:16:56 -0500 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-5dbd519bde6so2425157a12.1 for ; Fri, 01 Mar 2024 21:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356614; x=1709961414; 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=/AMTS8IZGBJLGJhh9QFN8+rJCfUK9CllRktS73q6w48=; b=pt44AzfaNElo6zflAE2c5gCb++x9xYsbn8IIDtkNlSibvPK8FMEFrHtSDzW+/+nEQX On8KFuZbSUzVVqIBbuG+gmbYklTiF7qHuflnkctpKmE+KoKvGTvPO5hOqOnLB0rOAH1K Y1yIjyZ1Ehn30unkMpDyd7tx1K5IBOPY/ebc6TfdCkXbZ7de/VYya5yE30dmMr+8pjkt jEI6ExUwDZetK3aoRkO6ZXXWMuBpzFByt2+krWeClerE79N+mjF+OKV9G3JPNfM+Q9wm h+fXmHnCILR7vmx2u6kyD2HU3YLnaWNnzBZsBQ5+cmLtFKVw5ODzJzEhqzefFXNxqt7M jcWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356614; x=1709961414; 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=/AMTS8IZGBJLGJhh9QFN8+rJCfUK9CllRktS73q6w48=; b=xUhyx76TufV3lwV4sknw4z5ey6UwTNZQgqQTT94T20LL2+whfKTy+w2YyebuKv9KKW Mr133aG2VXCTQntvaM4vyy8r5fJbOyXyKpLgpulpEFwWGda+4PFZ4fGJKJnX2U7u+ph0 Rb1fLVux8Cs9WaAIHUJzELW/eYvBxWSwuyjynNVsDtySeThTGe1IADrAxfljNCxfQTEW LCzMwwWeuO1tvBVnJiQJTfzGTaqZ/+a6aIMmdmDgyv7YI7fcW+zEexlwevyZ3/Fzx9Fm UzjZm7UI0Ju8YMlAkxJvdc25JuEo0SBtCom1Xnj7CYWLDlHM6J4P75NvErhfomGORNX8 GXpw== X-Gm-Message-State: AOJu0Yyy7UX2YFoWy+ym9H4LljnDU02tD5MgeZOxS92d0LN1WomV71Ft 2jmBS+NlycPcGGweRW3+hjvYuG0/DB3TFYm16W8usctmSyLVOsqGhWH2oNw36E3HOhlnfs/fKdP d X-Received: by 2002:a05:6a20:3c8d:b0:19e:9c32:6073 with SMTP id b13-20020a056a203c8d00b0019e9c326073mr3958938pzj.12.1709356614105; Fri, 01 Mar 2024 21:16:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 31/41] target/sparc: Enable VIS3 feature bit Date: Fri, 1 Mar 2024 19:15:51 -1000 Message-Id: <20240302051601.53649-32-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::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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 --- linux-user/elfload.c | 1 + target/sparc/cpu.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 5ebf2bf789..89ce0f3167 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -998,6 +998,7 @@ static uint32_t get_elf_hwcap(void) r |= features & CPU_FEATURE_VIS1 ? HWCAP_SPARC_VIS : 0; r |= features & CPU_FEATURE_VIS2 ? HWCAP_SPARC_VIS2 : 0; r |= features & CPU_FEATURE_FMAF ? HWCAP_SPARC_FMAF : 0; + r |= features & CPU_FEATURE_VIS3 ? HWCAP_SPARC_VIS3 : 0; #endif return r; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 491e627899..07d252a35b 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -552,6 +552,7 @@ static const char * const feature_name[] = { [CPU_FEATURE_BIT_VIS1] = "vis1", [CPU_FEATURE_BIT_VIS2] = "vis2", [CPU_FEATURE_BIT_FMAF] = "fmaf", + [CPU_FEATURE_BIT_VIS3] = "vis3", #else [CPU_FEATURE_BIT_MUL] = "mul", [CPU_FEATURE_BIT_DIV] = "div", @@ -876,6 +877,8 @@ static Property sparc_cpu_properties[] = { CPU_FEATURE_BIT_VIS2, false), DEFINE_PROP_BIT("fmaf", SPARCCPU, env.def.features, CPU_FEATURE_BIT_FMAF, false), + DEFINE_PROP_BIT("vis3", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_VIS3, false), #else DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features, CPU_FEATURE_BIT_MUL, false), From patchwork Sat Mar 2 05:15:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777492 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694835wrn; Fri, 1 Mar 2024 21:19:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWhzgV173aQ8tIFUlcH/qFtHVghq5novU4bkila4HfFnSNS9bfTd7lCZuOYmXv9PBMoFwVf2ecBv86Mjti2HOJU X-Google-Smtp-Source: AGHT+IG4WOK882nZdvO3BYZzSqw03kKLHdLi93dhHXjEPxaulz6KrRTIB0GdrNEGCH8BTostpYle X-Received: by 2002:ad4:4f48:0:b0:68f:cd2c:ee9f with SMTP id eu8-20020ad44f48000000b0068fcd2cee9fmr3547976qvb.29.1709356788417; Fri, 01 Mar 2024 21:19:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356788; cv=none; d=google.com; s=arc-20160816; b=DJoU5FQOgosnNqgZwZx8QDkCS5brW4fXRALal5DrnMUIC1aCl1eLGzPInjb6W/bbRF 8C00qjD6dcStEaXE9G/JBTHYzDLUEO91z+NP7znt8EES/g5W6oWv/uMbjRJ/J/nL2FLf HUeO0GXwwCtSVxmFe9jjs3k8W9pgxkr3RCW1u/SFa+ZdDzgayZ7ATs0t2k/I3ae0qWWd C24A65+h8I7RlGdGP3wNJKAptmBM/rANCEaThQm/ypUUzr3wGbzsn7oZDo010ppPjbz4 Lcxb5syrMwaOrdW8LwHbj1tNkU2axf6KRG6KbQGK8J+R81wihQdCGvhkBZ3Hbti3G+BR +YtQ== 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=3Bai8EGD2AgPFui2ur0HGLEHWWRs2OB7r5bHW9xIRW0=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=cyQ9e+lTRm6h4Uh8yb4aXcZ7MrILfIkQI47f+0RXTyNw8n2LI2iLVOXKHn+pc1y6Jl lobyf3VLR3XwR3xedy+PR+R54ZNStdyereYWIRwGwebiFE7Ky3B1dBE1T4n3jEMCcCb8 t+spi+TQfhDnP986cUBLb8WhzvJtOJQIPHdntw+2TB2w5tBeyNT89AwljKg1vggNKp4Q tkQAzifgEYxZlfwLb55qCF1J1eocMNk0q0+Yv3aAMDjSlKS8vgzq93hTAXxsgpya5Z9X VugMm+beG/6ndYnx8e5fLZkKdPiIWmvBlbNk6M1IIuqdbmUabXBFZ44ijFBXjQfS90/9 /ltQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HWC4poqN; 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 5-20020a0562140cc500b0068fe8496480si5105941qvx.233.2024.03.01.21.19.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:19: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=pass header.i=@linaro.org header.s=google header.b=HWC4poqN; 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 1rgHkH-00036T-Si; Sat, 02 Mar 2024 00:17:13 -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 1rgHkG-00036A-C6 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:12 -0500 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 1rgHk0-0007bC-RV for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:12 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6e5d7f1f15bso813029b3a.2 for ; Fri, 01 Mar 2024 21:16:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356615; x=1709961415; 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=3Bai8EGD2AgPFui2ur0HGLEHWWRs2OB7r5bHW9xIRW0=; b=HWC4poqNhkBks3yxnV+z0Y2Cz3wzCbVsGrEPXGhK+aA9NLJf/84IBkIVsZFYxz9Y0q +agc4EmltMPeDJjOON95IvfuMbG7SoRhhvYwrjLGFrCjh/HoMwJTq+bCvCsDdaJrYcvo S/qOqaerZBn9fgfu50NXnGAR5pY1+HXi+nJCihpEsOazeyu106h+wKj4z564In/Kxsq9 NhrY6uY3QqmIMTqI/b49NFvqgAI7nDi7kypQTeJT7PRKB+qbd7VWH8mFytBO9YG330/4 /DlF4gW2ViIDzSYjgqcvcANfx9iCoJgIrgVagpumMzZXMqbnEFBGR9ZTnYPTUsBD7Cda xeoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356615; x=1709961415; 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=3Bai8EGD2AgPFui2ur0HGLEHWWRs2OB7r5bHW9xIRW0=; b=EDLK2JBkE3TOqsGAytslxemIqgTca68VWXJxFKZfgPby1yIhkgRwakDQ631YgbXFel SN3tl6wDXXoD5dv1/6/mpVFrSI9s1taL2TVJf8aYfI0jTFSW/peRfURJ1WdFOPzIo/IJ 44od5C2aEk38JErHZIXsPbMTtgJtckl5K6Lk+YiL86hQGZ5P8fQiHtqVScghsAW67zjy g5lsWXg4HqYcxXfKkHSr2tJlDS5DI3RycnY3fHHZwYOrtQLFF9BjMFeqPO+bC92zG/q9 YShWXSXGTmj9wm84LNYVDPV4F08rvDJjPDBPcZRRiJeaqrTgCXUND46XTJ3VkQfANS2r ddwQ== X-Gm-Message-State: AOJu0Yz24geF8iExZ5eB13hc+J5kP5Sd4ywQdt5I1k/HkuL1vRO71vcb SRXp+ElzxsHCpH6jqfqdK1z4JQrZUYhfjbt4beEuW/RvrZ1uoDqIsgnRwYMIPgsa1SnB7ZdTuDj Q X-Received: by 2002:a05:6a20:8f19:b0:1a1:4628:fd25 with SMTP id b25-20020a056a208f1900b001a14628fd25mr814841pzk.10.1709356615407; Fri, 01 Mar 2024 21:16:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 32/41] target/sparc: Implement IMA extension Date: Fri, 1 Mar 2024 19:15:52 -1000 Message-Id: <20240302051601.53649-33-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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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 Reviewed-by: Philippe Mathieu-Daudé --- linux-user/elfload.c | 1 + target/sparc/cpu.c | 3 +++ target/sparc/translate.c | 24 ++++++++++++++++++++++++ target/sparc/cpu-feature.h.inc | 1 + target/sparc/insns.decode | 3 +++ 5 files changed, 32 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 89ce0f3167..e4ee4750a2 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -999,6 +999,7 @@ static uint32_t get_elf_hwcap(void) r |= features & CPU_FEATURE_VIS2 ? HWCAP_SPARC_VIS2 : 0; r |= features & CPU_FEATURE_FMAF ? HWCAP_SPARC_FMAF : 0; r |= features & CPU_FEATURE_VIS3 ? HWCAP_SPARC_VIS3 : 0; + r |= features & CPU_FEATURE_IMA ? HWCAP_SPARC_IMA : 0; #endif return r; diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 07d252a35b..18dfd90845 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -553,6 +553,7 @@ static const char * const feature_name[] = { [CPU_FEATURE_BIT_VIS2] = "vis2", [CPU_FEATURE_BIT_FMAF] = "fmaf", [CPU_FEATURE_BIT_VIS3] = "vis3", + [CPU_FEATURE_BIT_IMA] = "ima", #else [CPU_FEATURE_BIT_MUL] = "mul", [CPU_FEATURE_BIT_DIV] = "div", @@ -879,6 +880,8 @@ static Property sparc_cpu_properties[] = { CPU_FEATURE_BIT_FMAF, false), DEFINE_PROP_BIT("vis3", SPARCCPU, env.def.features, CPU_FEATURE_BIT_VIS3, false), + DEFINE_PROP_BIT("ima", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_IMA, false), #else DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features, CPU_FEATURE_BIT_MUL, false), diff --git a/target/sparc/translate.c b/target/sparc/translate.c index f8db98c32f..56ee3927af 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -598,6 +598,26 @@ static void gen_op_umulxhi(TCGv dst, TCGv src1, TCGv src2) tcg_gen_mulu2_tl(discard, dst, src1, src2); } +static void gen_op_fpmaddx(TCGv_i64 dst, TCGv_i64 src1, + TCGv_i64 src2, TCGv_i64 src3) +{ + TCGv_i64 t = tcg_temp_new_i64(); + + tcg_gen_mul_i64(t, src1, src2); + tcg_gen_add_i64(dst, src3, t); +} + +static void gen_op_fpmaddxhi(TCGv_i64 dst, TCGv_i64 src1, + TCGv_i64 src2, TCGv_i64 src3) +{ + TCGv_i64 l = tcg_temp_new_i64(); + TCGv_i64 h = tcg_temp_new_i64(); + TCGv_i64 z = tcg_constant_i64(0); + + tcg_gen_mulu2_i64(l, h, src1, src2); + tcg_gen_add2_i64(l, dst, l, h, src3, z); +} + static void gen_op_sdiv(TCGv dst, TCGv src1, TCGv src2) { #ifdef TARGET_SPARC64 @@ -2377,6 +2397,7 @@ static int extract_qfpreg(DisasContext *dc, int x) # define avail_FMAF(C) ((C)->def->features & CPU_FEATURE_FMAF) # define avail_GL(C) ((C)->def->features & CPU_FEATURE_GL) # define avail_HYPV(C) ((C)->def->features & CPU_FEATURE_HYPV) +# define avail_IMA(C) ((C)->def->features & CPU_FEATURE_IMA) # define avail_VIS1(C) ((C)->def->features & CPU_FEATURE_VIS1) # define avail_VIS2(C) ((C)->def->features & CPU_FEATURE_VIS2) # define avail_VIS3(C) ((C)->def->features & CPU_FEATURE_VIS3) @@ -2392,6 +2413,7 @@ static int extract_qfpreg(DisasContext *dc, int x) # define avail_FMAF(C) false # define avail_GL(C) false # define avail_HYPV(C) false +# define avail_IMA(C) false # define avail_VIS1(C) false # define avail_VIS2(C) false # define avail_VIS3(C) false @@ -5194,6 +5216,8 @@ TRANS(FMADDd, FMAF, do_dddd, a, gen_op_fmaddd) TRANS(FMSUBd, FMAF, do_dddd, a, gen_op_fmsubd) TRANS(FNMSUBd, FMAF, do_dddd, a, gen_op_fnmsubd) TRANS(FNMADDd, FMAF, do_dddd, a, gen_op_fnmaddd) +TRANS(FPMADDX, IMA, do_dddd, a, gen_op_fpmaddx) +TRANS(FPMADDXHI, IMA, do_dddd, a, gen_op_fpmaddxhi) static bool do_env_qqq(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i128, TCGv_env, TCGv_i128, TCGv_i128)) diff --git a/target/sparc/cpu-feature.h.inc b/target/sparc/cpu-feature.h.inc index 3913fb4a54..e2e6de9144 100644 --- a/target/sparc/cpu-feature.h.inc +++ b/target/sparc/cpu-feature.h.inc @@ -14,3 +14,4 @@ FEATURE(POWERDOWN) FEATURE(CASA) FEATURE(FMAF) FEATURE(VIS3) +FEATURE(IMA) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 54ba329440..56a82123a9 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -525,6 +525,9 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FNMSUBd 10 ..... 110111 ..... ..... 1010 ..... @d_d_d_d FNMADDs 10 ..... 110111 ..... ..... 1101 ..... @r_r_r_r FNMADDd 10 ..... 110111 ..... ..... 1110 ..... @d_d_d_d + + FPMADDX 10 ..... 110111 ..... ..... 0000 ..... @d_d_d_d + FPMADDXHI 10 ..... 110111 ..... ..... 0100 ..... @d_d_d_d ] NCP 10 ----- 110111 ----- --------- ----- # v8 CPop2 } From patchwork Sat Mar 2 05:15:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777498 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695059wrn; Fri, 1 Mar 2024 21:20:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXRkZYyAZONe3cQ3BR/qRbfhD8phcPzT+O8g9ZrORDKy0sMWgqOZKBbAEQL6fvxLVb2dzALB8bFFlsQ759HDe2W X-Google-Smtp-Source: AGHT+IHBrVsPQ8zd2EHQcsQ12N8diqTzu6XjEAjwgRspdpjHuTa7i9T5l999cnX4h0MHSUNOy2aT X-Received: by 2002:a05:6214:2529:b0:68f:a954:bba1 with SMTP id gg9-20020a056214252900b0068fa954bba1mr10720874qvb.26.1709356844948; Fri, 01 Mar 2024 21:20:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356844; cv=none; d=google.com; s=arc-20160816; b=WBU78i/8yiChxvcLqhqZoY0dcYHFD6UP+yNl/XCUoCFqw/iTCkIo0nbJLBuFmqGWjW K4jOCCD7AhCvCzIqANWDd1W6KaWVVutUmcSICXVI60LBerkTAXwwPmRXwbatraZ/kdpg B4T5vEGdwVaSKAjKYLeuns7+76Y4D0bnM19Y0cnDdMz6PkXrulIuyx1UApSnPcBqrQNo vCzBcA8UOfKdNzSm6VYWM8Zd5IQSr+AWS7XElENvy9zeFiEzsivaiXGgXVHnyKRsQVaF XFfGXs+ynWVQD6T17xRHca4a8OCDE4E/kcwHtv0DdwT9F5kVpomhqS8ErOOfnob4T/dO A3iQ== 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=VsIJr6QEnw4W2YvjzGDYdqQcqjL5PLIBf0yL49rbXJU=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=fGLh47Ez7thEuJRuPBoEjJpH+a0IvROaTiq0XW9tDW9Dxs3S7x9Vx3Xpad9H5sld4W cySeiRg5Gr+Gp+OXlvfGwmRQ7VW9GvyAtCJxLVz97Xraia5jQpgRwSwYiiyeOfrFFlrW IAjka8c9dnOzrbyJ444n0SGNNxSCSjUoeKo1LlWKx5nC8XBzy9xhhfN5QRwyd1CLwO9G U3oGzUCxHhN0UZqXXbDetLPNHEXlIGHGYh3590xCqw+TEYM8I1brMUN/qw2y0h+hjUw4 b3PL7V5A17VqZsvD2xWxVnagrlV6f/MWVyiwhkF8uYy4uHRmw5g6HTNPNSth2hQX1h+v VbSQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FoJLqy5X; 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 im1-20020a056214246100b0068f44cb67c5si5085720qvb.145.2024.03.01.21.20.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:20: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=pass header.i=@linaro.org header.s=google header.b=FoJLqy5X; 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 1rgHk8-00032r-OC; Sat, 02 Mar 2024 00:17:04 -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 1rgHk6-00031v-9Q for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:02 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHk3-0007ba-9b for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:02 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6e5e4b1d1f1so296728b3a.1 for ; Fri, 01 Mar 2024 21:16:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356616; x=1709961416; 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=VsIJr6QEnw4W2YvjzGDYdqQcqjL5PLIBf0yL49rbXJU=; b=FoJLqy5XVz9JIkzfG4sDjxEN0SxtXefwPgH22QXSYR5oGI5Cn0gsILDlBE8IjBxAoN ZpskAm0JhtalfUYHTBTgr/E8nWWYk/pqzcVowCciZ7XedrJx1Iv6jLhls2AOiWO45PpK 96qtUkfSDM2EvumkI3hOsPrtDO250cZxxLska+9zPZienSD5IDsZQf0R7L23bLh9YdOB Z5O2S82VYyccrTtlM1gLY5Xn6FcoSn0vaoyIMZ2KJpHF/JpvzfM49b1wz9MIqRpBHYU5 GKcdD7PUznprKErPXTw5QpRrLMCvYL5RqRmoyJDoUnFc1f4+ZN6SfdOCCCGi2WV+U2K3 yxzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356616; x=1709961416; 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=VsIJr6QEnw4W2YvjzGDYdqQcqjL5PLIBf0yL49rbXJU=; b=r1INtZejZEndV++cJGwMjxnmByR9hyXQKHEFZiHg/EONA2gLGPB1KxD7r/g/rP9zMC oY7J+uBQFuDUTGO+iO/CISX1TG6HiIr0vmNrMHDihrKwG4vRHJxNcsGxewGolcKu+6nf aYFMYU4URuZXjaOOEsUhIvkltKDPoc0HNdxpbEmhCfqqlhd1cM6jZ8Jyu8jehvc5jzGY WXj55GSxb1KjOui8jmuT7Ksov2MMYTSgHRgqAoHCsxZrRmlPTIbZji5FUETKfk2LjO2c ApbdZe0xGvF0aKL2fp6XhsqqDJEjKmO/2fgX/JwrrS0ZWHCx0yH+VD84/vKz4/L7OQQV tijQ== X-Gm-Message-State: AOJu0Yx2Xlggx7lh16K6AGuTr9HjnvHkjuznaBRGcPrqcg7MCIW3JPXG omEYGPyfhndey8G5iPX6GJ15wVxx4xTffBSV6Ru0xjP1ni6SL4c/ZjRHZfWoRNmFYfL7r2AkMEA R X-Received: by 2002:a17:90a:de8c:b0:296:530:996e with SMTP id n12-20020a17090ade8c00b002960530996emr5028429pjv.20.1709356616645; Fri, 01 Mar 2024 21:16:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 33/41] target/sparc: Add feature bit for VIS4 Date: Fri, 1 Mar 2024 19:15:53 -1000 Message-Id: <20240302051601.53649-34-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::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 2 ++ target/sparc/cpu-feature.h.inc | 1 + 2 files changed, 3 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 56ee3927af..77b53cbf3b 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2402,6 +2402,7 @@ static int extract_qfpreg(DisasContext *dc, int x) # define avail_VIS2(C) ((C)->def->features & CPU_FEATURE_VIS2) # define avail_VIS3(C) ((C)->def->features & CPU_FEATURE_VIS3) # define avail_VIS3B(C) avail_VIS3(C) +# define avail_VIS4(C) ((C)->def->features & CPU_FEATURE_VIS4) #else # define avail_32(C) true # define avail_ASR17(C) ((C)->def->features & CPU_FEATURE_ASR17) @@ -2418,6 +2419,7 @@ static int extract_qfpreg(DisasContext *dc, int x) # define avail_VIS2(C) false # define avail_VIS3(C) false # define avail_VIS3B(C) false +# define avail_VIS4(C) false #endif /* Default case for non jump instructions. */ diff --git a/target/sparc/cpu-feature.h.inc b/target/sparc/cpu-feature.h.inc index e2e6de9144..be81005237 100644 --- a/target/sparc/cpu-feature.h.inc +++ b/target/sparc/cpu-feature.h.inc @@ -15,3 +15,4 @@ FEATURE(CASA) FEATURE(FMAF) FEATURE(VIS3) FEATURE(IMA) +FEATURE(VIS4) From patchwork Sat Mar 2 05:15:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777469 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694261wrn; Fri, 1 Mar 2024 21:17:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUkeXM+AcV0rdKY2Iyl6L1XiiziJ4n77b5RXa4uEselIVKXKtAa1KituSpXjwa2KUlQtYfKRsU7YwHF/Pu08cgw X-Google-Smtp-Source: AGHT+IH9PC8AGkCkauCt8a3hdd5anjii6bg+RGDJ8W0uxDPt5E0oNs6E/DiRfN8/5A5TppoabD4o X-Received: by 2002:ac8:5acc:0:b0:42e:c42c:aad with SMTP id d12-20020ac85acc000000b0042ec42c0aadmr3894596qtd.68.1709356646190; Fri, 01 Mar 2024 21:17:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356646; cv=none; d=google.com; s=arc-20160816; b=x+UxTVdN2OoGLPHcKpAPxO9VQiGfkui50lPghkojT/gDihUPuwrMPlm6neorzHizg9 x6+KYSOspGN+K+xUHVmqLnpTk0H5NyiDQFOEQ4DMYK7EsmRW4PzK4lZTTFVh/Ez7rf8V GXGWVnVIA/POiqaWqLsSsxRfpwJDB7cMnkM3MC2fE2MztczE/BxL1kfbhoYSmR0kIqzz 75KLzVi7AuWKK/Ey3jUcCPLREA9F0sfJHrVrx8qFf4l7cQzvPb+QUHPUcYUogEGMXBlV oj5LVyuViyzDgO0di31nRfXtdRFtGOaFY+Yro2qvUZpk6xBr84kLpzeK8oCYlq06PQC1 69bg== 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=85lzAWcXk3QovGlqwazzvFtIeZJWjQqJBGsI6YskhyE=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=vIGFKt0iQzTfkBxvKI4eZWrIh7q3gRr0u2J1UlMFT8qBepwwuB74Qis1EIJg1w8M6m PHcZY822KEYe4moxqiXz1J1yhFYsv5/iPc/FFbQQzmSOgvUch61Kg/IRO7lPffjiP8rH e+XbEsxtqcBfv4NP1jhyFCsUWXpD1VYheHtrQwR/kgAr5INA/weMuQL1GdXr/e/c1/IV ivThBdHMdor13PfEWLHWRmk9igyyn1BZuB5gGLTjc5lczHhq0+bL/J1oB+Kjan5B9rMX 8xqYHgibR83atdfz4uSI4xZcvs9EUFEgcWjk7a/Lr9Kl5Q4mWFGsVwQR4FEOOI62MJP0 yXgQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wMhxFyTZ; 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 g4-20020ac842c4000000b0042e81412054si4691728qtm.718.2024.03.01.21.17.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:17:26 -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=wMhxFyTZ; 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 1rgHkB-00034g-Ax; Sat, 02 Mar 2024 00:17:07 -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 1rgHk9-00033o-SD for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:05 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHk3-0007bf-93 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:05 -0500 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-29ab78237d2so2132613a91.1 for ; Fri, 01 Mar 2024 21:16:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356618; x=1709961418; 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=85lzAWcXk3QovGlqwazzvFtIeZJWjQqJBGsI6YskhyE=; b=wMhxFyTZMAONiGd2xSvgPOPRORtFXAyieyfceNrIuGAWxN9sJhO114oE97nV6Z8sle cnGEyMIdvDSb2QjGOHDGzae42rK3i56KIDdKg2nh7C1od5VhK0uv+19EjH4QfbdOH1dF 7vfni8IoRwutXFCXOKNsJFen20eT1y+Gxu7wNYvK92v+Y2Vyi9SZ6RuUaZ8x1NGAyWAO 5CuX4z39C2IXT6rI/wOg+495LTCsbpaQHvB3Ye+BPKpEhJBhI7yXsjIBUqOJdsaORG8w rGT6B1I1FSZpfGA30bqGoIgE6B5RV43A69FrJMPopkf8/O6dIVScUB4hmTGPsZUtx04f f5Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356618; x=1709961418; 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=85lzAWcXk3QovGlqwazzvFtIeZJWjQqJBGsI6YskhyE=; b=sE7LXZ4yWVKoXl0w/5YAHlPS/Wz36L7quDLxzrB7t2Tg5+Hn/dVRA5pXzTLh48cMyK Qd5u4akwuCkwXXxRwGUMrewhTDvrXxnZGbSnVVo80Agn9+CS6lIpIaPtV8HJnws+niLO 63fZr7Pcos1OqgDgFPXr6GS6K53AnRJWTBJyNZtqov8iJvTtmm8PMeyddK0DDTvKYTxi 0A79Mvp68W347t5wHNsCqzBEcrdejN5kZmQmRWqkUohN8uXJa21BTgTiQNEl80xJxQuB VJY6WlwkD8J21mdHCh2vewvesv2sm/rIzR0P1tNQ3N7VIiusOFzLFMDmDgxAVlnPxcwB l8hA== X-Gm-Message-State: AOJu0Ywag442uz7MJA34wG04f42X9+rr9wK9WSIvHceWgc2IENZQZNBl M6T9r2zEMvu0SACwCzJiq20E4Of5K4HSi37WUIp8GRiZXoIAVoHcizuIUUWz3pEd9QqsvBUhnkR X X-Received: by 2002:a17:90a:b793:b0:29a:7380:53a with SMTP id m19-20020a17090ab79300b0029a7380053amr4117030pjr.34.1709356617982; Fri, 01 Mar 2024 21:16:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 34/41] target/sparc: Implement FALIGNDATAi Date: Fri, 1 Mar 2024 19:15:54 -1000 Message-Id: <20240302051601.53649-35-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::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=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=no 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/translate.c | 33 ++++++++++++++++++++++++++++++--- target/sparc/insns.decode | 1 + 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 77b53cbf3b..8e67d9023d 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -818,7 +818,8 @@ static void gen_op_fpsubs32s(TCGv_i32 d, TCGv_i32 src1, TCGv_i32 src2) tcg_gen_movcond_i32(TCG_COND_LT, d, v, z, t, r); } -static void gen_op_faligndata(TCGv_i64 dst, TCGv_i64 s1, TCGv_i64 s2) +static void gen_op_faligndata_i(TCGv_i64 dst, TCGv_i64 s1, + TCGv_i64 s2, TCGv gsr) { #ifdef TARGET_SPARC64 TCGv t1, t2, shift; @@ -827,7 +828,7 @@ static void gen_op_faligndata(TCGv_i64 dst, TCGv_i64 s1, TCGv_i64 s2) t2 = tcg_temp_new(); shift = tcg_temp_new(); - tcg_gen_andi_tl(shift, cpu_gsr, 7); + tcg_gen_andi_tl(shift, gsr, 7); tcg_gen_shli_tl(shift, shift, 3); tcg_gen_shl_tl(t1, s1, shift); @@ -845,6 +846,11 @@ static void gen_op_faligndata(TCGv_i64 dst, TCGv_i64 s1, TCGv_i64 s2) #endif } +static void gen_op_faligndata_g(TCGv_i64 dst, TCGv_i64 s1, TCGv_i64 s2) +{ + gen_op_faligndata_i(dst, s1, s2, cpu_gsr); +} + static void gen_op_bshuffle(TCGv_i64 dst, TCGv_i64 src1, TCGv_i64 src2) { #ifdef TARGET_SPARC64 @@ -5060,7 +5066,7 @@ TRANS(FORNOTd, VIS1, do_ddd, a, tcg_gen_orc_i64) TRANS(FORd, VIS1, do_ddd, a, tcg_gen_or_i64) TRANS(FPACK32, VIS1, do_ddd, a, gen_op_fpack32) -TRANS(FALIGNDATAg, VIS1, do_ddd, a, gen_op_faligndata) +TRANS(FALIGNDATAg, VIS1, do_ddd, a, gen_op_faligndata_g) TRANS(BSHUFFLE, VIS2, do_ddd, a, gen_op_bshuffle) TRANS(FHADDd, VIS3, do_ddd, a, gen_op_fhaddd) @@ -5221,6 +5227,27 @@ TRANS(FNMADDd, FMAF, do_dddd, a, gen_op_fnmaddd) TRANS(FPMADDX, IMA, do_dddd, a, gen_op_fpmaddx) TRANS(FPMADDXHI, IMA, do_dddd, a, gen_op_fpmaddxhi) +static bool trans_FALIGNDATAi(DisasContext *dc, arg_r_r_r *a) +{ + TCGv_i64 dst, src1, src2; + TCGv src3; + + if (!avail_VIS4(dc)) { + return false; + } + if (gen_trap_ifnofpu(dc)) { + return true; + } + + dst = tcg_temp_new_i64(); + src1 = gen_load_fpr_D(dc, a->rd); + src2 = gen_load_fpr_D(dc, a->rs2); + src3 = gen_load_gpr(dc, a->rs1); + gen_op_faligndata_i(dst, src1, src2, src3); + gen_store_fpr_D(dc, a->rd, dst); + return advance_pc(dc); +} + static bool do_env_qqq(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i128, TCGv_env, TCGv_i128, TCGv_i128)) { diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 56a82123a9..7833437f6c 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -446,6 +446,7 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @d_r_r BSHUFFLE 10 ..... 110110 ..... 0 0100 1100 ..... @d_d_d FEXPAND 10 ..... 110110 00000 0 0100 1101 ..... @r_d2 + FALIGNDATAi 10 ..... 110110 ..... 0 0100 1001 ..... @d_r_d FSRCd 10 ..... 110110 ..... 0 0111 0100 00000 @d_d1 # FSRC1d FSRCs 10 ..... 110110 ..... 0 0111 0101 00000 @r_r1 # FSRC1s From patchwork Sat Mar 2 05:15:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777495 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695017wrn; Fri, 1 Mar 2024 21:20:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXpPDohZ4ZEJsTE+R9MpgjtNF/tTHOZOEz3sTD+m1UUTihdulXJTmW/lm05bN6sSERzKeLDgaU4BCagC//kLNLw X-Google-Smtp-Source: AGHT+IHCw8epguEfOlmiJcTevP8ntBKQ70ViyXtyoZFYIBehk5xIh54G52956Hf0XCLMOLPR0WjG X-Received: by 2002:a0c:f090:0:b0:68f:2b9a:75ec with SMTP id g16-20020a0cf090000000b0068f2b9a75ecmr3447607qvk.61.1709356834072; Fri, 01 Mar 2024 21:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356834; cv=none; d=google.com; s=arc-20160816; b=Z/8h3ImVRekIr0nqqem9Nnz0dAQGJCtRCrildFBw+n5c4LrP8jSAWIEfWX2qpWt7T5 jn0lxHunYz0nPAfo7OkKc/4eUYA7fhSkumkg5Igdn4zggYNkjGSCLHi/p9zf2wxjLlnd pJJ4HYaKrwmpHBl8m4fA4qrmzKaed6+mZRNaesSOlVBiY/TT9J0OdChNv1feiiIu6YUx o8g62YOeli9jQWbZ7Vl5Nh8d/SaLdt+4lDIsEmZraI0aqewU6cHctPrL9dKOz3JkW/Gu JV4m9rFqHLiTtoyj5/7bamA+nEW8QfLN6mamaYsf7a5xE/kfBNFLIsvtxrWeekEGrLs3 vsTA== 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=reIU85DFkHu+nqHrVViTLnYwfJ9p8+zCdkjjovUmIVc=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=YISqt10AZylq2oUKhbeGEH0PRjYeZMNYN2IJZKd2kkkQQJHitiOkrG3w+Ms1ctLF9v 7I7uGg+tPLe6BS3oNG/eR5QT260uglnDTyK8xjs21L1tsBcZEF/C9hp9r0Oj63uY2B3q kd4XguYSZAAkIwmHpA6bcUODDVcKhCDVi8Ku8iCOTYC6y9iFBUboqQAGZ6oSL8q9LQ4J Rp5PuUCEnyMs6jjYqhG19J8OdwcCVTjRAB9uYoWb52QdJjcu+hVo+KUD8WKEfOJBp499 KABpA0WWSa5PJliTlLnrg5jjwRa5A5p3mPAF2W9eY3UuLstsVSXauIXaszw2t3CuMI90 EksQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jEHcTpYy; 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 hu14-20020a056214234e00b0069019d3b4fasi4926045qvb.580.2024.03.01.21.20.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:20:34 -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=jEHcTpYy; 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 1rgHkA-000347-Dz; Sat, 02 Mar 2024 00:17:06 -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 1rgHk6-000325-Gc for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:02 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHk4-0007br-Qe for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:02 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-299c11b250fso1957122a91.2 for ; Fri, 01 Mar 2024 21:17:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356619; x=1709961419; 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=reIU85DFkHu+nqHrVViTLnYwfJ9p8+zCdkjjovUmIVc=; b=jEHcTpYyo0E9pK3yV+xZMYpoNYhxXuZjAEVO1v3Gl6LdBN43DkeFcUKUZvsVkpX8LR kAKa37WAxp1IO4y4V8w/P1mpsj/v0kPsbFSa49mfLvFPbYwOVT95NZWk4pNRI0m9UC7Y xL2RuDpuTJto1X1kUSNPB+JffsTk4r4TygnDKKeNorxyQRi/MGeOAAKjxC2GGWVUR3m1 jwZFZPIULFSoxPO12iC4pIstIP0h8DXoVJTtJGbvwSVR6KXPuZpjIEUgO3MdKsFi9I6e TSUM5IS/W8NCivt6xyLxr+6PLfcS+W7UWG0y7ZHQiQpY6gGiM6Rmo+HM/Jp9b+ZklOy+ NmBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356619; x=1709961419; 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=reIU85DFkHu+nqHrVViTLnYwfJ9p8+zCdkjjovUmIVc=; b=qFcTRhegCLzz8bZazPewRpN6TlPZ25tL3NloteY1iRirqeIrKJIvSw9VVt9Pr5JF61 rgCDRYLVouM/BQd5wou4OF87JltHUk5hb3dXyFlWbu/wywnezDhXzl6bzSZRFKGYByO+ 5hVMWAXT+Fu2q+IT805mC3EvZldNq9joT0WS5Ednnqj3bgd9aieEJYaCwZJaLxHrGkCm rZjV7fDwZvgTZ0oLFK+Z9oxl9h5J6VC7pVldGK7T9lD66ZBbGsZKK7ONCrk7TBsRb65J D1VMgqPYo9zhRuHQQwQy3c0TllsCMexgUKEDFETm2p4Xk2NCqirPHrvMkhz1yF7CBjAE rotg== X-Gm-Message-State: AOJu0YxoJe5cyHCCTTDSdJaKiaB9JlQzBtHnk/5Tuic5Brub/e4CubUs r3oqEQrOo/nP7J0M33BMfXrx/zjrscgn5zhv53i/ZnX5uhlUa6XoDuKcwNHbAO++1ieZ81vPczf r X-Received: by 2002:a17:90a:53c6:b0:299:7120:e08c with SMTP id y64-20020a17090a53c600b002997120e08cmr3279753pjh.22.1709356619457; Fri, 01 Mar 2024 21:16:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:16:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 35/41] target/sparc: Implement 8-bit FPADD, FPADDS, and FPADDUS Date: Fri, 1 Mar 2024 19:15:55 -1000 Message-Id: <20240302051601.53649-36-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::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 11 +++++++++++ target/sparc/insns.decode | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 8e67d9023d..cb5d8c27ae 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5017,17 +5017,28 @@ static bool do_gvec_ddd(DisasContext *dc, arg_r_r_r *a, MemOp vece, return advance_pc(dc); } +TRANS(FPADD8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_add) TRANS(FPADD16, VIS1, do_gvec_ddd, a, MO_16, tcg_gen_gvec_add) TRANS(FPADD32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_add) + +TRANS(FPSUB8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_sub) TRANS(FPSUB16, VIS1, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sub) TRANS(FPSUB32, VIS1, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sub) + TRANS(FCHKSM16, VIS3, do_gvec_ddd, a, MO_16, gen_op_fchksm16) TRANS(FMEAN16, VIS3, do_gvec_ddd, a, MO_16, gen_op_fmean16) +TRANS(FPADDS8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_ssadd) TRANS(FPADDS16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_ssadd) TRANS(FPADDS32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_ssadd) +TRANS(FPADDUS8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_usadd) +TRANS(FPADDUS16, VIS4, do_gvec_ddd, a, MO_16, tcg_gen_gvec_usadd) + +TRANS(FPSUBS8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_sssub) TRANS(FPSUBS16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sssub) TRANS(FPSUBS32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sssub) +TRANS(FPSUBUS8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_ussub) +TRANS(FPSUBUS16, VIS4, do_gvec_ddd, a, MO_16, tcg_gen_gvec_ussub) TRANS(FSLL16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_shlv) TRANS(FSLL32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_shlv) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 7833437f6c..52bacff126 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -509,6 +509,15 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ MOVdTOx 10 ..... 110110 00000 1 0001 0000 ..... @r_d2 MOVxTOd 10 ..... 110110 00000 1 0001 1000 ..... @d_r2 + FPADD8 10 ..... 110110 ..... 1 0010 0100 ..... @d_d_d + FPADDS8 10 ..... 110110 ..... 1 0010 0110 ..... @d_d_d + FPADDUS8 10 ..... 110110 ..... 1 0010 0111 ..... @d_d_d + FPADDUS16 10 ..... 110110 ..... 1 0010 0011 ..... @d_d_d + FPSUB8 10 ..... 110110 ..... 1 0101 0100 ..... @d_d_d + FPSUBS8 10 ..... 110110 ..... 1 0101 0110 ..... @d_d_d + FPSUBUS8 10 ..... 110110 ..... 1 0101 0111 ..... @d_d_d + FPSUBUS16 10 ..... 110110 ..... 1 0101 0011 ..... @d_d_d + FLCMPs 10 000 cc:2 110110 rs1:5 1 0101 0001 rs2:5 FLCMPd 10 000 cc:2 110110 ..... 1 0101 0010 ..... \ rs1=%dfp_rs1 rs2=%dfp_rs2 From patchwork Sat Mar 2 05:15:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777470 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694296wrn; Fri, 1 Mar 2024 21:17:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX00AvNExkY/Q5Pcbl1cEVjtV+37xU4I5ftLsA+XpdDQ1/7OgAv92ALzbB4Mwd5YU+lvshmo5wSLT7zfMv0HCtE X-Google-Smtp-Source: AGHT+IFqlqCLKMIzId+nrS8pFeRlLFrfbbFBRC5LwIFWUO0VldCHQLxj1cCYMl+vlbaSsWng4jdm X-Received: by 2002:a05:620a:4044:b0:787:ef5f:26bf with SMTP id i4-20020a05620a404400b00787ef5f26bfmr4310024qko.17.1709356656449; Fri, 01 Mar 2024 21:17:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356656; cv=none; d=google.com; s=arc-20160816; b=yXsingzdJHUW7YQnMKclu6/uK26xRrxUIkwZW9Inc1LQPWbY3Sy9vM2i0cv5yGHPxF l6UwSbeFoq1tuO5bQDS9VTNasgJPEASIPmb+7OY3zxDRGpd4LpT2Mxb6mRTBymFVBYAF 2gPPcN8bCkgVCOL8PALqOU63ZZ6XK+nw4ijcKmA9J8RaCiEjHw6tMcx24lAROBxtZerz P3HfoN+6HYSMTh6N+mGLLJFfrTSVRH3abLnn4vtea/aCxNsRPcTcJAb8G4BefFhlJelG 7JSwWbGDB/MH4vw9O/RQkpogKBOBpBQ7yPK85RN+w5GUcynIBGqbMNJihCgy+wg6bugU G2ZA== 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=YUmk5rTWWmBgxpLSOi0NCSmwuLbfYTbr59H0j9IrMyY=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=I4BitRPWo/eCQGSBByue7oyenKCW19DrUzFT7m0JrZHxr4KRqEYD5OrE6yHemNB5Hx vZWuMtgR6RyOQmlrUGLsreIW4w+W5Whl8uk4dML28hS1RFsjV3fUG2WEgwJnjG0TMar4 /UrLwGojlqg+aFvyAP/DD2oB9Z6qNvbFrQ35U/yBwopfmM0Ol/Fex9XY0PcaUUdhwACo JgeuOyshV1RWoZE4kZk4s5AE1gmIbNSKKkz3p39sjlUF6iraT61CnbLgvhr+Jx8B8QT5 xaKAJijYEfv8ynhyUH74VRIm4MEBVK8XH6iODEFU+Mf43CBWqWdcNOgxjPSa8ImuqG2C elKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ln2mdldY; 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 v15-20020ae9e30f000000b0078403334a55si5142565qkf.133.2024.03.01.21.17.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:17:36 -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=ln2mdldY; 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 1rgHk9-00033K-J3; Sat, 02 Mar 2024 00:17:05 -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 1rgHk8-00032l-IA for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:04 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHk6-0007c6-E8 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:04 -0500 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5e4613f2b56so2547359a12.1 for ; Fri, 01 Mar 2024 21:17:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356621; x=1709961421; 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=YUmk5rTWWmBgxpLSOi0NCSmwuLbfYTbr59H0j9IrMyY=; b=ln2mdldYlVa8eOYYFN32sLL+cA4zlkyoHproV09TxHDzaKudOBVZorsdrLHhGu8OuV BOH1fogUaBE6Xz9NTapB9np/L5g1tIz8EkzqEyvaRypdEZcfpMQoCJh5rTq3oa2YUNuh m39qfuzSCeL37yAb1ZBhmFHM4Cim6IsUGLCQhf07YnzCU5EYrfL/P0Tobd+W8fD4LD1n TZ2KMpLDjMpRdX0y59rPG/lmv8Cbeo13T/D1cD3WJnRU8HfyRwhTi0NZRkprzuDN73/h vc/1lScr9xGm/Ecjgrrqh/JMe0KBRadDnheLRq5tXGFtx682ysIp+Vq84Es+GAg9+0VO 3bAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356621; x=1709961421; 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=YUmk5rTWWmBgxpLSOi0NCSmwuLbfYTbr59H0j9IrMyY=; b=JxWr4ZcC2ISJwquVE6wIJNzoUV9G5sjzzKqMbABq1ksWb2uWxq7ZuAXjTP9jlG+Ltu UW3K4tS8zaw2nlXs1dXX/tHq40Vk9Y76tmysGbvS4+dObwcMea6cVb/+jUZnm0dc+oHe +vJKUorSzrI7PdxGXBH2ZpnH6Lo7ne2ZtmL5dNDCCjcA+CW1/0tjFAY48UANu0omAr56 mHD5Cz4xSmp+M0DTe0k2mDo7MH5HqUJRxTJkbGdxn0M0LYbHxpwojK/YgbiPHeRgzIDy qp1BycXCccIPuL0pVaEbfsgYEkhewFBO1pWsdra4EbPLlsgOHmhkoOWpVpTUUIdzYV7R HumQ== X-Gm-Message-State: AOJu0YxghtlmKeLC14HQkxOrmtT0gfckki8ihfJneGQW+U/La8IYlCT8 6x7cF019CMqZgGrDXQWJodltnUypT7W0MELAi4zgyeNcVWvQqsFtiPI8qN7YhwIibuVuNrrzAgx Z X-Received: by 2002:a17:90b:23d0:b0:29a:c21c:674d with SMTP id md16-20020a17090b23d000b0029ac21c674dmr3387509pjb.14.1709356620903; Fri, 01 Mar 2024 21:17:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:17:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 36/41] target/sparc: Implement VIS4 comparisons Date: Fri, 1 Mar 2024 19:15:56 -1000 Message-Id: <20240302051601.53649-37-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::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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 VIS4 completes the set, adding missing signed 8-bit ops and missing unsigned 16 and 32-bit ops. Signed-off-by: Richard Henderson --- target/sparc/helper.h | 12 +-- target/sparc/translate.c | 12 +++ target/sparc/vis_helper.c | 170 +++++++++++++++++++++++++++++--------- target/sparc/insns.decode | 6 ++ 4 files changed, 153 insertions(+), 47 deletions(-) diff --git a/target/sparc/helper.h b/target/sparc/helper.h index 9b642fd74b..15ed0a6af3 100644 --- a/target/sparc/helper.h +++ b/target/sparc/helper.h @@ -117,19 +117,19 @@ DEF_HELPER_FLAGS_2(fchksm16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fmean16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fslas16, TCG_CALL_NO_RWG_SE, i64, i64, i64) DEF_HELPER_FLAGS_2(fslas32, TCG_CALL_NO_RWG_SE, i64, i64, i64) -#define VIS_CMPHELPER(name) \ +#define VIS_CMPHELPER(name) \ + DEF_HELPER_FLAGS_2(f##name##8, TCG_CALL_NO_RWG_SE, \ + i64, i64, i64) \ DEF_HELPER_FLAGS_2(f##name##16, TCG_CALL_NO_RWG_SE, \ - i64, i64, i64) \ + i64, i64, i64) \ DEF_HELPER_FLAGS_2(f##name##32, TCG_CALL_NO_RWG_SE, \ i64, i64, i64) VIS_CMPHELPER(cmpgt) VIS_CMPHELPER(cmpeq) VIS_CMPHELPER(cmple) VIS_CMPHELPER(cmpne) -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) +VIS_CMPHELPER(cmpugt) +VIS_CMPHELPER(cmpule) 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 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index cb5d8c27ae..5f1982cecc 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -68,15 +68,21 @@ # define gen_helper_fcmpeq8 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpeq16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpeq32 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpgt8 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpgt16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpgt32 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmple8 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmple16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmple32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpne8 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpne16 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpne32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpule8 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpule16 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpule32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fcmpugt8 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpugt16 ({ qemu_build_not_reached(); NULL; }) +# define gen_helper_fcmpugt32 ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fdtox ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fexpand ({ qemu_build_not_reached(); NULL; }) # define gen_helper_fmul8sux16 ({ qemu_build_not_reached(); NULL; }) @@ -5112,16 +5118,22 @@ TRANS(FPCMPLE16, VIS1, do_rdd, a, gen_helper_fcmple16) TRANS(FPCMPNE16, VIS1, do_rdd, a, gen_helper_fcmpne16) TRANS(FPCMPGT16, VIS1, do_rdd, a, gen_helper_fcmpgt16) TRANS(FPCMPEQ16, VIS1, do_rdd, a, gen_helper_fcmpeq16) +TRANS(FPCMPULE16, VIS4, do_rdd, a, gen_helper_fcmpule16) +TRANS(FPCMPUGT16, VIS4, do_rdd, a, gen_helper_fcmpugt16) TRANS(FPCMPLE32, VIS1, do_rdd, a, gen_helper_fcmple32) TRANS(FPCMPNE32, VIS1, do_rdd, a, gen_helper_fcmpne32) TRANS(FPCMPGT32, VIS1, do_rdd, a, gen_helper_fcmpgt32) TRANS(FPCMPEQ32, VIS1, do_rdd, a, gen_helper_fcmpeq32) +TRANS(FPCMPULE32, VIS4, do_rdd, a, gen_helper_fcmpule32) +TRANS(FPCMPUGT32, VIS4, do_rdd, a, gen_helper_fcmpugt32) TRANS(FPCMPEQ8, VIS3B, do_rdd, a, gen_helper_fcmpeq8) TRANS(FPCMPNE8, VIS3B, do_rdd, a, gen_helper_fcmpne8) TRANS(FPCMPULE8, VIS3B, do_rdd, a, gen_helper_fcmpule8) TRANS(FPCMPUGT8, VIS3B, do_rdd, a, gen_helper_fcmpugt8) +TRANS(FPCMPLE8, VIS4, do_rdd, a, gen_helper_fcmple8) +TRANS(FPCMPGT8, VIS4, do_rdd, a, gen_helper_fcmpgt8) TRANS(PDISTN, VIS3, do_rdd, a, gen_op_pdistn) TRANS(XMULX, VIS3, do_rdd, a, gen_helper_xmulx) diff --git a/target/sparc/vis_helper.c b/target/sparc/vis_helper.c index 387acb3855..c05f3e7b30 100644 --- a/target/sparc/vis_helper.c +++ b/target/sparc/vis_helper.c @@ -49,6 +49,7 @@ target_ulong helper_array8(target_ulong pixel_addr, target_ulong cubesize) #define VIS_W64(n) w[3 - (n)] #define VIS_SW64(n) sw[3 - (n)] #define VIS_L64(n) l[1 - (n)] +#define VIS_SL64(n) sl[1 - (n)] #define VIS_B32(n) b[3 - (n)] #define VIS_W32(n) w[1 - (n)] #else @@ -57,6 +58,7 @@ target_ulong helper_array8(target_ulong pixel_addr, target_ulong cubesize) #define VIS_W64(n) w[n] #define VIS_SW64(n) sw[n] #define VIS_L64(n) l[n] +#define VIS_SL64(n) sl[n] #define VIS_B32(n) b[n] #define VIS_W32(n) w[n] #endif @@ -67,6 +69,7 @@ typedef union { uint16_t w[4]; int16_t sw[4]; uint32_t l[2]; + int32_t sl[2]; uint64_t ll; float64 d; } VIS64; @@ -181,47 +184,6 @@ uint64_t helper_fexpand(uint32_t src2) return d.ll; } -#define VIS_CMPHELPER(name, F) \ - uint64_t name##16(uint64_t src1, uint64_t src2) \ - { \ - VIS64 s, d; \ - \ - s.ll = src1; \ - d.ll = src2; \ - \ - d.VIS_W64(0) = F(s.VIS_W64(0), d.VIS_W64(0)) ? 1 : 0; \ - d.VIS_W64(0) |= F(s.VIS_W64(1), d.VIS_W64(1)) ? 2 : 0; \ - d.VIS_W64(0) |= F(s.VIS_W64(2), d.VIS_W64(2)) ? 4 : 0; \ - d.VIS_W64(0) |= F(s.VIS_W64(3), d.VIS_W64(3)) ? 8 : 0; \ - d.VIS_W64(1) = d.VIS_W64(2) = d.VIS_W64(3) = 0; \ - \ - return d.ll; \ - } \ - \ - uint64_t name##32(uint64_t src1, uint64_t src2) \ - { \ - VIS64 s, d; \ - \ - s.ll = src1; \ - d.ll = src2; \ - \ - d.VIS_L64(0) = F(s.VIS_L64(0), d.VIS_L64(0)) ? 1 : 0; \ - d.VIS_L64(0) |= F(s.VIS_L64(1), d.VIS_L64(1)) ? 2 : 0; \ - d.VIS_L64(1) = 0; \ - \ - return d.ll; \ - } - -#define FCMPGT(a, b) ((a) > (b)) -#define FCMPEQ(a, b) ((a) == (b)) -#define FCMPLE(a, b) ((a) <= (b)) -#define FCMPNE(a, b) ((a) != (b)) - -VIS_CMPHELPER(helper_fcmpgt, FCMPGT) -VIS_CMPHELPER(helper_fcmpeq, FCMPEQ) -VIS_CMPHELPER(helper_fcmple, FCMPLE) -VIS_CMPHELPER(helper_fcmpne, FCMPNE) - uint64_t helper_fcmpeq8(uint64_t src1, uint64_t src2) { uint64_t a = src1 ^ src2; @@ -243,6 +205,25 @@ uint64_t helper_fcmpne8(uint64_t src1, uint64_t src2) return helper_fcmpeq8(src1, src2) ^ 0xff; } +uint64_t helper_fcmple8(uint64_t src1, uint64_t src2) +{ + VIS64 s1, s2; + uint64_t r = 0; + + s1.ll = src1; + s2.ll = src2; + + for (int i = 0; i < 8; ++i) { + r |= (s1.VIS_SB64(i) <= s2.VIS_SB64(i)) << i; + } + return r; +} + +uint64_t helper_fcmpgt8(uint64_t src1, uint64_t src2) +{ + return helper_fcmple8(src1, src2) ^ 0xff; +} + uint64_t helper_fcmpule8(uint64_t src1, uint64_t src2) { VIS64 s1, s2; @@ -262,6 +243,113 @@ uint64_t helper_fcmpugt8(uint64_t src1, uint64_t src2) return helper_fcmpule8(src1, src2) ^ 0xff; } +uint64_t helper_fcmpeq16(uint64_t src1, uint64_t src2) +{ + uint64_t a = src1 ^ src2; + uint64_t m = 0x7fff7fff7fff7fffULL; + uint64_t c = ~(((a & m) + m) | a | m); + + /* a...............b...............c...............d............... */ + c |= c << 15; + /* ab..............bc..............cd..............d............... */ + c |= c << 30; + /* abcd............bcd.............cd..............d............... */ + return c >> 60; +} + +uint64_t helper_fcmpne16(uint64_t src1, uint64_t src2) +{ + return helper_fcmpeq16(src1, src2) ^ 0xf; +} + +uint64_t helper_fcmple16(uint64_t src1, uint64_t src2) +{ + VIS64 s1, s2; + uint64_t r = 0; + + s1.ll = src1; + s2.ll = src2; + + for (int i = 0; i < 4; ++i) { + r |= (s1.VIS_SW64(i) <= s2.VIS_SW64(i)) << i; + } + return r; +} + +uint64_t helper_fcmpgt16(uint64_t src1, uint64_t src2) +{ + return helper_fcmple16(src1, src2) ^ 0xf; +} + +uint64_t helper_fcmpule16(uint64_t src1, uint64_t src2) +{ + VIS64 s1, s2; + uint64_t r = 0; + + s1.ll = src1; + s2.ll = src2; + + for (int i = 0; i < 4; ++i) { + r |= (s1.VIS_W64(i) <= s2.VIS_W64(i)) << i; + } + return r; +} + +uint64_t helper_fcmpugt16(uint64_t src1, uint64_t src2) +{ + return helper_fcmpule16(src1, src2) ^ 0xf; +} + +uint64_t helper_fcmpeq32(uint64_t src1, uint64_t src2) +{ + uint64_t a = src1 ^ src2; + return ((uint32_t)a == 0) | (a >> 32 ? 0 : 2); +} + +uint64_t helper_fcmpne32(uint64_t src1, uint64_t src2) +{ + uint64_t a = src1 ^ src2; + return ((uint32_t)a != 0) | (a >> 32 ? 2 : 0); +} + +uint64_t helper_fcmple32(uint64_t src1, uint64_t src2) +{ + VIS64 s1, s2; + uint64_t r = 0; + + s1.ll = src1; + s2.ll = src2; + + for (int i = 0; i < 2; ++i) { + r |= (s1.VIS_SL64(i) <= s2.VIS_SL64(i)) << i; + } + return r; +} + +uint64_t helper_fcmpgt32(uint64_t src1, uint64_t src2) +{ + return helper_fcmple32(src1, src2) ^ 3; +} + +uint64_t helper_fcmpule32(uint64_t src1, uint64_t src2) +{ + VIS64 s1, s2; + uint64_t r = 0; + + s1.ll = src1; + s2.ll = src2; + + for (int i = 0; i < 2; ++i) { + r |= (s1.VIS_L64(i) <= s2.VIS_L64(i)) << i; + } + return r; +} + +uint64_t helper_fcmpugt32(uint64_t src1, uint64_t src2) +{ + return helper_fcmpule32(src1, src2) ^ 3; +} + uint64_t helper_pdist(uint64_t sum, uint64_t src1, uint64_t src2) { int i; diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 52bacff126..3ff8708304 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -425,6 +425,12 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPCMPUGT8 10 ..... 110110 ..... 1 0010 1000 ..... @r_d_d FPCMPEQ8 10 ..... 110110 ..... 1 0010 0010 ..... @r_d_d FPCMPNE8 10 ..... 110110 ..... 1 0010 1010 ..... @r_d_d + FPCMPLE8 10 ..... 110110 ..... 0 0011 0100 ..... @r_d_d + FPCMPGT8 10 ..... 110110 ..... 0 0011 1100 ..... @r_d_d + FPCMPULE16 10 ..... 110110 ..... 1 0010 1110 ..... @r_d_d + FPCMPUGT16 10 ..... 110110 ..... 1 0010 1011 ..... @r_d_d + FPCMPULE32 10 ..... 110110 ..... 1 0010 1111 ..... @r_d_d + FPCMPUGT32 10 ..... 110110 ..... 1 0010 1100 ..... @r_d_d FMUL8x16 10 ..... 110110 ..... 0 0011 0001 ..... @d_r_d FMUL8x16AU 10 ..... 110110 ..... 0 0011 0011 ..... @d_r_r From patchwork Sat Mar 2 05:15:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777505 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695254wrn; Fri, 1 Mar 2024 21:21:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUzkAN+ZFADB5ogvrDgKnrr75neBnbrBbRH7w3jNQH5lSH18rGN7/IGBFiGVDVQZmGWip09JGzxtVBiSAkkynXg X-Google-Smtp-Source: AGHT+IFybF0mU41OchybDWRCO22rm9/QIhVxTSfbHPlQYZ8c82KfDRzPjp2Gw70Emi1zv+TEZLSf X-Received: by 2002:a05:622a:104e:b0:42e:b936:78b1 with SMTP id f14-20020a05622a104e00b0042eb93678b1mr4296734qte.58.1709356897052; Fri, 01 Mar 2024 21:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356897; cv=none; d=google.com; s=arc-20160816; b=UtEI6R74kQ0gx9zcB+2DBGMReR2wrrbL0fEMDTRN2r5nRBsoYdcles4ushRno+mdSo c9ylD99Zcnyb3Oms6CIkNxZFGglEkVnMfSR/ul2l7aPpzySraQbnGoHLroX2hiC0HFaZ X3MbxEHL22se4W1QY2oUip2CJaCbLPYOMUdESZeGjajWxqmkU1WybkczLXw9IfUbOV3v ylg5xUeNW4ju5VgaHzgTtynkMEU+p/V5FMVNbJaxVasoFHsluLxrYIqtV4FEShEkzfru Y3VQYasydJc4Ew7Nof3+vABLSrxXJVqMJBBamfqwvG6EPH/nUt4CHF1MfYmYUV6hp2SE jFNg== 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=Dlp5CYvPYCSub/jJCvu97wQVLI30QsOi94QgEbRA200=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=cOiNuABovnqpk+kMXknc94R1uy19xdbzB4xhQnglRNuF4dc6I6urd5kVEinPBwbpt/ +oeZWz2ogIfh5nXyWbG3rUetDBar4GlohckMUzV35I4vGgAw+BoJ1xPjUBT135mEDOl9 8mX0yI/BeBwWprywb/qY0+2CB07B4dItTzoXCuEaAcznmX7g1kjmwINnoyZNlNwvxIdX Mu4hnIb6Id2dtzNmb4sYshi/kMXN4/i62L/1ig2hZS0pSxJQXScVJcZoX/JIprO/SxqI fmGNf/1yoeyg/4lS5fcq6Gtkw7GaWkGxTFgTeakE+YnuAh7T4tb1Upope9kHqmZd7gqX WzWA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h12dAxCt; 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 w11-20020ac86b0b000000b0042eb33b1ab8si4781329qts.286.2024.03.01.21.21.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:21:37 -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=h12dAxCt; 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 1rgHkD-00034s-73; Sat, 02 Mar 2024 00:17:09 -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 1rgHk9-00033p-TA for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:05 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHk7-0007cR-M3 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:05 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-299a2456948so2260570a91.1 for ; Fri, 01 Mar 2024 21:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356622; x=1709961422; 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=Dlp5CYvPYCSub/jJCvu97wQVLI30QsOi94QgEbRA200=; b=h12dAxCtqubTyIpMrzYp6dSpg/23UeHz0cNd868Znmp+zqeGbIohvFCpg6qvuG5QSs hQwrxMN4fqlIZWO4d2yMtabzPNbc2qsiIX9xHyIqWH1y1Sk9BNj5HwLTXn39/QTJFl+L ZCmiiMFJzZGyZtl2HdHF1cObnGuAg/u/L3ANWQ7Z+391w1pb4L1Lu1jYCk8XJ8fT4eek Q3s+iy5D+DEt0ywpreRWrsfFg8YNQm39E+bX2zPWj9dQ607HFDy2xePbinBuoB6DfDI5 ZwdA5wPtMyWce5r4jBlRNhsPwdLc0wP9UNYJYbVzj7N/UDcDyZFoxULY5vbnqccHwKlF KHOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356622; x=1709961422; 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=Dlp5CYvPYCSub/jJCvu97wQVLI30QsOi94QgEbRA200=; b=DINV+lKCjaUF2AqC/xfnY8Kk7y7s/d4tn4Puzno3/Di9xGaF92qU6dtC+kguozYkzp l8nCNWkywJm2EN6nCHGwhH0xxb0FHoeF/8kgc4VCgvWgTXDnaMqYwNXY/hltZCqCqLwh XZdKI4+rPD//tAX8UkbuAfSmwC0QUnURYswVcaqsy0CiK9Ialq5WsY16dR51FOgmXubb UKn76Cp/FHuTbTa+VqpSEwycAcoKlaK/+39CK8zbJFYUC7bvwu27OJz2zbaiWZVI4akr p1dPncOVkPD4KEXyilu8mJyI5gkgO4yDFq7g3dC3ow7CezWKS+upqcasY6nL7nwF0mPQ DJ9A== X-Gm-Message-State: AOJu0Yy7XxLhVX43ip7Hd+GAw6W14Cv12Bw4fye1Xw8DBvCPg9IuB4QF R731odPunBWoyWlVTlbrukPHOcSMuWegcFKEjFD2o4M8aZX4vi2y4X7PQe9mUOsZFnk6BwQGYtp F X-Received: by 2002:a17:90a:f191:b0:29b:2a8:9a89 with SMTP id bv17-20020a17090af19100b0029b02a89a89mr3531879pjb.21.1709356622197; Fri, 01 Mar 2024 21:17:02 -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.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:17:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 37/41] target/sparc: Implement FPMIN, FPMAX Date: Fri, 1 Mar 2024 19:15:57 -1000 Message-Id: <20240302051601.53649-38-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::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 14 ++++++++++++++ target/sparc/insns.decode | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 5f1982cecc..8eda190233 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5053,6 +5053,20 @@ TRANS(FSRL32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_shrv) TRANS(FSRA16, VIS3, do_gvec_ddd, a, MO_16, tcg_gen_gvec_sarv) TRANS(FSRA32, VIS3, do_gvec_ddd, a, MO_32, tcg_gen_gvec_sarv) +TRANS(FPMIN8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_smin) +TRANS(FPMIN16, VIS4, do_gvec_ddd, a, MO_16, tcg_gen_gvec_smin) +TRANS(FPMIN32, VIS4, do_gvec_ddd, a, MO_32, tcg_gen_gvec_smin) +TRANS(FPMINU8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_umin) +TRANS(FPMINU16, VIS4, do_gvec_ddd, a, MO_16, tcg_gen_gvec_umin) +TRANS(FPMINU32, VIS4, do_gvec_ddd, a, MO_32, tcg_gen_gvec_umin) + +TRANS(FPMAX8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_smax) +TRANS(FPMAX16, VIS4, do_gvec_ddd, a, MO_16, tcg_gen_gvec_smax) +TRANS(FPMAX32, VIS4, do_gvec_ddd, a, MO_32, tcg_gen_gvec_smax) +TRANS(FPMAXU8, VIS4, do_gvec_ddd, a, MO_8, tcg_gen_gvec_umax) +TRANS(FPMAXU16, VIS4, do_gvec_ddd, a, MO_16, tcg_gen_gvec_umax) +TRANS(FPMAXU32, VIS4, do_gvec_ddd, a, MO_32, tcg_gen_gvec_umax) + static bool do_ddd(DisasContext *dc, arg_r_r_r *a, void (*func)(TCGv_i64, TCGv_i64, TCGv_i64)) { diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 3ff8708304..b7b4bfe92c 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -524,6 +524,20 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ FPSUBUS8 10 ..... 110110 ..... 1 0101 0111 ..... @d_d_d FPSUBUS16 10 ..... 110110 ..... 1 0101 0011 ..... @d_d_d + FPMIN8 10 ..... 110110 ..... 1 0001 1010 ..... @d_d_d + FPMIN16 10 ..... 110110 ..... 1 0001 1011 ..... @d_d_d + FPMIN32 10 ..... 110110 ..... 1 0001 1100 ..... @d_d_d + FPMINU8 10 ..... 110110 ..... 1 0101 1010 ..... @d_d_d + FPMINU16 10 ..... 110110 ..... 1 0101 1011 ..... @d_d_d + FPMINU32 10 ..... 110110 ..... 1 0101 1100 ..... @d_d_d + + FPMAX8 10 ..... 110110 ..... 1 0001 1101 ..... @d_d_d + FPMAX16 10 ..... 110110 ..... 1 0001 1110 ..... @d_d_d + FPMAX32 10 ..... 110110 ..... 1 0001 1111 ..... @d_d_d + FPMAXU8 10 ..... 110110 ..... 1 0101 1101 ..... @d_d_d + FPMAXU16 10 ..... 110110 ..... 1 0101 1110 ..... @d_d_d + FPMAXU32 10 ..... 110110 ..... 1 0101 1111 ..... @d_d_d + FLCMPs 10 000 cc:2 110110 rs1:5 1 0101 0001 rs2:5 FLCMPd 10 000 cc:2 110110 ..... 1 0101 0010 ..... \ rs1=%dfp_rs1 rs2=%dfp_rs2 From patchwork Sat Mar 2 05:15:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777504 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1695241wrn; Fri, 1 Mar 2024 21:21:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUr+15Gxp++jQ0YeMCZu8zrfmyA4bWBckAWbPj9SR+gLxuyveENW96rXtbm7y3x3FuSN0sboQCCz76TPrMXeY2R X-Google-Smtp-Source: AGHT+IG55j7wIA5o/GxC30Tek54rlVZTCG7fN1Kl2UPxJaX5soJokVKWYHaBWCxKcJrIemLQXL00 X-Received: by 2002:a05:620a:12d5:b0:788:1b28:b977 with SMTP id e21-20020a05620a12d500b007881b28b977mr586578qkl.39.1709356894249; Fri, 01 Mar 2024 21:21:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356894; cv=none; d=google.com; s=arc-20160816; b=Z2ywesABDOHWqK8p6mW2mBEGtJAs6MJVStwlUKLLjRP6NQzCUVO4/a3cY8snkAu2eY WLOHP2DKMgEDdegGo8yXF92wgMUGjSBfTZcWwGZZH9DO+WYMkcZdd2NuzKHcn5VCnBAl YiIKa7kEKGGhTQbJAbCi2kxl7X38p++L+Cvx6hBXhwxn/q8pkkBQTxTiBBWGLNMo4+Ie lRDEfg3yiUMGF98jeQN9xGqa/6/brdIegnU+GDx7dcg72dIV9iFAze3Sk1tQMBDd4Dzg 2now0uvmEiYyiJ7YFf0uDp3OlP7g4vj1MhTwRXermPaZ0b2t96ZCWGg906ZpjzPW1xWq K9+A== 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=LpCW2bFOaVG6PHAgK8CQB4NCBtKP041BEGPtL/bAsq4=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=EAmP0HcBnFsvA5pmTG2uaTtjVL0RXA+5wORxkASOebtXutn85Y9RrUNNs8uqNp+nJv r17ypP6/OnzdMlIjKmH14WUM+Cja0ozN8zEPVrKbu/WvXbdNaG2OD6NTNHsxdkP/fSU9 8swtT/VmcmuYzLb02Dxbg5PAc4O26OtyKfApy28qKLouv1ztziqsF/b2gNsPeOkC5oL8 QEucIGQCekjQErx/wA+8+9x/g6h6TSqDsLCS4SUHwmbsEm+aKH4Xg39ZMXrIuZfJgn5+ 7XF8tqmxvc6sYjTmaiDJUmV2KhkZjGshO6Zn/uSJo4SBhXu/PvjbG+nUZtHHItnG6FrE /uZw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nir37rqw; 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 d14-20020a05620a158e00b00787b8dc2aedsi5245990qkk.356.2024.03.01.21.21.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:21:34 -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=Nir37rqw; 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 1rgHkD-00035O-HD; Sat, 02 Mar 2024 00:17:09 -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 1rgHkB-00034q-Rz for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:08 -0500 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHkA-0007cY-9p for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:07 -0500 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3bb9d54575cso1939885b6e.2 for ; Fri, 01 Mar 2024 21:17:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356623; x=1709961423; 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=LpCW2bFOaVG6PHAgK8CQB4NCBtKP041BEGPtL/bAsq4=; b=Nir37rqwzDE0IpInJfFgLpQ92bLjCQuVPr4Q1HQ0xtzbRd7fNC0b2xTefSh20J44Ts EIn1DdkdAcvCt9KrKZq7Z1QHJsEJxXzTxQ+SJd37MONay9BgAT5Fx+/XYxePlYarBVe5 ED/r+gg4pLSgfcTrKfoDnkEFpKhiqnIx6EqQiKKC3ct8TWC/gzNOACbnr4Y4/FKaml8h h/PMZCyrM14tZtxkP/WZVw6Gs8m4zdCp0vUJtGvTFVc1h0B8J4beLnxhqhbV1UzgG3nq CL6u0yU+tK+MeQlozCx9n3grNsluN/Ry4fa7199UsL4yVaMEimWTBsoaK2q1cxNck5Vg T3yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356623; x=1709961423; 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=LpCW2bFOaVG6PHAgK8CQB4NCBtKP041BEGPtL/bAsq4=; b=Ct0b+SBt58ZNilyW4DC4j2xTFs5V3yBaYGWdK+AWUgF9fabHpgvi65pRhsBtYotKD7 j76PfHM7s/Wr+mrozpTyLtLSCtSkYPqA/indFXlglWBo+L6GJZWJcBiFc54Bl5VDHKFT WCoUSZFmbE1cntAFDVkLxdh6xMdVqbuygfJtMZhfAaUPSfN3xGkjdNs2MGmrWT1PUUYJ kHihAiuzhmL0W6zq9w9aiMlCKCtN8LEQr1UiZJTDalTe0vmWjfJni1fhgQA9sol3jOd5 GFx92C84loK7HemspQ9UH5TJ3yE4QFo/IGYKqQhMPy2OWiJ+L3lN7LxdlRzKvREL1zfI chKg== X-Gm-Message-State: AOJu0YzfLjTInQHBBhz9kXqW3WkhwvKPlJNCjGB2Tzq04veXcPkZka0p vnhAWAmN/M9Vuaunp8IL22vKr4cG/wSnAg9f8plDBos1zKMvl/PPfB9GyWxj1xSB0C30+WClgbQ E X-Received: by 2002:a05:6808:1188:b0:3c1:82ae:d61a with SMTP id j8-20020a056808118800b003c182aed61amr4135978oil.14.1709356623467; Fri, 01 Mar 2024 21:17:03 -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.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:17:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 38/41] target/sparc: Implement SUBXC, SUBXCcc Date: Fri, 1 Mar 2024 19:15:58 -1000 Message-Id: <20240302051601.53649-39-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::229; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x229.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/translate.c | 14 ++++++++++++++ target/sparc/insns.decode | 2 ++ 2 files changed, 16 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 8eda190233..4775e39240 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -524,6 +524,17 @@ static void gen_op_subccc(TCGv dst, TCGv src1, TCGv src2) gen_op_subcc_int(dst, src1, src2, gen_carry32()); } +static void gen_op_subxc(TCGv dst, TCGv src1, TCGv src2) +{ + tcg_gen_sub_tl(dst, src1, src2); + tcg_gen_sub_tl(dst, dst, cpu_cc_C); +} + +static void gen_op_subxccc(TCGv dst, TCGv src1, TCGv src2) +{ + gen_op_subcc_int(dst, src1, src2, cpu_cc_C); +} + static void gen_op_mulscc(TCGv dst, TCGv src1, TCGv src2) { TCGv zero = tcg_constant_tl(0); @@ -3959,6 +3970,9 @@ TRANS(ARRAY32, VIS1, do_rrr, a, gen_op_array32) TRANS(ADDXC, VIS3, do_rrr, a, gen_op_addxc) TRANS(ADDXCcc, VIS3, do_rrr, a, gen_op_addxccc) +TRANS(SUBXC, VIS4, do_rrr, a, gen_op_subxc) +TRANS(SUBXCcc, VIS4, do_rrr, a, gen_op_subxccc) + TRANS(UMULXHI, VIS3, do_rrr, a, gen_op_umulxhi) static void gen_op_alignaddr(TCGv dst, TCGv s1, TCGv s2) diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index b7b4bfe92c..1f9e07e526 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -447,6 +447,8 @@ FCMPEq 10 000 cc:2 110101 ..... 0 0101 0111 ..... \ PDISTN 10 ..... 110110 ..... 0 0011 1111 ..... @r_d_d FMEAN16 10 ..... 110110 ..... 0 0100 0000 ..... @d_d_d + SUBXC 10 ..... 110110 ..... 0 0100 0001 ..... @r_r_r + SUBXCcc 10 ..... 110110 ..... 0 0100 0011 ..... @r_r_r FCHKSM16 10 ..... 110110 ..... 0 0100 0100 ..... @d_d_d FALIGNDATAg 10 ..... 110110 ..... 0 0100 1000 ..... @d_d_d FPMERGE 10 ..... 110110 ..... 0 0100 1011 ..... @d_r_r From patchwork Sat Mar 2 05:15:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777488 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1694722wrn; Fri, 1 Mar 2024 21:19:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWymWUMoaBQHOaubAwwQbM/CdVP+A1EJJsA4FVS5GG2DV7tH3oLdPDIjFVd8e77QYQ1OT987oXVWkklswlHLMdw X-Google-Smtp-Source: AGHT+IFjoQpEiKNrmbt39vepBallYHxA4NnTF6vD7jKof2ArGgLVd/stsLCFpWCEF6iWH55NU13l X-Received: by 2002:a05:622a:1a14:b0:42e:b933:2c2b with SMTP id f20-20020a05622a1a1400b0042eb9332c2bmr4757664qtb.1.1709356753647; Fri, 01 Mar 2024 21:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709356753; cv=none; d=google.com; s=arc-20160816; b=FsKMVjCG1uxOQOIeZboyjzvU4Odi/sUNFUx+Mqf+aOCz5zMyfPyG3aVNNGjOLqH0QT M3p7dwSwWFoyxNHhbdrpAis46QKaI02IBAd0cDHuWRIN7+Bs2MFtEPsZHQiqNapLOK5X w6y3erqRUFR6kSjqPoVRbOmsOVENxmuDlHOTPt73a4aR5Xb6gy1p6HSNTd2qFqTThcW0 gL3kfITP6jyzssnmjDU1t/WOfW1l2K2HLO3UWvtNz167huM//Pe+xAbd7/0jNcdZM9R+ c6cbgFqu2yJNrrXauZjd6eE1jsy6jZRPdGXEGDS/CETSbC/aMHxrQ+dJ3IuWk0qx6OE6 qu4g== 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=+1osKk6aSpsOCl7jxzf2LpH2LtOYNkQ4L9oeYiweWNY=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=AMdvcb4oUMwTlypq74Ln648pmyX077scmMB69sDiMdZjNaPmVFAqnV0KbkjGlSXlI4 E88Hfnqs3IVGilr3ZmdaOLeEQc5JXpBluEeo0cKz6pYKnuINGzS2HKDUccQSJ4cl3Dps lU3jXLQaJgAxxAqLav+9zw38zaHSaLdj1A8KISWbm9v1dMfuzJ1ECZfXLARxQ4/2XPp1 fmkBjrZYm63lKNZ+M/EUxytcvQ+zXPhz3wa9q6FN/snrIlM3viEu5xM+c1W/QdlaxQYb 18jlRnk4QCZu37SBLDVlU7SlWuIyCUfR/gx+r4V4mExFekUcM0EypJEQ90ll4VX62lUe aJ3Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yDQigkeI; 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 q7-20020ac84507000000b0042ec64f95c7si3103320qtn.61.2024.03.01.21.19.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:19:13 -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=yDQigkeI; 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 1rgHkF-00035t-4l; Sat, 02 Mar 2024 00:17:11 -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 1rgHkD-00035E-B0 for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:09 -0500 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgHkA-0007cn-Np for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:17:08 -0500 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3bbbc6b4ed1so2009427b6e.2 for ; Fri, 01 Mar 2024 21:17:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709356625; x=1709961425; 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=+1osKk6aSpsOCl7jxzf2LpH2LtOYNkQ4L9oeYiweWNY=; b=yDQigkeIecb87j6j4OHeoVawN2WC3DNdBWAA175I0J9hCsHYUZZtUuBrhnwFXk4qYg VF4eX1WhVsWbMuM9xTvQzqrNVqUBS32xArMlQjObKwvDPFxaB/Gdrt6+X9KUdoZAIr18 lNlElqh82mF7kceVrUO9Adcd6adPXP10nswZvDPRmiOHvuCO2JLDBGnN4n/6fSCYu5L4 oIrgt98zxub8LbO8rF/Yhmg6Ls2zZc8V3yx8eiwC+6VSZWaoWI5Vlb+Kykjh/ib1LKmm I1Jwazalr9KP2AaCfxX+Ypw79Fg2H+CluC6z3yDtcWTb921zerwrJsZCEULtbYXfgMJ6 uEJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709356625; x=1709961425; 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=+1osKk6aSpsOCl7jxzf2LpH2LtOYNkQ4L9oeYiweWNY=; b=PYSvMnesRuM5VhpQssxEf8A/saffZtPdLAUrxhxczApO9fJCNDMkvL5di4Uhk7gHRC /utdc3BFc8yuSrhXpE+7RV4y7ozvMytIYjfK48qWXwuWQXo5b7WiNt00jlg1EmRg5Ujq ovtlK1W7w1xQM4ckH33+CRlGqk5SEvbBVk6WWM9Co/TCGj1xrdTm3vWhXL/4OND991fd NAJuaq1KeUKTEDeqV2SbaQwvaL3B5IMk3sfYIuavD4KJb4kUIWWU9gW5NUubM7exju4Q u8lUY7cWPvFX6OtuPoeALGgQqIXFc8pT7+mE8h2P0g5wobka8HfHJgrOVEPpTxYSyxdd 7yfg== X-Gm-Message-State: AOJu0YxFW9loiWMV3fOjD3Bu/MawImpuV3tW88qpbIwFsi2D4d1zERc5 GQTjVlUsBozbY6y8IqvRpGZaqGzsfdJm4/pS2m3NIdZ7ixzjPh+Ou7X80JcaCegCtThJ9U7hL0o G X-Received: by 2002:a05:6808:1983:b0:3c1:cd9d:7fb5 with SMTP id bj3-20020a056808198300b003c1cd9d7fb5mr4573340oib.4.1709356624789; Fri, 01 Mar 2024 21:17:04 -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.17.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:17:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 39/41] target/sparc: Implement MWAIT Date: Fri, 1 Mar 2024 19:15:59 -1000 Message-Id: <20240302051601.53649-40-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::234; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x234.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/translate.c | 11 +++++++++++ target/sparc/insns.decode | 1 + 2 files changed, 12 insertions(+) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 4775e39240..5694420a93 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -3316,6 +3316,17 @@ static void do_wrpowerdown(DisasContext *dc, TCGv src) TRANS(WRPOWERDOWN, POWERDOWN, do_wr_special, a, supervisor(dc), do_wrpowerdown) +static void do_wrmwait(DisasContext *dc, TCGv src) +{ + /* + * TODO: This is a stub version of mwait, which merely recognizes + * interrupts immediately and does not wait. + */ + dc->base.is_jmp = DISAS_EXIT; +} + +TRANS(WRMWAIT, VIS4, do_wr_special, a, true, do_wrmwait) + static void do_wrpsr(DisasContext *dc, TCGv src) { gen_helper_wrpsr(tcg_env, src); diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode index 1f9e07e526..2927116031 100644 --- a/target/sparc/insns.decode +++ b/target/sparc/insns.decode @@ -124,6 +124,7 @@ CALL 01 i:s30 WRTICK_CMPR 10 10111 110000 ..... . ............. @n_r_ri WRSTICK 10 11000 110000 ..... . ............. @n_r_ri WRSTICK_CMPR 10 11001 110000 ..... . ............. @n_r_ri + WRMWAIT 10 11100 110000 ..... . ............. @n_r_ri ] # Before v8, rs1==0 was WRY, and the rest executed as nop. [ From patchwork Sat Mar 2 05:16:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777508 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1702879wrn; Fri, 1 Mar 2024 21:57:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV9NNXV1ct2TgHOb7L5VzQooqF+fXxcJ2r3lRyAH+IdCrsWVwQhC/pOgJXEmjQzidt7sKO2EJMQ9iFyz00km9t2 X-Google-Smtp-Source: AGHT+IFBLbu/CEpg+VS0r7lUM2ZnWArfTXyCP/EvNJOkX1qQpLr1v96TO/Xrb2nCshU6vlFpbpV+ X-Received: by 2002:ac8:5714:0:b0:42e:d78f:91f3 with SMTP id 20-20020ac85714000000b0042ed78f91f3mr1688826qtw.66.1709359075613; Fri, 01 Mar 2024 21:57:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709359075; cv=none; d=google.com; s=arc-20160816; b=AshQlikwQN0ss/MmVdGFG561iyJwgP1gPrhXm1FL5qZZO3xU3Ki6jPgf0YwXnDW4us XsSB/wNNSLF7qlxqHdcRiJ88yXR5xJmZgEWlKhpxDyMLdRZGIM1jzypFQEQv5y+bTaHA YzcrXEs6S85Ict6HWBduk8d6oeVVSBCYjZ6ycD2pd0pIbHbGyJqvR4n/NmHp2k1TVEYW cAQxHbe6TyFy741H5GIvUXbKDiaQXRe7ck0EfqR3GsLZqSbvIrgk7+7U/2d7huKiDMfV peaaotkuw7nSqSlYJXS4S2rIVQ9V2iJEzKS3g12B+MD8mRb3uekNhEHtEAE+Q57Uk/8q PTTA== 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=NHzxeZahoeOHL3vAMHqU3P9pcDfqE42pzi5+X3i2bNc=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=gz/cgFRbIUCdzN6Zy8gwwXcLnbxFppDedmuDBpGLv2CavNMaXhKlqRTAwVcknXgAhV KNWYdaCEdgxMWwYzXWwEg2k5vnOFwrtO/qcYs773MBh0y3IwrL3TLmZCPHOFli5wxPTd Wlu8wR5jOxQtY4CClECoT6nOJUCU2picAWLrkeeYSSLLrXpyAA0W6QrvPq/QGaMVFTs7 fNPdTcR+YoqTIm6JAwSzf1dgV3J4mJPO1/GlZqQMHwzU5eWICBI/6v9ZUKA3uMrRLTnm LzSGI9s1vNw2tRW0HBON/nwlsUmklyo55cC2H3YwkJkDFtlGsl721GqLZ95dt1I8NsVF PTUA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HYF/nT8Y"; 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 j8-20020ac86648000000b0042eac5e2888si4781650qtp.688.2024.03.01.21.57.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:57: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=pass header.i=@linaro.org header.s=google header.b="HYF/nT8Y"; 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 1rgIMX-0002at-FU; Sat, 02 Mar 2024 00:56:45 -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 1rgIMW-0002ag-4Y for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:56:44 -0500 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgIMU-0000cQ-9q for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:56:43 -0500 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-21fa0ec227eso1400275fac.0 for ; Fri, 01 Mar 2024 21:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709359000; x=1709963800; 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=NHzxeZahoeOHL3vAMHqU3P9pcDfqE42pzi5+X3i2bNc=; b=HYF/nT8Yy4c8dJrJkJp6k0daR3MbLDFjHKJR/mduCX1sdgy5Jac2CI1RJNcuvAMfWW vwuC09nlX1alIcfvdkqCxPZkgEl00/Vv+Pb37S+asUgm7GvueTi/U4Z1+dUFUrMVWNSV SGFDOpIsaUbTTUyRMBsooMGxPoGKis/cekJAvlQpjZNnQ9SRBGICPg7Imvb18RD+71QA K+g2y1LG8YvETS94SNG+Kt/oMu6LXCXuntlNgiu/N23alRdk2b//p0nZV1XXeRsNMpAI HdrOoSTnFHfh3VR8lvwZShFANzj1xyqR7nYcZ1YLd1n9urJDgeVAGFntfi7EnCa9BPtT 3Cxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709359000; x=1709963800; 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=NHzxeZahoeOHL3vAMHqU3P9pcDfqE42pzi5+X3i2bNc=; b=PchPp2j+ScdIAkXsIvoAYpf679yYmQ6tedoKt4uFq5Q85U8WEQgEXZYesxUZ3Q4L7p QUP8poOzw+L+hcJMus7TiJO+TUuUpCFHpfK0bYhKehcmmA3X1bL9hNa1s4ZXukCOZ7Gy fcDQH0W5YPhp43FbgkpviLuIMyMf4tup71HkL8Lqn17qtKZP3hxOHO6Xh5E/Ibmi+sl6 Gnia2Pc3La4eSF6QRiiHv5ghpbMGASnWJ0RjOyJdhkwwZA7McjXexNYxJ66NqfOiuVE2 Z1vEMhR+ulgCvIf3JtqBk8XOXhrnnuxrAl5Fkrpg2HXE/WC6mlldSZQd0os6PvzjTcXE y/zQ== X-Gm-Message-State: AOJu0Yx4mUkTD6Jc2rdrgI5EgBX2wngU+2p6PiblYHoNjWZxvbj0NmD6 LoUi7T5nxvXB/4M9PK/17KvKM36pQelRFeCMsNr3Y8VrTyFsYakgVze74eGxborIneyZKcXrjet 1 X-Received: by 2002:a05:6870:23a9:b0:220:c50e:9133 with SMTP id e41-20020a05687023a900b00220c50e9133mr3390532oap.45.1709359000565; Fri, 01 Mar 2024 21:56:40 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id q13-20020a62e10d000000b006e560192a7dsm3830448pfh.105.2024.03.01.21.56.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:56:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 40/41] target/sparc: Implement monitor asis Date: Fri, 1 Mar 2024 19:16:00 -1000 Message-Id: <20240302051601.53649-41-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=2001:4860:4864:20::35; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x35.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 Ignore the "monitor" portion and treat them the same as their base asis. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/asi.h | 4 ++++ target/sparc/ldst_helper.c | 4 ++++ target/sparc/translate.c | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/target/sparc/asi.h b/target/sparc/asi.h index a66829674b..14ffaa3842 100644 --- a/target/sparc/asi.h +++ b/target/sparc/asi.h @@ -144,6 +144,8 @@ * ASIs, "(4V)" designates SUN4V specific ASIs. "(NG4)" designates SPARC-T4 * and later ASIs. */ +#define ASI_MON_AIUP 0x12 /* (VIS4) Primary, user, monitor */ +#define ASI_MON_AIUS 0x13 /* (VIS4) Secondary, user, monitor */ #define ASI_REAL 0x14 /* Real address, cacheable */ #define ASI_PHYS_USE_EC 0x14 /* PADDR, E-cacheable */ #define ASI_REAL_IO 0x15 /* Real address, non-cacheable */ @@ -257,6 +259,8 @@ #define ASI_UDBL_CONTROL_R 0x7f /* External UDB control regs rd low*/ #define ASI_INTR_R 0x7f /* IRQ vector dispatch read */ #define ASI_INTR_DATAN_R 0x7f /* (III) In irq vector data reg N */ +#define ASI_MON_P 0x84 /* (VIS4) Primary, monitor */ +#define ASI_MON_S 0x85 /* (VIS4) Secondary, monitor */ #define ASI_PIC 0xb0 /* (NG4) PIC registers */ #define ASI_PST8_P 0xc0 /* Primary, 8 8-bit, partial */ #define ASI_PST8_S 0xc1 /* Secondary, 8 8-bit, partial */ diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c index 1ecd58e8ff..82cf4ba074 100644 --- a/target/sparc/ldst_helper.c +++ b/target/sparc/ldst_helper.c @@ -1371,6 +1371,10 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr, case ASI_TWINX_PL: /* Primary, twinx, LE */ case ASI_TWINX_S: /* Secondary, twinx */ case ASI_TWINX_SL: /* Secondary, twinx, LE */ + case ASI_MON_P: + case ASI_MON_S: + case ASI_MON_AIUP: + case ASI_MON_AIUS: /* These are always handled inline. */ g_assert_not_reached(); diff --git a/target/sparc/translate.c b/target/sparc/translate.c index 5694420a93..15c9d5b59a 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -1622,6 +1622,7 @@ static DisasASI resolve_asi(DisasContext *dc, int asi, MemOp memop) case ASI_BLK_AIUP_L_4V: case ASI_BLK_AIUP: case ASI_BLK_AIUPL: + case ASI_MON_AIUP: mem_idx = MMU_USER_IDX; break; case ASI_AIUS: /* As if user secondary */ @@ -1632,6 +1633,7 @@ static DisasASI resolve_asi(DisasContext *dc, int asi, MemOp memop) case ASI_BLK_AIUS_L_4V: case ASI_BLK_AIUS: case ASI_BLK_AIUSL: + case ASI_MON_AIUS: mem_idx = MMU_USER_SECONDARY_IDX; break; case ASI_S: /* Secondary */ @@ -1645,6 +1647,7 @@ static DisasASI resolve_asi(DisasContext *dc, int asi, MemOp memop) case ASI_FL8_SL: case ASI_FL16_S: case ASI_FL16_SL: + case ASI_MON_S: if (mem_idx == MMU_USER_IDX) { mem_idx = MMU_USER_SECONDARY_IDX; } else if (mem_idx == MMU_KERNEL_IDX) { @@ -1662,6 +1665,7 @@ static DisasASI resolve_asi(DisasContext *dc, int asi, MemOp memop) case ASI_FL8_PL: case ASI_FL16_P: case ASI_FL16_PL: + case ASI_MON_P: break; } switch (asi) { @@ -1679,6 +1683,10 @@ static DisasASI resolve_asi(DisasContext *dc, int asi, MemOp memop) case ASI_SL: case ASI_P: case ASI_PL: + case ASI_MON_P: + case ASI_MON_S: + case ASI_MON_AIUP: + case ASI_MON_AIUS: type = GET_ASI_DIRECT; break; case ASI_TWINX_REAL: From patchwork Sat Mar 2 05:16:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 777507 Delivered-To: patch@linaro.org Received: by 2002:adf:e94d:0:b0:33d:f458:43ce with SMTP id m13csp1702824wrn; Fri, 1 Mar 2024 21:57:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWTgTZ9Rko2QfCSyREz0d1+4ieyfv3J7Xs5xsAfHKrMtijWfYLEHpkuiAx1Na4imzq1K1zYbQACwFDV9HRI5f3t X-Google-Smtp-Source: AGHT+IEIJq3CPQBfa5QRmqGVPVoLHBGiRxwDJTzHbAo7Bx1cIy7FpRAc4Gdshd7VqDsq7VOiPb7i X-Received: by 2002:ac8:5c46:0:b0:42e:8caf:571d with SMTP id j6-20020ac85c46000000b0042e8caf571dmr10934065qtj.16.1709359054787; Fri, 01 Mar 2024 21:57:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709359054; cv=none; d=google.com; s=arc-20160816; b=Q9umTWCD7UHJJkkC+P478ypvjvKiGFKgKwog+SCH9EzMX9v9bu1VvNMIk1sS0HaylP IqjTjNC8+zmskUTaKxaSx4gUjOaYVDf5WcliOUxVyL39sonVfCmUuBNDwWG3bHE1sWRE un8y5cD1DKRDIQu9ziuezGhFnVcoEMu3CHk+26OolppPEOkacDuYxi7YQzhVu4npJnvX C+RI07LHt/VvorD3BAJMAobznOv+hV1gQgujQp6sWumNQ0KM4z7E37INeqsCtMmHLEuz KcLfuIoe6KUECohRM0ZCPyghgF4+z0mK4I9TtNR1vFnSwcwlkBDosvP/Eh4mdXQ1buWr KJSw== 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=Y2XfMnQP2A5uod6sG4fZIHBgAmcjlbrOKxKv4ikXrnI=; fh=OY/jf0qYEhT53LcIJp8d/e39mN3vEzshkseI36O8N8s=; b=QVZz+3vtdgL/EDwR3qrIUsoYdNEpAw0tIJuSRStRPwkaz6RkjmCkfK/y9nmFQAs8C7 BePmoAPC7HX3QAxG//OLkY1n2Civj7QD3YYc69Ij4RAaz6WJ+9KvxRJSoyQVzjwsTeLU dm6ZzR5GQHUeVcRqewjf/9eQd9L7cvFYYrZ2IKCe+fddof1YYDW3Eh5bRYPLdjvYRBca EvMpeU2lcld64oCIA2E1BqJTejw+0DElvegb4fVvlHVaXu9cB4OpnZ83JXoWYEc2xnD2 atFBGOyMnJHw+iy/slH3d0VMolGGrdrkkOyz+AO0dBxw07nag943MCIREM6I/d6Sdc3q MZ9A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dLg67cpJ; 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 t7-20020a05622a01c700b0042eb085c93fsi5388927qtw.134.2024.03.01.21.57.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2024 21:57:34 -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=dLg67cpJ; 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 1rgIMY-0002bZ-Dy; Sat, 02 Mar 2024 00:56:46 -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 1rgIMX-0002ax-FJ for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:56:45 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgIMW-0000kF-0F for qemu-devel@nongnu.org; Sat, 02 Mar 2024 00:56:45 -0500 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6e5e4b1d1f1so304446b3a.1 for ; Fri, 01 Mar 2024 21:56:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709359002; x=1709963802; 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=Y2XfMnQP2A5uod6sG4fZIHBgAmcjlbrOKxKv4ikXrnI=; b=dLg67cpJZRK99nu7iL+WezQ5/rjVJWTvuqsmryYn5h3N8BPQsAwzlAc9AFilYEleOI 9wZdLSJls2horMxNhfTRQkD7LnxhswIyi6WjDy9/aV4u46ulvYLyIdmcW1Z2ZMbq21Kj WRa8GPwETJyxHWZpiPHLpo+Oyi/eUrqV9U+jE6GC5OrAhLOZUDkdrmWKygK0Lu/b8nbo d3HDKq+21buvMoQI+uuzKCyLNcTrJk1p0z2Z/HVHb3JJsvaO3TI+31YvpncHtQWOps4U Cy1aA2HX21KZh83FgqnS2wllrYx2kFugMnvAtd0Ik7K2kcmOakIHtqGx77Hrs/ET6NrZ HaEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709359002; x=1709963802; 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=Y2XfMnQP2A5uod6sG4fZIHBgAmcjlbrOKxKv4ikXrnI=; b=cVHp+Cz7EnPMB+xBWQcPkszcSH1YkeViT2/uYkBQPTIeaVaVrm4U4vGR+Uwom0S+l0 iVgnDRW67dCFcaD6Qo4R/uhSPcgSiwvRxCr8Ste6+0hIFcZKMJVLxazS+fT2OfjBJcMi KE19znJTDgAGa+s+4siHlgneUPGpcB1WSsuCEe+wxwF0Ar03+fZNrABJPIifeA7+KKvh 5JA5x90o+TzxqEUJKB6s96NFNGtfbKP2LrScyqVr0a0MsEdz1aQxdEQDXAsAOSMG9MoA HlFaZbDOloJNg06jqPtzBxZ83G9igh2vsUr0zRxf/jPkRNC3Cy/NetPkykaBK1p6SBWo SW2Q== X-Gm-Message-State: AOJu0Yy40tvaEvWdOcKDNOqvgSKACX5rR9+b8xL2JdYfskmxug/zwmRL QRxh5GXJlOzQ4GupUmBLCAOXkfutmBN9SFxXUqYNblpD3TUnimaiVEuuKhCoILIUPVPNyxDjdQ0 q X-Received: by 2002:a05:6a20:d906:b0:1a1:18e6:c8ec with SMTP id jd6-20020a056a20d90600b001a118e6c8ecmr10995232pzb.0.1709359002059; Fri, 01 Mar 2024 21:56:42 -0800 (PST) Received: from stoup.. (098-147-055-211.res.spectrum.com. [98.147.55.211]) by smtp.gmail.com with ESMTPSA id q13-20020a62e10d000000b006e560192a7dsm3830448pfh.105.2024.03.01.21.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 21:56:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: mark.cave-ayland@ilande.co.uk, atar4qemu@gmail.com Subject: [PATCH 41/41] target/sparc: Enable VIS4 feature bit Date: Fri, 1 Mar 2024 19:16:01 -1000 Message-Id: <20240302051601.53649-42-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::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Reviewed-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 18dfd90845..1ffac3dd8a 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -554,6 +554,7 @@ static const char * const feature_name[] = { [CPU_FEATURE_BIT_FMAF] = "fmaf", [CPU_FEATURE_BIT_VIS3] = "vis3", [CPU_FEATURE_BIT_IMA] = "ima", + [CPU_FEATURE_BIT_VIS4] = "vis4", #else [CPU_FEATURE_BIT_MUL] = "mul", [CPU_FEATURE_BIT_DIV] = "div", @@ -882,6 +883,8 @@ static Property sparc_cpu_properties[] = { CPU_FEATURE_BIT_VIS3, false), DEFINE_PROP_BIT("ima", SPARCCPU, env.def.features, CPU_FEATURE_BIT_IMA, false), + DEFINE_PROP_BIT("vis4", SPARCCPU, env.def.features, + CPU_FEATURE_BIT_VIS4, false), #else DEFINE_PROP_BIT("mul", SPARCCPU, env.def.features, CPU_FEATURE_BIT_MUL, false),