From patchwork Fri Jul 24 00:28:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 247098 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp1975926ilg; Thu, 23 Jul 2020 17:28:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCjXpUEmbRJj5m8BgzcmEO8VrrOBeaxFteR6krk3ITcJovPRTttiB5wFO7+eP7ocqvM9Pv X-Received: by 2002:a25:ddc3:: with SMTP id u186mr11155820ybg.152.1595550505993; Thu, 23 Jul 2020 17:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595550505; cv=none; d=google.com; s=arc-20160816; b=lmF1mWQmOVZtY4hGT0MH9ptSbW8bH68qO0ew1iBI06uSsHDfvOKJ5Bf4UTwEUdKtSX TEayp7O0PoQ/JMP3FGeZRMDoAdQoijY9BjT5H5RFv+MK77N8PNM4d0TudbmD91hN6zsW gsi9AGUmqqtVoqKTvOAxoPVrMQly7yqiTHoUaBOhsKWlFaXE8pgowB25VRh/lJCHhi8o JbjL+PoLBdgQW4/Ysxe2FFnZRvsLLuN+0WGQRo2pOU8B7N9eIiQ2cQdqHWpv+I+nf5CH 9+9lFhDNmYnhUTGstFiu65N8HFkMrmz3CW13LSyqQCn4ZxIJVrLt2s8P8v6uQ/8Ed/6N J+OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=cm9Q77zIpSR4g6kAlyZmv1zEyb9gfHMJv/3peZTbcgI=; b=Hr7EUy1JMz/x9nqAeWWyDCac6CFJa+1LybNjU5mWB/1aqi39X8nIUFrXAox0i7wyv5 Yl+R9jHfq6mN+SjI06In9FdMMWjceQhB5hHut1zE52eWmB1hWANUdB1f8KITgvkoyvBu hAmT52YfuVw8gmCqtU6MH0Y4Dcxc98DnJq/3tifC+p5gi0n7+XekwGSj3i4/jmO1dDgg myjlIuj/C44SmAMFtFxrhHLbyVnTvoSb+fykxts7Xgyd5AdFGb4twBP7A9Z4iEsMlfvc CIdD9fE4r+nTYGR9rjtQNIQ9vicpHciyzMyJZOqV4Rcq9ZZGP3MyQNcqR4Oq5pItplQ2 CsRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fs3UQjer; 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=fail (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 e1si4868961ybj.27.2020.07.23.17.28.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jul 2020 17:28:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fs3UQjer; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:47622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jylZZ-00008n-EE for patch@linaro.org; Thu, 23 Jul 2020 20:28:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jylZN-00008a-AW for qemu-devel@nongnu.org; Thu, 23 Jul 2020 20:28:13 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:35708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jylZL-0008EA-Ew for qemu-devel@nongnu.org; Thu, 23 Jul 2020 20:28:12 -0400 Received: by mail-pj1-x1033.google.com with SMTP id f16so4144337pjt.0 for ; Thu, 23 Jul 2020 17:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cm9Q77zIpSR4g6kAlyZmv1zEyb9gfHMJv/3peZTbcgI=; b=fs3UQjerbWhKggKxkwh0PG47Q+Fo+tJzra9jkdtabTg2OFPBpGrQADt7fA46nhoSqx aV/n0YS3OuqUHcMZm+D1JkdiyHjEgdKdgrd9QCz2itbRNgw3/z2CmTIh3vLdDWi9aYVv ligjwtDHNj4WKVUZVYukzbzf2BSMCWHXMWaC8eqzY2wjAIe/dQGt0KaAFaL9aM0G8gAp 4L//N3e+VIP7IobRBAlo5Oski1PZH5gwUQlPopvNUoopjUujs2fILFoaxlGqbXw9AFTv 9wwlTzhHy3MDtu0WDZcMOLOD/9WvgafDgZ9NEK4aFfoYaqHtVCOF0iV8Qs8fYsLLz7QS 01mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=cm9Q77zIpSR4g6kAlyZmv1zEyb9gfHMJv/3peZTbcgI=; b=t6swsUpU8xKbG/oD9LRoQi2rYSa2MSyF767y6THE7kmdL1C+87Rhz2LGK9c9ja6mTK Sqv1ng2tZMtQ6kTUFNcUvANjEI/RZJo75SZBTlLc1HlSE9vPIQhKQf9dDeMnM1Nsen0/ JCjvQDX2KTHd/07QR97YqNbgzlsS5+TZfcDpCuPx9jQnm0Bc9lbhimpcpoC9hZNsfKZc dZHHVhN7kg92nRCh04mzZRzkH6BzNHa0V2v03oPeXnleyhu/a/NP1hJCqXuMZralnAiG NH4rjv61Q0HV4GxrZR4uygSZ/PaCx22FKTDQ7N/+Sel2t9ogtPD+mEw59MDOKb8KwPV6 C55A== X-Gm-Message-State: AOAM533V5qp6SeDeUntPuGJwXctCqd0kdNmJNNLpOKCtiUpL6ug+kiAn NHPlI0KqfnwHC2BU8FNMys2Pv8daKRw= X-Received: by 2002:a17:90a:c592:: with SMTP id l18mr2900897pjt.119.1595550489012; Thu, 23 Jul 2020 17:28:09 -0700 (PDT) Received: from localhost.localdomain (216-160-65-90.tukw.qwest.net. [216.160.65.90]) by smtp.gmail.com with ESMTPSA id q20sm4224635pfn.111.2020.07.23.17.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jul 2020 17:28:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 0/7] target/riscv: NaN-boxing for multiple precison Date: Thu, 23 Jul 2020 17:28:00 -0700 Message-Id: <20200724002807.441147-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 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-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: frank.chang@sifive.com, alistair23@gmail.com, qemu-riscv@nongnu.org, zhiwei_liu@c-sky.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is my take on Liu Zhiwei's patch set: https://patchew.org/QEMU/20200626205917.4545-1-zhiwei_liu@c-sky.com This differs from Zhiwei's v1 in: * If a helper is involved, the helper does the boxing and unboxing. * Which leaves only LDW and FSGN*.S as the only instructions that are expanded inline which need to handle nanboxing. * All mention of RVD is dropped vs boxing. This means that an RVF-only cpu will still generate and check nanboxes into the 64-bit cpu_fpu slots. There should be no way an RVF-only cpu can generate an unboxed cpu_fpu value. This choice is made to speed up the common case: RVF+RVD, so that we do not have to check whether RVD is enabled. * The translate.c primitives take TCGv values rather than fpu regno, which will make it possible to use them with RVV, since v0.9 does proper nanboxing. * I have adjusted the current naming to be float32 specific ("*_s"), to avoid confusion with the float16 data type supported by RVV. r~ LIU Zhiwei (2): target/riscv: Clean up fmv.w.x target/riscv: check before allocating TCG temps Richard Henderson (5): target/riscv: Generate nanboxed results from fp helpers target/riscv: Generalize gen_nanbox_fpr to gen_nanbox_s target/riscv: Generate nanboxed results from trans_rvf.inc.c target/riscv: Check nanboxed inputs to fp helpers target/riscv: Check nanboxed inputs in trans_rvf.inc.c target/riscv/internals.h | 16 ++++ target/riscv/fpu_helper.c | 102 ++++++++++++++++-------- target/riscv/insn_trans/trans_rvd.inc.c | 8 +- target/riscv/insn_trans/trans_rvf.inc.c | 99 ++++++++++++++--------- target/riscv/translate.c | 29 +++++++ 5 files changed, 178 insertions(+), 76 deletions(-) -- 2.25.1