From patchwork Fri Oct 29 04:32:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 516378 Delivered-To: patch@linaro.org Received: by 2002:ad5:5208:0:0:0:0:0 with SMTP id p8csp388250iml; Thu, 28 Oct 2021 21:34:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuiKDxxt1xwjn5kC3dOEfwxCqy33ShFCZTF0nxchw2c5c+u315Cisy2E3znYpn8iDPZ9JW X-Received: by 2002:a9d:6c8b:: with SMTP id c11mr6857657otr.50.1635482074241; Thu, 28 Oct 2021 21:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635482074; cv=none; d=google.com; s=arc-20160816; b=NENayiNrE4LSjoYrVnV2K51hVhed6/N2R0cg3OEPX9huFsd6OAVBO56gBYO1e+dPc8 3E8Xc3yp+OPhDUro6PShlUfm71/FEyLpbantzApA2EAeuEciV9I/hYd4gx11Zys9AH13 sNd6wwnN07sPL1EP6L6x+nxMiH6LbBvvEvIA/e37gCF8iDJ2t1Wl9ErsTIj1jAbYKU2P W0lrdFlSdDtMlU3s7qrWTxuuFvRLCG6mCt0x+P6ydKJtzTXCIPi1H0jcFEpKnUfm3U0C qPdYOdRNU21mfBe5Dnv4x57K7qiVRzKa/FEZaQHWxMyHt9m4WLSapk8Kb23Ydgq8HWC/ w8ww== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=k69n+NAqhKditk9j302sj9FGt8K/9s94vNSW9sZvtmU=; b=w4NgiMXyhvwRyeU27pPtlZUftNhRxzJJj2kzu4bblzCetOlXI64xq3wOwIWtAXt3eD di7n/sgtc4K03sVE8iQogFH/SZNPC4NbO4kKrUxFbeLqPmCSAaLrR0fCFUYXZsVgBbQ0 yDhs1FdsmrXIRicB5wo+ya/ueUVxdrIwIO3jvHACXAjtkcyaCfUvSgeqGh6NUbwJ7I4X EJzTDUS+P+RXJtk831r0ZxJA0doW+i+5A2Poz5a09AUHqBeeuXAjQGFW6s9WMxsoFrjP 1S7hdZTKPd5cKi+ZAwF5/a/p3VJIK0E5gMgkHcrIfBLK1SGIR1oAjATzXJxPhbSKyS6E W/tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oNyF7uMi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f6si405845oiw.127.2021.10.28.21.34.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Oct 2021 21:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oNyF7uMi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgJb7-0003Yy-HV for patch@linaro.org; Fri, 29 Oct 2021 00:34:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50968) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgJaC-0003Xl-5v for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:33:36 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:36451) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgJa9-0007sX-PS for qemu-devel@nongnu.org; Fri, 29 Oct 2021 00:33:35 -0400 Received: by mail-pl1-x62d.google.com with SMTP id l13so965096pls.3 for ; Thu, 28 Oct 2021 21:33:32 -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=k69n+NAqhKditk9j302sj9FGt8K/9s94vNSW9sZvtmU=; b=oNyF7uMiCWPRqc3JzUtBiIcHI65otOX3H0nW07CscChsAK1/WRoF5JnNsIuSq+3kiP z8PDX5QFr9hiA4ugTyPseFFQ/IHUVhFgQN81Q72pW3lIBdZV9bm2czUCBz5tKJGxqDdx KswV8/GaiwkC6rvY1CNT6rW1cO1PlkUx54ZF5hnrLAKsemLJ3vSVJKuffVlzqA1s8os4 HbRwIzHUC36vWfPH7PaprEgwiY3h29t+sLw/XX6lDXeqgW70TtE+Lmez/TFopTsoMtMw QNnSbM+N0CkbObC+tTJMCs8UgyNRQCKPxLw5cRL8BBrDC7yBiGhSEUvspZvu3BsS8LDA V4fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k69n+NAqhKditk9j302sj9FGt8K/9s94vNSW9sZvtmU=; b=TfUHYzxjuUyYdTTCqkO+KC1oGjAQWXpAr1UH+aSSwwW6EX5ByAixMdwClSnq9Mm7kN 7CSW5/ai5s0dGVaBGavcryHYiNBvzxCl8VPtayz/dYpwrndlYk2wP71MBaCFoqSeeSNC AaIYT8BE1ujL+qPHOgUb2qiw0Ml/cZdEBordx87nU7wZpXjVaI5Pt2C/WcyQhs/ZBNeJ 09fqOq04N+dL47KRXE4mhta+6n+mAG3pbBFPdLr2SVbIUdCA4iOsRfHFrwY0feyEtDww lG6t6AwDA4yQ2k7J+ueNi6hGLSzdsGrGnNwCYMBn2vJ9jeiIuGOHXzBw9xRPSfXU0niO gvbw== X-Gm-Message-State: AOAM533YORrBpOnW37v4lea+KQti6rnw+C6nELlB0v4u3cMFyvNZu8ox J3pIYkoPKFcEbGWiX1Y7NOhAwVOW/4Ym0g== X-Received: by 2002:a17:90b:3b4c:: with SMTP id ot12mr17412767pjb.216.1635482011916; Thu, 28 Oct 2021 21:33:31 -0700 (PDT) Received: from localhost.localdomain (174-21-75-75.tukw.qwest.net. [174.21.75.75]) by smtp.gmail.com with ESMTPSA id i11sm4120257pgp.18.2021.10.28.21.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 21:33:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL v2 01/60] qemu/int128: Add int128_{not,xor} Date: Thu, 28 Oct 2021 21:32:30 -0700 Message-Id: <20211029043329.1518029-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211029043329.1518029-1-richard.henderson@linaro.org> References: <20211029043329.1518029-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9trot?= , Fabien Portas Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Frédéric Pétrot Addition of not and xor on 128-bit integers. Signed-off-by: Frédéric Pétrot Co-authored-by: Fabien Portas Message-Id: <20211025122818.168890-3-frederic.petrot@univ-grenoble-alpes.fr> [rth: Split out logical operations.] Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson --- include/qemu/int128.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -- 2.25.1 diff --git a/include/qemu/int128.h b/include/qemu/int128.h index 2ac0746426..b6d517aea4 100644 --- a/include/qemu/int128.h +++ b/include/qemu/int128.h @@ -58,6 +58,11 @@ static inline Int128 int128_exts64(int64_t a) return a; } +static inline Int128 int128_not(Int128 a) +{ + return ~a; +} + static inline Int128 int128_and(Int128 a, Int128 b) { return a & b; @@ -68,6 +73,11 @@ static inline Int128 int128_or(Int128 a, Int128 b) return a | b; } +static inline Int128 int128_xor(Int128 a, Int128 b) +{ + return a ^ b; +} + static inline Int128 int128_rshift(Int128 a, int n) { return a >> n; @@ -235,6 +245,11 @@ static inline Int128 int128_exts64(int64_t a) return int128_make128(a, (a < 0) ? -1 : 0); } +static inline Int128 int128_not(Int128 a) +{ + return int128_make128(~a.lo, ~a.hi); +} + static inline Int128 int128_and(Int128 a, Int128 b) { return int128_make128(a.lo & b.lo, a.hi & b.hi); @@ -245,6 +260,11 @@ static inline Int128 int128_or(Int128 a, Int128 b) return int128_make128(a.lo | b.lo, a.hi | b.hi); } +static inline Int128 int128_xor(Int128 a, Int128 b) +{ + return int128_make128(a.lo ^ b.lo, a.hi ^ b.hi); +} + static inline Int128 int128_rshift(Int128 a, int n) { int64_t h;