From nobody Tue Feb 10 19:15:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1600910900; cv=none; d=zohomail.com; s=zohoarc; b=HLDWzn0m7c3I0w5uTGECFJALEMaSWAFMuu1DO0gw6kJJ2J3HBryLCBTHGLDDocJ+Tz35eU+8FfSv3mBrda3TnKvjSLzG7UVN7POgwEdyLK0IBfl2AG0HuA5lp4MNwWhBNJzOhk5EApBSK+ilIr/VUvgys6KDbN5QsREKjcumReM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600910900; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Zem0wYaQsDtFgn41N8malHR+nZOq/vMa+XbyiM3d1r8=; b=MZB+s806aemlJTToDlq7zBMAT5oM51/2cw6QkES8NITmiTxCWCsz2EjJRWD6AQHu8mwx4/eAJ3kiy1qC4Q2U5oALGRVtY1/jp2F6G47bQnA5n86yPCg7MXx2c0jRSYC5rHDiDBmrkIoHhGQt/oqEy3scsDt41gcEnCJD9SYQ6pA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1600910900848976.190655819058; Wed, 23 Sep 2020 18:28:20 -0700 (PDT) Received: from localhost ([::1]:46084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLG3X-0001GZ-H2 for importer@patchew.org; Wed, 23 Sep 2020 21:28:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLG0T-0004yX-PB for qemu-devel@nongnu.org; Wed, 23 Sep 2020 21:25:10 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:42792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLG0Q-0005iB-UE for qemu-devel@nongnu.org; Wed, 23 Sep 2020 21:25:09 -0400 Received: by mail-pf1-x442.google.com with SMTP id d6so822808pfn.9 for ; Wed, 23 Sep 2020 18:25:06 -0700 (PDT) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id k27sm938432pgm.29.2020.09.23.18.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 18:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zem0wYaQsDtFgn41N8malHR+nZOq/vMa+XbyiM3d1r8=; b=PjaM2p2I4+bC1TbXtRb/XoTetyId2RQ2/oMO+rBe1TfIGvnJQkBPM4PKpES13uxfER PPzbr8tpePMYVYz67onJHEUxH9fE0i6hS4X95U7BpZCFwEyiQu1liA+vvZ0cbqjFdpDA otRVX+pLl3t/TauomaOzxpYsjrLLFt/GAx94QUnyqXCPJd8EfJPkOnEGbxdnRlWJexwm jEeiAklfL/21Xi5559ONx1J772y92kJOrjBoQp+y12wLfhYZ8dRNcaLjWrqNqQxY2/6n F034KBvNc9AGWUuggNS+1s+D2cpbZWSRBabECiZGSw9t/XzqDiz2SGrJREzXL8RXBQC1 kvyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Zem0wYaQsDtFgn41N8malHR+nZOq/vMa+XbyiM3d1r8=; b=UwohB9DTolBgli7LEAoZGeU/+jthVabZ3hBAn/EuQPXBDwDbwILLT4u0/vqhfE6K+E VuJPWQ5sVLxli9BsjlhxkZDrYa+OHejSlirXGMB30aA9UyNZ6nCrrvrntL5HtDLdMNZI aKacnJgaBc3SMh89adUXkvOYken1hi75NGuao1g7a0Pkzp/15UokPUGOhRBDEf8H/rju NoynFPC98KRY3FUb2At2eKF92/ZEFF8uceOMfGcRN1UFfy1dH8LwcfEm3WaZTZglJrUB Z3AbgnYygPBiov9Ua7gMwq5KVgyyAO4lMuZppeIQyb6ZY8jyclC2GF41x6BN3YxUlxeV 3S/A== X-Gm-Message-State: AOAM533+tZfcKzAnKepto4mkyy3JPee8sUNTMesFLLeLY2HMewbh2/Pb C/9J7uzarm24EvS46NPP/OxnY4uTnjVboA== X-Google-Smtp-Source: ABdhPJyKF/A2/Y9FTAVuEIVGg2nHn3VaP7wnFq8+u2dJRbsZUZvXYZXN0GbYrItN9co87f4zcbQbxA== X-Received: by 2002:a65:5c8b:: with SMTP id a11mr1951021pgt.272.1600910704930; Wed, 23 Sep 2020 18:25:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 8/8] softfloat: Use aarch64 assembly for {add,sub}{192,256} Date: Wed, 23 Sep 2020 18:24:53 -0700 Message-Id: <20200924012453.659757-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200924012453.659757-1-richard.henderson@linaro.org> References: <20200924012453.659757-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x442.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 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: bharata@linux.ibm.com, alex.bennee@linaro.org, david@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The compiler cannot chain more than two additions together. Use inline assembly for 3 or 4 additions. Signed-off-by: Richard Henderson --- include/fpu/softfloat-macros.h | 14 ++++++++++++++ fpu/softfloat.c | 25 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/include/fpu/softfloat-macros.h b/include/fpu/softfloat-macros.h index 99fa124e56..969a486fd2 100644 --- a/include/fpu/softfloat-macros.h +++ b/include/fpu/softfloat-macros.h @@ -442,6 +442,13 @@ static inline void "adc %3, %0" : "=3D&r"(*z0Ptr), "=3D&r"(*z1Ptr), "=3D&r"(*z2Ptr) : "rm"(b0), "rm"(b1), "rm"(b2), "0"(a0), "1"(a1), "2"(a2)); +#elif defined(__aarch64__) + asm("adds %2, %x5, %x8\n\t" + "adcs %1, %x4, %x7\n\t" + "adc %0, %x3, %x6" + : "=3D&r"(*z0Ptr), "=3D&r"(*z1Ptr), "=3D&r"(*z2Ptr) + : "rZ"(a0), "rZ"(a1), "rZ"(a2), "rZ"(b0), "rZ"(b1), "rZ"(b2) + : "cc"); #else uint64_t z0, z1, z2; int8_t carry0, carry1; @@ -507,6 +514,13 @@ static inline void "sbb %3, %0" : "=3D&r"(*z0Ptr), "=3D&r"(*z1Ptr), "=3D&r"(*z2Ptr) : "rm"(b0), "rm"(b1), "rm"(b2), "0"(a0), "1"(a1), "2"(a2)); +#elif defined(__aarch64__) + asm("subs %2, %x5, %x8\n\t" + "sbcs %1, %x4, %x7\n\t" + "sbc %0, %x3, %x6" + : "=3D&r"(*z0Ptr), "=3D&r"(*z1Ptr), "=3D&r"(*z2Ptr) + : "rZ"(a0), "rZ"(a1), "rZ"(a2), "rZ"(b0), "rZ"(b1), "rZ"(b2) + : "cc"); #else uint64_t z0, z1, z2; int8_t borrow0, borrow1; diff --git a/fpu/softfloat.c b/fpu/softfloat.c index d8e5d90fd7..1601095d60 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -7305,6 +7305,16 @@ static void sub256(uint64_t r[4], uint64_t a[4], uin= t64_t b[4]) : "=3D&r"(r[0]), "=3D&r"(r[1]), "=3D&r"(r[2]), "=3D&r"(r[3]) : "rme"(b[0]), "rme"(b[1]), "rme"(b[2]), "rme"(b[3]), "0"(a[0]), "1"(a[1]), "2"(a[2]), "3"(a[3])); +#elif defined(__aarch64__) + asm("subs %[r3], %x[a3], %x[b3]\n\t" + "sbcs %[r2], %x[a2], %x[b2]\n\t" + "sbcs %[r1], %x[a1], %x[b1]\n\t" + "sbc %[r0], %x[a0], %x[b0]" + : [r0] "=3D&r"(r[0]), [r1] "=3D&r"(r[1]), + [r2] "=3D&r"(r[2]), [r3] "=3D&r"(r[3]) + : [a0] "rZ"(a[0]), [a1] "rZ"(a[1]), [a2] "rZ"(a[2]), [a3] "rZ"(a[3= ]), + [b0] "rZ"(b[0]), [b1] "rZ"(b[1]), [b2] "rZ"(b[2]), [b3] "rZ"(b[3= ]) + : "cc"); #else bool borrow =3D false; =20 @@ -7330,6 +7340,13 @@ static void neg256(uint64_t a[4]) "sbb %4, %0" : "=3D&r"(a[0]), "=3D&r"(a[1]), "=3D&r"(a[2]), "+rm"(a[3]) : "rme"(a[0]), "rme"(a[1]), "rme"(a[2]), "0"(0), "1"(0), "2"(0)); +#elif defined(__aarch64__) + asm("negs %3, %3\n\t" + "ngcs %2, %2\n\t" + "ngcs %1, %1\n\t" + "ngc %0, %0" + : "+r"(a[0]), "+r"(a[1]), "+r"(a[2]), "+r"(a[3]) + : : "cc"); #else a[3] =3D -a[3]; if (likely(a[3])) { @@ -7364,6 +7381,14 @@ static void add256(uint64_t a[4], uint64_t b[4]) "adc %4, %0" : "+r"(a[0]), "+r"(a[1]), "+r"(a[2]), "+r"(a[3]) : "rme"(b[0]), "rme"(b[1]), "rme"(b[2]), "rme"(b[3])); +#elif defined(__aarch64__) + asm("adds %3, %3, %x7\n\t" + "adcs %2, %2, %x6\n\t" + "adcs %1, %1, %x5\n\t" + "adc %0, %0, %x4" + : "+r"(a[0]), "+r"(a[1]), "+r"(a[2]), "+r"(a[3]) + : "rZ"(b[0]), "rZ"(b[1]), "rZ"(b[2]), "rZ"(b[3]) + : "cc"); #else bool carry =3D false; =20 --=20 2.25.1