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,URIBL_BLOCKED, 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 AFEC1C48BE6 for ; Mon, 14 Jun 2021 15:35:26 +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 703116120E for ; Mon, 14 Jun 2021 15:35:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 703116120E 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]:35972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsocX-0008WQ-F3 for qemu-devel@archiver.kernel.org; Mon, 14 Jun 2021 11:35:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsoEp-0001mS-J9 for qemu-devel@nongnu.org; Mon, 14 Jun 2021 11:10:55 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:40509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsoEZ-0000Sy-4c for qemu-devel@nongnu.org; Mon, 14 Jun 2021 11:10:55 -0400 Received: by mail-wm1-x336.google.com with SMTP id b145-20020a1c80970000b029019c8c824054so13302144wmd.5 for ; Mon, 14 Jun 2021 08:10:38 -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=GLjCJA1aqkfuAtjVDAHVb/JY5jEizK36+MJvk9xH9xo=; b=sOHnibqLAtY0k+AaZOPcr56LH53hm/kKYM/IbNaxpF2sBeqyP/olbfO+Nl4SfMADIM kJwZw0eEpB53Ab2oy/5bod00E1rTVPncEIg9AmmDj3KP/djaMjK6xCk09oPMzSriAb8L CBKiN6+jeOqNwNCofAJAXcIOTnDifNqr2QchWM8oCTmCDXASxzsbWiBBG6poaNviWl/4 Oh3V5LW0/YtnVRQaqqUndmsZBF0q9hwTkjYo0dLcKnezbXaPr1RlQLfGkrP+75ADh5D1 DtcxE0ULQ0wFFX5N/fqx3Op/XwDe22Xs+v1T9ZRQ9tmcKV2Uh1ncoxy81yleNKwUgGT3 qEFQ== 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=GLjCJA1aqkfuAtjVDAHVb/JY5jEizK36+MJvk9xH9xo=; b=YkgkY2QzuIcUrHuug+r9JPyVWaWu9r69V8Srafe6tDb/1HCQ6faDhmmvtCjMBJHqxl EUf2X8KNsvm9EssyhwxG0EEqZIIfFf6KVOjfaa2zfVNaikKUi7vjaKSSVVwX9BDsdr9N kfm/wiukV1YeKxoL4POHDPbkyYuuTOrttiNFdKX5dzGLmBm4TOfD5JfbtmRcSJcvlA4o LNDpTACjoG40jUGgq22MpHITCsQYlD7ARfHGL4RzVsj37YTfCIcUK/YnfZULXWvmhZh6 /wyeH3AyvqWifSJnW97OorMXC7W/qndPHF29qzLddukaQbgpEfUy/879q0+slQi4eri6 NjKA== X-Gm-Message-State: AOAM530Mc4Eb+9alavfRD0vabff0pKPkLcjQ9wJkWzvM9JvG3TXbZDmi nERPo+cWqeTdyuUE+uWdt5GQgg== X-Google-Smtp-Source: ABdhPJxuVkm7YzvZaR3p/qjRyV1pYFu4TU33vm7w6sn5AwHlwLbTm5Isb4auizgZZLp5et0BXU/qug== X-Received: by 2002:a05:600c:3b86:: with SMTP id n6mr17092888wms.50.1623683437698; Mon, 14 Jun 2021 08:10:37 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id b8sm20865639wmd.35.2021.06.14.08.10.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 08:10:37 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 33/57] include/qemu/int128.h: Add function to create Int128 from int64_t Date: Mon, 14 Jun 2021 16:09:43 +0100 Message-Id: <20210614151007.4545-34-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210614151007.4545-1-peter.maydell@linaro.org> References: <20210614151007.4545-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.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 Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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