All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add int128_or to include/qemu/int128.h
@ 2020-10-28 21:19 Taylor Simpson
  2020-10-29  7:00 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 2+ messages in thread
From: Taylor Simpson @ 2020-10-28 21:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: tsimpson, richard.henderson

Discovered the need when working on Hexagon target
https://www.mail-archive.com/qemu-devel@nongnu.org/msg733818.html
Useful as a standalone patch

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
 include/qemu/int128.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/qemu/int128.h b/include/qemu/int128.h
index 76ea405..52fc238 100644
--- a/include/qemu/int128.h
+++ b/include/qemu/int128.h
@@ -58,6 +58,11 @@ static inline Int128 int128_and(Int128 a, Int128 b)
     return a & b;
 }
 
+static inline Int128 int128_or(Int128 a, Int128 b)
+{
+    return a | b;
+}
+
 static inline Int128 int128_rshift(Int128 a, int n)
 {
     return a >> n;
@@ -208,6 +213,11 @@ static inline Int128 int128_and(Int128 a, Int128 b)
     return (Int128) { a.lo & b.lo, a.hi & b.hi };
 }
 
+static inline Int128 int128_or(Int128 a, Int128 b)
+{
+    return (Int128) { a.lo | b.lo, a.hi | b.hi };
+}
+
 static inline Int128 int128_rshift(Int128 a, int n)
 {
     int64_t h;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Add int128_or to include/qemu/int128.h
  2020-10-28 21:19 [PATCH] Add int128_or to include/qemu/int128.h Taylor Simpson
@ 2020-10-29  7:00 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 2+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-10-29  7:00 UTC (permalink / raw)
  To: Taylor Simpson, qemu-devel; +Cc: richard.henderson

On 10/28/20 10:19 PM, Taylor Simpson wrote:
> Discovered the need when working on Hexagon target
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg733818.html
> Useful as a standalone patch

Following the QEMU commits style:

"qemu/int128: Add int128_or()"

Add the int128_or() implementation.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> 
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
>  include/qemu/int128.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/include/qemu/int128.h b/include/qemu/int128.h
> index 76ea405..52fc238 100644
> --- a/include/qemu/int128.h
> +++ b/include/qemu/int128.h
> @@ -58,6 +58,11 @@ static inline Int128 int128_and(Int128 a, Int128 b)
>      return a & b;
>  }
>  
> +static inline Int128 int128_or(Int128 a, Int128 b)
> +{
> +    return a | b;
> +}
> +
>  static inline Int128 int128_rshift(Int128 a, int n)
>  {
>      return a >> n;
> @@ -208,6 +213,11 @@ static inline Int128 int128_and(Int128 a, Int128 b)
>      return (Int128) { a.lo & b.lo, a.hi & b.hi };
>  }
>  
> +static inline Int128 int128_or(Int128 a, Int128 b)
> +{
> +    return (Int128) { a.lo | b.lo, a.hi | b.hi };
> +}
> +
>  static inline Int128 int128_rshift(Int128 a, int n)
>  {
>      int64_t h;
> 



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-29  7:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28 21:19 [PATCH] Add int128_or to include/qemu/int128.h Taylor Simpson
2020-10-29  7:00 ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.