[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/56] qemu/int128: Add int128_{not,xor}
From: |
Richard Henderson |
Subject: |
[PULL 01/56] qemu/int128: Add int128_{not,xor} |
Date: |
Wed, 27 Oct 2021 19:40:36 -0700 |
From: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
Addition of not and xor on 128-bit integers.
Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
Co-authored-by: Fabien Portas <fabien.portas@grenoble-inp.org>
Message-Id: <20211025122818.168890-3-frederic.petrot@univ-grenoble-alpes.fr>
[rth: Split out logical operations.]
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/qemu/int128.h | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
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;
--
2.25.1
- [PULL 00/56] tcg patch queue, Richard Henderson, 2021/10/27
- [PULL 02/56] host-utils: move checks out of divu128/divs128, Richard Henderson, 2021/10/27
- [PULL 03/56] host-utils: move udiv_qrnnd() to host-utils, Richard Henderson, 2021/10/27
- [PULL 01/56] qemu/int128: Add int128_{not,xor},
Richard Henderson <=
- [PULL 04/56] host-utils: add 128-bit quotient support to divu128/divs128, Richard Henderson, 2021/10/27
- [PULL 05/56] host-utils: add unit tests for divu128/divs128, Richard Henderson, 2021/10/27
- [PULL 09/56] tcg/optimize: Change tcg_opt_gen_{mov,movi} interface, Richard Henderson, 2021/10/27
- [PULL 06/56] tcg/optimize: Rename "mask" to "z_mask", Richard Henderson, 2021/10/27
- [PULL 07/56] tcg/optimize: Split out OptContext, Richard Henderson, 2021/10/27
- [PULL 10/56] tcg/optimize: Move prev_mb into OptContext, Richard Henderson, 2021/10/27
- [PULL 12/56] tcg/optimize: Split out copy_propagate, Richard Henderson, 2021/10/27
- [PULL 13/56] tcg/optimize: Split out fold_call, Richard Henderson, 2021/10/27
- [PULL 18/56] tcg/optimize: Use a boolean to avoid a mass of continues, Richard Henderson, 2021/10/27
- [PULL 15/56] tcg/optimize: Change fail return for do_constant_folding_cond*, Richard Henderson, 2021/10/27