[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 33/57] include/qemu/int128.h: Add function to create Int128 fr
From: |
Peter Maydell |
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 |
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 <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
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
- Re: [PATCH v2 22/57] target/arm: Implement MVE VDUP, (continued)
- [PATCH v2 28/57] target/arm: Implement MVE VABD, Peter Maydell, 2021/06/14
- [PATCH v2 29/57] target/arm: Implement MVE VHADD, VHSUB, Peter Maydell, 2021/06/14
- [PATCH v2 30/57] target/arm: Implement MVE VMULL, Peter Maydell, 2021/06/14
- [PATCH v2 25/57] target/arm: Implement MVE VMULH, Peter Maydell, 2021/06/14
- [PATCH v2 26/57] target/arm: Implement MVE VRMULH, Peter Maydell, 2021/06/14
- [PATCH v2 32/57] target/arm: Implement MVE VMLSLDAV, Peter Maydell, 2021/06/14
- [PATCH v2 31/57] target/arm: Implement MVE VMLALDAV, Peter Maydell, 2021/06/14
- [PATCH v2 34/57] target/arm: Implement MVE VRMLALDAVH, VRMLSLDAVH, Peter Maydell, 2021/06/14
- [PATCH v2 33/57] include/qemu/int128.h: Add function to create Int128 from int64_t,
Peter Maydell <=
- [PATCH v2 38/57] target/arm: Implement MVE VBRSR, Peter Maydell, 2021/06/14
- [PATCH v2 35/57] target/arm: Implement MVE VADD (scalar), Peter Maydell, 2021/06/14
- [PATCH v2 37/57] target/arm: Implement MVE VHADD, VHSUB (scalar), Peter Maydell, 2021/06/14
- [PATCH v2 42/57] target/arm: Implement MVE VQDMULL scalar, Peter Maydell, 2021/06/14
- [PATCH v2 40/57] target/arm: Implement MVE VQADD and VQSUB, Peter Maydell, 2021/06/14
- [PATCH v2 36/57] target/arm: Implement MVE VSUB, VMUL (scalar), Peter Maydell, 2021/06/14
- [PATCH v2 39/57] target/arm: Implement MVE VPST, Peter Maydell, 2021/06/14
- [PATCH v2 41/57] target/arm: Implement MVE VQDMULH and VQRDMULH (scalar), Peter Maydell, 2021/06/14
- [PATCH v2 44/57] target/arm: Implement MVE VQADD, VQSUB (vector), Peter Maydell, 2021/06/14