public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Paul A. Clarke" <pc@us.ibm.com>
To: gcc-patches@gcc.gnu.org
Cc: segher@kernel.crashing.org, wschmidt@linux.ibm.com
Subject: [PATCH v2 5/6] rs6000: Add support for SSE4.1 "floor" intrinsics
Date: Fri, 16 Jul 2021 08:50:21 -0500	[thread overview]
Message-ID: <20210716135022.489455-6-pc@us.ibm.com> (raw)
In-Reply-To: <20210716135022.489455-1-pc@us.ibm.com>

2021-07-16  Paul A. Clarke  <pc@us.ibm.com>

gcc
	* config/rs6000/smmintrin.h (_mm_floor_pd, _mm_floor_ps,
	_mm_floor_sd, _mm_floor_ss): New.
---
v2: Improve formatting per review from Bill.

 gcc/config/rs6000/smmintrin.h | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gcc/config/rs6000/smmintrin.h b/gcc/config/rs6000/smmintrin.h
index cad770a67631..5960991e0af7 100644
--- a/gcc/config/rs6000/smmintrin.h
+++ b/gcc/config/rs6000/smmintrin.h
@@ -264,6 +264,38 @@ _mm_ceil_ss (__m128 __A, __m128 __B)
   return r;
 }
 
+__inline __m128d
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+_mm_floor_pd (__m128d __A)
+{
+  return (__m128d) vec_floor ((__v2df) __A);
+}
+
+__inline __m128
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+_mm_floor_ps (__m128 __A)
+{
+  return (__m128) vec_floor ((__v4sf) __A);
+}
+
+__inline __m128d
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+_mm_floor_sd (__m128d __A, __m128d __B)
+{
+  __v2df r = vec_floor ((__v2df) __B);
+  r[1] = ((__v2df) __A)[1];
+  return (__m128d) r;
+}
+
+__inline __m128
+__attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
+_mm_floor_ss (__m128 __A, __m128 __B)
+{
+  __v4sf r = (__v4sf) __A;
+  r[0] = __builtin_floor (((__v4sf) __B)[0]);
+  return r;
+}
+
 /* Return horizontal packed word minimum and its index in bits [15:0]
    and bits [18:16] respectively.  */
 __inline __m128i
-- 
2.27.0


  parent reply	other threads:[~2021-07-16 13:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 13:50 [PATCH v2 0/6] rs6000: Add SSE4.1 "blend", "ceil", "floor" Paul A. Clarke
2021-07-16 13:50 ` [PATCH v2 1/6] rs6000: Add support for SSE4.1 "blend" intrinsics Paul A. Clarke
2021-07-16 18:13   ` Bill Schmidt
2021-07-28 21:30   ` Segher Boessenkool
2021-07-16 13:50 ` [PATCH v2 2/6] rs6000: Add tests " Paul A. Clarke
2021-07-16 18:16   ` Bill Schmidt
2021-07-28 21:51   ` Segher Boessenkool
2021-07-16 13:50 ` [PATCH v2 3/6] rs6000: Add support for SSE4.1 "ceil" intrinsics Paul A. Clarke
2021-07-16 18:20   ` Bill Schmidt
2021-07-28 22:01   ` Segher Boessenkool
2021-07-16 13:50 ` [PATCH v2 4/6] rs6000: Add tests " Paul A. Clarke
2021-07-16 18:22   ` Bill Schmidt
2021-07-28 22:16   ` Segher Boessenkool
2021-07-30 22:13     ` Paul A. Clarke
2021-07-16 13:50 ` Paul A. Clarke [this message]
2021-07-16 18:30   ` [PATCH v2 5/6] rs6000: Add support for SSE4.1 "floor" intrinsics Bill Schmidt
2021-07-28 22:25   ` Segher Boessenkool
2021-07-16 13:50 ` [PATCH v2 6/6] rs6000: Add tests " Paul A. Clarke
2021-07-16 18:31   ` Bill Schmidt
2021-07-28 22:26   ` Segher Boessenkool

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210716135022.489455-6-pc@us.ibm.com \
    --to=pc@us.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).