From patchwork Wed Oct 3 18:07:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 148073 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp6796297lji; Wed, 3 Oct 2018 11:10:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV62KGO30etI4OKgSw4OdA7l7UqhgSzfOrpIafnetxZIcj9+oJ0IBwnsrgC07br05RA7RP7Oc X-Received: by 2002:ac8:25e9:: with SMTP id f38-v6mr1884269qtf.227.1538590223340; Wed, 03 Oct 2018 11:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538590223; cv=none; d=google.com; s=arc-20160816; b=TnxLe+FTLdU9dhuySZbzm3mRhWDDd3dBhlDsN+/LhoPp7yI+3+0RJ1z7RiGKrgZhOp 185sTx3DvxlsX0EJvDEqmX1/bWez0cicbF+77PUYhugZEXAp1wpwWN4q64nJI+LQKZn/ vnlNkNVj3zI1qAQRgcdNi3gvqT4GX3eY99c7LXLJ31Jbm6mtrAv0foFqpqKrruG4dEOq akbRGXzZygXf6DUu87yK2IP6XQmp7xLskteJyBpGop+/mOPsTKUUeu9ngqJ4YVF6RsYk Vl9GDAdLVG9aqJcAudIwOKc6nOBLSEZX3Tb7aEDVVdS6FV/n7OCkqULuhnUV0af9hTKG FCSA== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=g1slopZ4qkafsxJ+xoE1KW0cUVFz+tpfz7X9jI7y1Jo=; b=iRYQVPD/GNG/daTM5IPJ0f17vS+cuohXpGD++VIo+LFDroKqmHCyHFR4zGXYhSqQFr yDK4Hii84U/flRFPDUWs9ljK8OFQ0C2MnkZTmpJTOJn+ei+1xrkAtMnwMoiKjoc77tMV kVVTS22/88TDqUAkzvVMrUGVxT9fON3nvbLcR5+8Ab3rFfWgKhdsG8JK/1j71ET2wpvG raabIpVtwNFpbBNe+DdD28d9JISrfwcLugj9DqIExygAmN8Jtjpip3mOMROgE++X5cYy jBghtilSxIUf/zbekqTWcLqPSnWXzbWwb5Ji2FY9URy7NOYqRhklKr3GWOgwi1UlAq2j ghSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RJRkHG6R; 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 h205-v6si1340698qke.262.2018.10.03.11.10.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 03 Oct 2018 11:10:23 -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=RJRkHG6R; 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]:51673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7lbK-0004XC-Rp for patch@linaro.org; Wed, 03 Oct 2018 14:10:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55403) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7lYf-0002f5-VH for qemu-devel@nongnu.org; Wed, 03 Oct 2018 14:07:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7lYb-0005Am-Ta for qemu-devel@nongnu.org; Wed, 03 Oct 2018 14:07:37 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]:43579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7lYb-000478-KP for qemu-devel@nongnu.org; Wed, 03 Oct 2018 14:07:33 -0400 Received: by mail-oi1-x230.google.com with SMTP id s69-v6so5288521oie.10 for ; Wed, 03 Oct 2018 11:07:20 -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; bh=g1slopZ4qkafsxJ+xoE1KW0cUVFz+tpfz7X9jI7y1Jo=; b=RJRkHG6R1Ihk37M6a2dBUc9Iz39O3K8sRBWf6c0wGk8kwT2W4ZHgSXkZrD/09VpMlY 08+N+Q6VowGi/17l19gh2NtkG7f3yOmTRjVhEHcuE7HnUISugSkhp6QU3ogdjTbL0c7K dY5n34Rd2BfM/9Z5KHe6qqn9I0PngRJG1vzkw= 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; bh=g1slopZ4qkafsxJ+xoE1KW0cUVFz+tpfz7X9jI7y1Jo=; b=HQ8scOStwH5xUtd8FY25RVGSGRxZXLTlr0xfWt3s4UG8EVnJe4haO5K3LUrpLK4wa4 XZ+WOckNt3Zt7eoFgv8Rd4POFB5ZDxQOnwDw/mV312COW7ortn3NiNuldh/XZgvRBizA ROhV2giDS065+N+3YtKU8TGQ//10a3xbLnIJUTX0AM8PJ4S7MC9uA0R696spdqYis30Y di2LS+m1o7FY9/iQoc+f7LmkeFpj6SJ4awzsJGLWWh906kCcBZVEiUkOiYcoa9VjLlH9 chve7uBWp3PTI5d0GMpjCEhH5PVeEPkKTTjkomWytcMeKvIBy5J5ERxmCyuEqF0PSOj+ fkTQ== X-Gm-Message-State: ABuFfohDZb2QK3HfG/Tzqp7DiNcbsTBoUIpNbX2PLN+6Uedym9mhiXUd bNQ+SumYhpZ4NDuvOqE0IkF+n48T0iLckA== X-Received: by 2002:aca:3546:: with SMTP id c67-v6mr1366160oia.249.1538590039070; Wed, 03 Oct 2018 11:07:19 -0700 (PDT) Received: from cloudburst.twiddle.net ([187.217.227.243]) by smtp.gmail.com with ESMTPSA id f84-v6sm677709oia.44.2018.10.03.11.07.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Oct 2018 11:07:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 3 Oct 2018 13:07:09 -0500 Message-Id: <20181003180711.19335-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181003180711.19335-1-richard.henderson@linaro.org> References: <20181003180711.19335-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::230 Subject: [Qemu-devel] [PATCH v2 2/4] 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: cota@braap.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The ISA has a 128/64-bit division instruction. 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 03312471b2..6d58615709 100644 --- a/include/fpu/softfloat-macros.h +++ b/include/fpu/softfloat-macros.h @@ -622,6 +622,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; @@ -661,6 +666,7 @@ static inline uint64_t udiv_qrnnd(uint64_t *r, uint64_t n1, *r = r0; return (q1 << 32) | q0; +#endif } /*----------------------------------------------------------------------------