From nobody Tue Feb 10 00:59:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1623087314; cv=none; d=zohomail.com; s=zohoarc; b=DwDr3Gx+GKFiglaaUBeBRwKDNwH0Xupl7v16fj2VLQGcOgRRGA2gcdhTz+tG7Lsv2lXtazvLfCvoJnnd3kheq2oZakver+m2fkJGhrmUNXccmhCKCyV2UJ5Ua+zWkgNjyDwy++zJoEug9Wabs/CRv2aGC7KzAZkwP3q3h3MfaK0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623087314; 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=RzQMU2S0MPi6LG0qvbJo0z1iKKPaC9Dm6mwYYso4zvc=; b=Y/MyqC6MRkpb5NeX87kqMFS+1DovyFNv16h4p9TWCbERUkFJ4j7y7QZwIKXYKofzqIbOq4H9Q8AWwHmsaPwRi/pKoWSs6ZQ+8e2FG8YiVjFlzloAx1q8c8VJGtuF+Mu7gokqkqnvAogGsHeH7jk/KDnzx+VSluJ8NP8en72RPNU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1623087314817474.44390325198367; Mon, 7 Jun 2021 10:35:14 -0700 (PDT) Received: from localhost ([::1]:52196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqJ9d-0000BU-Pf for importer@patchew.org; Mon, 07 Jun 2021 13:35:13 -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) 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) 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) 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: 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=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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- 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; } =20 +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 }; } =20 +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 }; --=20 2.20.1