From nobody Fri Nov 7 13:01:38 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538763128715662.551718512717; Fri, 5 Oct 2018 11:12:08 -0700 (PDT) Received: from localhost ([::1]:36433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8Ua6-00022P-9c for importer@patchew.org; Fri, 05 Oct 2018 14:12:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8UQg-0000Wx-Mz for qemu-devel@nongnu.org; Fri, 05 Oct 2018 14:02:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8UQd-0004wA-Oy for qemu-devel@nongnu.org; Fri, 05 Oct 2018 14:02:22 -0400 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]:34985) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g8UQd-0004V3-3w for qemu-devel@nongnu.org; Fri, 05 Oct 2018 14:02:19 -0400 Received: by mail-oi1-x234.google.com with SMTP id 22-v6so10114912oiz.2 for ; Fri, 05 Oct 2018 11:02:17 -0700 (PDT) Received: from cloudburst.twiddle.net ([187.217.230.84]) by smtp.gmail.com with ESMTPSA id d37-v6sm2601302otb.0.2018.10.05.11.02.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Oct 2018 11:02:15 -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=cRmMqmBeH6CVVhBpy5pb3rhG/pnTWg+KHZ8CbvTFIJs=; b=YDGPbONuppbjhEjwu1q/ZTnfA2WIo6p3YCVccMgwln8K0M2VkOM11u3LfU7k0YLzZq VqEpPkxGmvJRDUJKDjyNO7R2kvFWZLFiFnBeJM76Dt35v5ygN77RCwQshVrfLn/JBq2U PlHlRJHtW9PeoCE+Gn26HBcbIXXEyFaKlR7fQ= 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=cRmMqmBeH6CVVhBpy5pb3rhG/pnTWg+KHZ8CbvTFIJs=; b=RWwr5CXBRpAiI2ncmjgzajgPTK7wmSRaYm2VTRIEOuWyd68f/E07Po5SB1DrT101tP dUNcQRyfcT1fGWQ0OPobC3MqRzkCGJVG/MZOaaOH9aGiNsKABcFLMzJCQeJ7oXzFXoie YRKKwsSzIIcP/623bRyjxLLtRX/svFrHLWnpd+G6V3mQmjf6gmmKu4hg7ZLThw+SYNpV Yx3IVF31oTkB5AV63NiYuageMoAtMZb4w/RWG51lmVb9gCXJ+XvWbH6ufmOwbki/TlpX ZqVf9noqcat2418GHmN4GmQ8A2C3RNk2Q8cFOu4u/r4HR4HJxNko802dk1joi/FfEjWV jcBQ== X-Gm-Message-State: ABuFfojTxv1AAVfMMeHsLsGrvXQTrRXL7vrt/hdY5ZKNuw5B723GhNOq aUsDVYGLmw9/T0/iMFANpWqTQAKCRKXFUXVXy7w= X-Google-Smtp-Source: ACcGV63bzEIhfJQEGcxFrO+MhLUsaaFCi0T8AfkqQ6aSiRX7MN6zSzqTuUS2vyPfKMjRb3RhHAmeCw== X-Received: by 2002:aca:5e83:: with SMTP id s125-v6mr41726oib.134.1538762536724; Fri, 05 Oct 2018 11:02:16 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 13:01:59 -0500 Message-Id: <20181005180201.11387-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181005180201.11387-1-richard.henderson@linaro.org> References: <20181005180201.11387-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::234 Subject: [Qemu-devel] [PULL 6/8] softfloat: Specialize udiv_qrnnd for x86_64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDMRC_1 RDKM_2 RSF_0 Z_629925259 SPT_0 The ISA has a 128/64-bit division instruction. Tested-by: Emilio G. Cota Tested-by: Alex Benn=C3=A9e Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Richard Henderson --- include/fpu/softfloat-macros.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/fpu/softfloat-macros.h b/include/fpu/softfloat-macros.h index a1d99c730d..39eb08b4f1 100644 --- a/include/fpu/softfloat-macros.h +++ b/include/fpu/softfloat-macros.h @@ -637,6 +637,11 @@ static inline uint64_t estimateDiv128To64(uint64_t a0,= uint64_t a1, uint64_t b) static inline uint64_t udiv_qrnnd(uint64_t *r, uint64_t n1, uint64_t n0, uint64_t d) { +#if defined(__x86_64__) + uint64_t q; + asm("divq %4" : "=3Da"(q), "=3Dd"(*r) : "0"(n0), "1"(n1), "rm"(d)); + return q; +#else uint64_t d0, d1, q0, q1, r1, r0, m; =20 d0 =3D (uint32_t)d; @@ -676,6 +681,7 @@ static inline uint64_t udiv_qrnnd(uint64_t *r, uint64_t= n1, =20 *r =3D r0; return (q1 << 32) | q0; +#endif } =20 /*------------------------------------------------------------------------= ---- --=20 2.17.1