From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E4ECC47082 for ; Mon, 7 Jun 2021 17:35:07 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E7DE60FDC for ; Mon, 7 Jun 2021 17:35:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E7DE60FDC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqJ9W-0000BU-8K for qemu-devel@archiver.kernel.org; Mon, 07 Jun 2021 13:35:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqIay-0007le-1J for qemu-devel@nongnu.org; Mon, 07 Jun 2021 12:59:24 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:39867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqIaS-00081X-7L for qemu-devel@nongnu.org; Mon, 07 Jun 2021 12:59:23 -0400 Received: by mail-wm1-x331.google.com with SMTP id l18-20020a1ced120000b029014c1adff1edso102812wmh.4 for ; Mon, 07 Jun 2021 09:58:48 -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=RzQMU2S0MPi6LG0qvbJo0z1iKKPaC9Dm6mwYYso4zvc=; b=xNHOg2DMteh7TAdIVmaWYo+X/GeDt60xODrAWEl9jKHSEcQigtJL4ufd5TB8jNwUp2 dlE6ofWdhj+DnercmQyrJGlt0hF23HaGHGwTBUbA6ad3sbDtq7rVNnM6UZJd4jQxXj1M lo523l3NpmJwDB1RRBFDSzEP3zsr9SvsZeY/jm6yywBLZ9Jllp+M9+ziDWWZcD6ZTIuz 4oeVDDsn1uSG1zhAjybfulFhlHozSAohQVyzxAo1Py/3NQqhCO+ocTVFdtTwMm3qIup5 VPUJfTwJyUgWKEWjUmdnRZeMwNPhpmT1G/txXIlSpunUYQYgKnEwjcQzgLJRWSr2DVTi ZCCw== 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=RzQMU2S0MPi6LG0qvbJo0z1iKKPaC9Dm6mwYYso4zvc=; b=j+6LXxEYKvMQ+zpGoAkeiWRoJjxbbnRxrHpTZCfOeyzHMPF4q/oFwiWw4iWJqrLFxX +cQG5EFYoUkeoOg/uPN/P/VjjhL2O1AZMJudvBSB5nz/bw+kGWW6t6BXsniKis2JDmxD BGdK2UxOK7/s0cL+Sab4SIyEJTFt9ExV8Y0ytBdIPN/qmJIfq1XrtlYXZJGl5d3R3te7 SpUI3MS5vsNOfgnczWHv/FLJe7Alu0nq6tq3iO2xMi3lqS3k4c/OSqRoq5d/wLKKI+RX yAKY3X43xdR2Lv0+PufgJ2S6LnV9X/EnQRV8r1ONWm+sU+NwkxY+/+MilYkkWejDqMRj 0+mQ== X-Gm-Message-State: AOAM531Zcw1pCBqHzLCXFPfCGrWNcSKJmkdo1/BHXhjELH+ifMxVEKTJ m6+mo+yVhMVr2Zo7uzce7aeC5Q== X-Google-Smtp-Source: ABdhPJwDTuv0HawLnD1CACEFY2E+PN/UxAVNU55U+eX+ehQvqraMBj/A8ELiivJa+OVjYiscfkWMsg== X-Received: by 2002:a05:600c:4ec8:: with SMTP id g8mr93878wmq.62.1623085128256; Mon, 07 Jun 2021 09:58:48 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n10sm18891677wre.95.2021.06.07.09.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 09:58:47 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 31/55] include/qemu/int128.h: Add function to create Int128 from int64_t Date: Mon, 7 Jun 2021 17:57:57 +0100 Message-Id: <20210607165821.9892-32-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210607165821.9892-1-peter.maydell@linaro.org> References: <20210607165821.9892-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com 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: Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" int128_make64() creates an Int128 from an unsigned 64 bit value; add a function int128_makes64() creating an Int128 from a signed 64 bit value. Signed-off-by: Peter Maydell --- include/qemu/int128.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/qemu/int128.h b/include/qemu/int128.h index 52fc2384211..64500385e37 100644 --- a/include/qemu/int128.h +++ b/include/qemu/int128.h @@ -11,6 +11,11 @@ static inline Int128 int128_make64(uint64_t a) return a; } +static inline Int128 int128_makes64(int64_t a) +{ + return a; +} + static inline Int128 int128_make128(uint64_t lo, uint64_t hi) { return (__uint128_t)hi << 64 | lo; @@ -167,6 +172,11 @@ static inline Int128 int128_make64(uint64_t a) return (Int128) { a, 0 }; } +static inline Int128 int128_makes64(int64_t a) +{ + return (Int128) { a, a >> 63 }; +} + static inline Int128 int128_make128(uint64_t lo, uint64_t hi) { return (Int128) { lo, hi }; -- 2.20.1