From patchwork Fri Oct 5 18:01:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 148289 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp761795lji; Fri, 5 Oct 2018 11:10:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV61KCwyrQT3PkwRW4G19IXtG4rhcHhhuaAv260P57JBXYuZgfCkKGB2dEFvk8hR+sRKvIBK8 X-Received: by 2002:a0c:b994:: with SMTP id v20-v6mr6005728qvf.110.1538763040358; Fri, 05 Oct 2018 11:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538763040; cv=none; d=google.com; s=arc-20160816; b=jx8cRZLtlqYkk+6U0SDlOqXneNjluk791xoi87ThroYHoMCeNlf+EVON84JY6oUOF+ kbK5OF7Z0zSGSXA+PIU7OFOGOEo34IFprZD4MvDk+F4arHW6Zvaagr652Epz6gq1mjd+ 6qkki68nnct84l/LPLuCVjtHkCNbHQJREcXQt+PlPsuiNQbkUWrhmDc0tI9nTDqYJ9Wf WhyIhoIwS3t9Uyq9H+VTcXhcpqB3kYJw2NpyXr67XCsfA0ofJjKRVGSU9pAdMquwwHOj S1LZ1kWQl7okMccFXUZwIgz0hYWXbK//NubeZsqKOhlIzSirqJ2bPwzdnzEU/nWheDtB jSkQ== 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:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=cRmMqmBeH6CVVhBpy5pb3rhG/pnTWg+KHZ8CbvTFIJs=; b=EFtL7Pa/vkYw0KsHXquSE2EXGutfNx2slGovWXTLBMG4yzIQCHB/XlnHDIk2FY3S4P OCvaLgDQ7YKcmkRLMNW3SNNE9ehODXzwheClFylvwKj0Of2U1uscbzynsaktrl/7h1RG isylW8yZSXk3iKOga7X7eBWrcq0ktkenqZNO2SM9X7jUGW3YFq3rGWdUdAGJvyQ+8vdC rU4aU7QxLxRKuFRNiyU7NgyllyLnfapsN56AHDxYI+uVJHF3CVB3feoDYkh6f4kDNLLD 2mhMTFI0O/ruerq5Vn7c1ydkiOEBLq2NEqDVMb3KLHpUv4RkcM/ZtSK1zmjbhro0rpTR s0Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YDGPbONu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id h52-v6si1052420qtb.233.2018.10.05.11.10.40 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 05 Oct 2018 11:10:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YDGPbONu; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:36429 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8UYh-0000vb-Mg for patch@linaro.org; Fri, 05 Oct 2018 14:10:39 -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) 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-Received: by 2002:aca:5e83:: with SMTP id s125-v6mr41726oib.134.1538762536724; Fri, 05 Oct 2018 11:02:16 -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) 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 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The ISA has a 128/64-bit division instruction. Tested-by: Emilio G. Cota Tested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- include/fpu/softfloat-macros.h | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.17.1 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" : "=a"(q), "=d"(*r) : "0"(n0), "1"(n1), "rm"(d)); + return q; +#else uint64_t d0, d1, q0, q1, r1, r0, m; d0 = (uint32_t)d; @@ -676,6 +681,7 @@ static inline uint64_t udiv_qrnnd(uint64_t *r, uint64_t n1, *r = r0; return (q1 << 32) | q0; +#endif } /*----------------------------------------------------------------------------