[v2,6/6] rs6000: Add tests for SSE4.1 "floor" intrinsics

Message ID 20210716135022.489455-7-pc@us.ibm.com
State New
Headers show
Series
  • rs6000: Add SSE4.1 "blend", "ceil", "floor"
Related show

Commit Message

Richard Biener via Gcc-patches July 16, 2021, 1:50 p.m.
Add the tests for _mm_floor_pd, _mm_floor_ps, _mm_floor_sd, _mm_floor_ss.
These are modelled after (and depend upon parts of) the tests for
_mm_ceil intrinsics, recently posted.

Copy a test for _mm_floor_sd from gcc/testsuite/gcc.target/i386.

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

gcc/testsuite
	* gcc.target/powerpc/sse4_1-floorpd.c: New.
	* gcc.target/powerpc/sse4_1-floorps.c: New.
	* gcc.target/powerpc/sse4_1-floorsd.c: New.
	* gcc.target/powerpc/sse4_1-floorss.c: New.
	* gcc.target/powerpc/sse4_1-roundpd-2.c: Copy from
	gcc/testsuite/gcc.target/i386.
---
v2: Improve formatting per review from Bill.

 .../gcc.target/powerpc/sse4_1-floorpd.c       |  51 ++++++++
 .../gcc.target/powerpc/sse4_1-floorps.c       |  41 ++++++
 .../gcc.target/powerpc/sse4_1-floorsd.c       | 119 ++++++++++++++++++
 .../gcc.target/powerpc/sse4_1-floorss.c       |  95 ++++++++++++++
 .../gcc.target/powerpc/sse4_1-roundpd-2.c     |  36 ++++++
 5 files changed, 342 insertions(+)
 create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c
 create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c

-- 
2.27.0

Comments

Richard Biener via Gcc-patches July 16, 2021, 6:31 p.m. | #1
Hi Paul,

LGTM!  Recommend maintainers approve.

Bill

On 7/16/21 8:50 AM, Paul A. Clarke wrote:
> Add the tests for _mm_floor_pd, _mm_floor_ps, _mm_floor_sd, _mm_floor_ss.

> These are modelled after (and depend upon parts of) the tests for

> _mm_ceil intrinsics, recently posted.

>

> Copy a test for _mm_floor_sd from gcc/testsuite/gcc.target/i386.

>

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

>

> gcc/testsuite

> 	* gcc.target/powerpc/sse4_1-floorpd.c: New.

> 	* gcc.target/powerpc/sse4_1-floorps.c: New.

> 	* gcc.target/powerpc/sse4_1-floorsd.c: New.

> 	* gcc.target/powerpc/sse4_1-floorss.c: New.

> 	* gcc.target/powerpc/sse4_1-roundpd-2.c: Copy from

> 	gcc/testsuite/gcc.target/i386.

> ---

> v2: Improve formatting per review from Bill.

>

>   .../gcc.target/powerpc/sse4_1-floorpd.c       |  51 ++++++++

>   .../gcc.target/powerpc/sse4_1-floorps.c       |  41 ++++++

>   .../gcc.target/powerpc/sse4_1-floorsd.c       | 119 ++++++++++++++++++

>   .../gcc.target/powerpc/sse4_1-floorss.c       |  95 ++++++++++++++

>   .../gcc.target/powerpc/sse4_1-roundpd-2.c     |  36 ++++++

>   5 files changed, 342 insertions(+)

>   create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c

>   create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c

>   create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c

>   create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c

>   create mode 100644 gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c

>

> diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c

> new file mode 100644

> index 000000000000..ad21644f50c4

> --- /dev/null

> +++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c

> @@ -0,0 +1,51 @@

> +/* { dg-do run } */

> +/* { dg-require-effective-target p8vector_hw } */

> +/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */

> +

> +#define NO_WARN_X86_INTRINSICS 1

> +#include <smmintrin.h>

> +

> +#define VEC_T __m128d

> +#define FP_T double

> +

> +#define ROUND_INTRIN(x, mode) _mm_floor_pd (x)

> +

> +#include "sse4_1-round-data.h"

> +

> +static struct data data[] = {

> +  { .value = { .f = {  0.00,  0.25 } }, .answer = {  0.0,  0.0 } },

> +  { .value = { .f = {  0.50,  0.75 } }, .answer = {  0.0,  0.0 } },

> +

> +  { { .f = {  0x1.ffffffffffffcp+50,  0x1.ffffffffffffdp+50 } },

> +           {  0x1.ffffffffffffcp+50,  0x1.ffffffffffffcp+50 } },

> +  { { .f = {  0x1.ffffffffffffep+50,  0x1.0000000000000p+51 } },

> +           {  0x1.ffffffffffffcp+50,  0x1.0000000000000p+51 } },

> +  { { .f = {  0x1.0000000000000p+51,  0x1.0000000000001p+51 } },

> +           {  0x1.0000000000000p+51,  0x1.0000000000000p+51 } },

> +  { { .f = {  0x1.0000000000002p+51,  0x1.0000000000003p+51 } },

> +           {  0x1.0000000000002p+51,  0x1.0000000000002p+51 } },

> +

> +  { { .f = {  0x1.ffffffffffffep+51,  0x1.fffffffffffffp+51 } },

> +           {  0x1.ffffffffffffep+51,  0x1.ffffffffffffep+51 } },

> +  { { .f = {  0x1.0000000000000p+52,  0x1.0000000000001p+52 } },

> +           {  0x1.0000000000000p+52,  0x1.0000000000001p+52 } },

> +

> +  { { .f = { -0x1.0000000000001p+52, -0x1.0000000000000p+52 } },

> +           { -0x1.0000000000001p+52, -0x1.0000000000000p+52 } },

> +  { { .f = { -0x1.fffffffffffffp+51, -0x1.ffffffffffffep+52 } },

> +           { -0x1.0000000000000p+52, -0x1.ffffffffffffep+52 } },

> +

> +  { { .f = { -0x1.0000000000003p+51, -0x1.0000000000002p+51 } },

> +           { -0x1.0000000000004p+51, -0x1.0000000000002p+51 } },

> +  { { .f = { -0x1.0000000000001p+51, -0x1.0000000000000p+51 } },

> +           { -0x1.0000000000002p+51, -0x1.0000000000000p+51 } },

> +  { { .f = { -0x1.fffffffffffffp+50, -0x1.ffffffffffffep+50 } },

> +           { -0x1.0000000000000p+51, -0x1.0000000000000p+51 } },

> +  { { .f = { -0x1.ffffffffffffdp+50, -0x1.ffffffffffffcp+50 } },

> +           { -0x1.0000000000000p+51, -0x1.ffffffffffffcp+50 } },

> +

> +  { { .f = { -1.00, -0.75 } }, { -1.0, -1.0 } },

> +  { { .f = { -0.50, -0.25 } }, { -1.0, -1.0 } }

> +};

> +

> +#include "sse4_1-round.h"

> diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c

> new file mode 100644

> index 000000000000..a53ef9aa9e8b

> --- /dev/null

> +++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c

> @@ -0,0 +1,41 @@

> +/* { dg-do run } */

> +/* { dg-require-effective-target p8vector_hw } */

> +/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */

> +

> +#define NO_WARN_X86_INTRINSICS 1

> +#include <smmintrin.h>

> +

> +#define VEC_T __m128

> +#define FP_T float

> +

> +#define ROUND_INTRIN(x, mode) _mm_floor_ps (x)

> +

> +#include "sse4_1-round-data.h"

> +

> +static struct data data[] = {

> +  { { .f = {  0.00,  0.25,  0.50,  0.75 } }, {  0.0,  0.0,  0.0,  0.0 } },

> +

> +  { { .f = {  0x1.fffff8p+21,  0x1.fffffap+21,

> +	      0x1.fffffcp+21,  0x1.fffffep+21 } },

> +           {  0x1.fffff8p+21,  0x1.fffff8p+21,

> +	      0x1.fffff8p+21,  0x1.fffff8p+21 } },

> +

> +  { { .f = {  0x1.fffffap+22,  0x1.fffffcp+22,

> +	      0x1.fffffep+22,  0x1.fffffep+23 } },

> +           {  0x1.fffff8p+22,  0x1.fffffcp+22,

> +	      0x1.fffffcp+22,  0x1.fffffep+23 } },

> +

> +  { { .f = { -0x1.fffffep+23, -0x1.fffffep+22,

> +	     -0x1.fffffcp+22, -0x1.fffffap+22 } },

> +           { -0x1.fffffep+23, -0x1.000000p+23,

> +	     -0x1.fffffcp+22, -0x1.fffffcp+22 } },

> +

> +  { { .f = { -0x1.fffffep+21, -0x1.fffffcp+21,

> +	     -0x1.fffffap+21, -0x1.fffff8p+21 } },

> +           { -0x1.000000p+22, -0x1.000000p+22,

> +	     -0x1.000000p+22, -0x1.fffff8p+21 } },

> +

> +  { { .f = { -1.00, -0.75, -0.50, -0.25 } }, { -1.0, -1.0, -1.0, -1.0 } }

> +};

> +

> +#include "sse4_1-round.h"

> diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c

> new file mode 100644

> index 000000000000..e4ebc550556f

> --- /dev/null

> +++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c

> @@ -0,0 +1,119 @@

> +/* { dg-do run } */

> +/* { dg-require-effective-target p8vector_hw } */

> +/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */

> +

> +#define NO_WARN_X86_INTRINSICS 1

> +#include <smmintrin.h>

> +

> +#define VEC_T __m128d

> +#define FP_T double

> +

> +#define ROUND_INTRIN(x, y) _mm_floor_sd (x, y)

> +

> +#include "sse4_1-round-data.h"

> +

> +static struct data2 data[] = {

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0.00, IGNORED } },

> +    .answer = {  0.0, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0.25, IGNORED } },

> +    .answer = {  0.0, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0.50, IGNORED } },

> +    .answer = {  0.0, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0.75, IGNORED } },

> +    .answer = {  0.0, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.ffffffffffffcp+50, IGNORED } },

> +    .answer = {  0x1.ffffffffffffcp+50, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.ffffffffffffdp+50, IGNORED } },

> +    .answer = {  0x1.ffffffffffffcp+50, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.ffffffffffffep+50, IGNORED } },

> +    .answer = {  0x1.ffffffffffffcp+50, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffffffffffp+50, IGNORED } },

> +    .answer = {  0x1.ffffffffffffcp+50, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.0000000000000p+51, IGNORED } },

> +    .answer = {  0x1.0000000000000p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.0000000000001p+51, IGNORED } },

> +    .answer = {  0x1.0000000000000p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.0000000000002p+51, IGNORED } },

> +    .answer = {  0x1.0000000000002p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.0000000000003p+51, IGNORED } },

> +    .answer = {  0x1.0000000000002p+51, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.ffffffffffffep+51, IGNORED } },

> +    .answer = {  0x1.ffffffffffffep+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffffffffffp+51, IGNORED } },

> +    .answer = {  0x1.ffffffffffffep+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.0000000000000p+52, IGNORED } },

> +    .answer = {  0x1.0000000000000p+52, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.0000000000001p+52, IGNORED } },

> +    .answer = {  0x1.0000000000001p+52, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.0000000000001p+52, IGNORED } },

> +    .answer = { -0x1.0000000000001p+52, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.0000000000000p+52, IGNORED } },

> +    .answer = { -0x1.0000000000000p+52, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffffffffffffp+51, IGNORED } },

> +    .answer = { -0x1.0000000000000p+52, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.ffffffffffffep+51, IGNORED } },

> +    .answer = { -0x1.ffffffffffffep+51, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.0000000000003p+51, IGNORED } },

> +    .answer = { -0x1.0000000000004p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.0000000000002p+51, IGNORED } },

> +    .answer = { -0x1.0000000000002p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.0000000000001p+51, IGNORED } },

> +    .answer = { -0x1.0000000000002p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.0000000000000p+51, IGNORED } },

> +    .answer = { -0x1.0000000000000p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.ffffffffffffcp+50, IGNORED } },

> +    .answer = { -0x1.ffffffffffffcp+50, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.ffffffffffffep+50, IGNORED } },

> +    .answer = { -0x1.0000000000000p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.ffffffffffffdp+50, IGNORED } },

> +    .answer = { -0x1.0000000000000p+51, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.ffffffffffffcp+50, IGNORED } },

> +    .answer = { -0x1.ffffffffffffcp+50, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -1.00, IGNORED } },

> +    .answer = { -1.0, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0.75, IGNORED } },

> +    .answer = { -1.0, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0.50, IGNORED } },

> +    .answer = { -1.0, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH } },

> +    .value2 = { .f = { -0.25, IGNORED } },

> +    .answer = { -1.0, PASSTHROUGH } }

> +};

> +

> +#include "sse4_1-round2.h"

> diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c

> new file mode 100644

> index 000000000000..cfbfe2b1eba7

> --- /dev/null

> +++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c

> @@ -0,0 +1,95 @@

> +/* { dg-do run } */

> +/* { dg-require-effective-target p8vector_hw } */

> +/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */

> +

> +#define NO_WARN_X86_INTRINSICS 1

> +#include <smmintrin.h>

> +

> +#define VEC_T __m128

> +#define FP_T float

> +

> +#define ROUND_INTRIN(x, y) _mm_floor_ss (x, y)

> +

> +#include "sse4_1-round-data.h"

> +

> +static struct data2 data[] = {

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0.00,  IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0.25, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0.50, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0.75, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffff8p+21, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffap+21, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffcp+21, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffep+21, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffap+22, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0x1.fffff8p+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffcp+22, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0x1.fffffcp+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffep+22, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0x1.fffffcp+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = {  0x1.fffffep+23, IGNORED, IGNORED, IGNORED } },

> +    .answer = {  0x1.fffffep+23, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffffep+23, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -0x1.fffffep+23, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffffep+22, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -0x1.000000p+23, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffffcp+22, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -0x1.fffffcp+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffffap+22, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -0x1.fffffcp+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffffep+21, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -0x1.000000p+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffffcp+21, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -0x1.000000p+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffffap+21, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -0x1.000000p+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0x1.fffff8p+21, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -1.00, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -1.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0.75, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -1.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0.50, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -1.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },

> +    .value2 = { .f = { -0.25, IGNORED, IGNORED, IGNORED } },

> +    .answer = { -1.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } }

> +};

> +

> +#include "sse4_1-round2.h"

> diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c

> new file mode 100644

> index 000000000000..cec16175473f

> --- /dev/null

> +++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c

> @@ -0,0 +1,36 @@

> +/* { dg-do run } */

> +/* { dg-require-effective-target p8vector_hw } */

> +/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */

> +

> +#ifndef CHECK_H

> +#define CHECK_H "sse4_1-check.h"

> +#endif

> +

> +#ifndef TEST

> +#define TEST sse4_1_test

> +#endif

> +

> +#include CHECK_H

> +

> +#include <smmintrin.h>

> +

> +static void

> +TEST (void)

> +{

> +  union128d u, s;

> +  double e[2] = {0.0};

> +  int i;

> +

> +  s.x = _mm_set_pd (1.1234, -2.3478);

> +  u.x = _mm_floor_pd (s.x);

> +

> +  for (i = 0; i < 2; i++)

> +    {

> +      __m128d tmp = _mm_load_sd (&s.a[i]);

> +      tmp = _mm_floor_sd (tmp, tmp);

> +      _mm_store_sd (&e[i], tmp);

> +    }

> +

> +  if (check_union128d (u, e))

> +    abort ();

> +}
Segher Boessenkool July 28, 2021, 10:26 p.m. | #2
On Fri, Jul 16, 2021 at 08:50:22AM -0500, Paul A. Clarke wrote:
> gcc/testsuite

> 	* gcc.target/powerpc/sse4_1-floorpd.c: New.

> 	* gcc.target/powerpc/sse4_1-floorps.c: New.

> 	* gcc.target/powerpc/sse4_1-floorsd.c: New.

> 	* gcc.target/powerpc/sse4_1-floorss.c: New.

> 	* gcc.target/powerpc/sse4_1-roundpd-2.c: Copy from

> 	gcc/testsuite/gcc.target/i386.


Okido.  Thanks!


Segher

Patch

diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c
new file mode 100644
index 000000000000..ad21644f50c4
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c
@@ -0,0 +1,51 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */
+
+#define NO_WARN_X86_INTRINSICS 1
+#include <smmintrin.h>
+
+#define VEC_T __m128d
+#define FP_T double
+
+#define ROUND_INTRIN(x, mode) _mm_floor_pd (x)
+
+#include "sse4_1-round-data.h"
+
+static struct data data[] = {
+  { .value = { .f = {  0.00,  0.25 } }, .answer = {  0.0,  0.0 } },
+  { .value = { .f = {  0.50,  0.75 } }, .answer = {  0.0,  0.0 } },
+
+  { { .f = {  0x1.ffffffffffffcp+50,  0x1.ffffffffffffdp+50 } },
+           {  0x1.ffffffffffffcp+50,  0x1.ffffffffffffcp+50 } },
+  { { .f = {  0x1.ffffffffffffep+50,  0x1.0000000000000p+51 } },
+           {  0x1.ffffffffffffcp+50,  0x1.0000000000000p+51 } },
+  { { .f = {  0x1.0000000000000p+51,  0x1.0000000000001p+51 } },
+           {  0x1.0000000000000p+51,  0x1.0000000000000p+51 } },
+  { { .f = {  0x1.0000000000002p+51,  0x1.0000000000003p+51 } },
+           {  0x1.0000000000002p+51,  0x1.0000000000002p+51 } },
+
+  { { .f = {  0x1.ffffffffffffep+51,  0x1.fffffffffffffp+51 } },
+           {  0x1.ffffffffffffep+51,  0x1.ffffffffffffep+51 } },
+  { { .f = {  0x1.0000000000000p+52,  0x1.0000000000001p+52 } },
+           {  0x1.0000000000000p+52,  0x1.0000000000001p+52 } },
+
+  { { .f = { -0x1.0000000000001p+52, -0x1.0000000000000p+52 } },
+           { -0x1.0000000000001p+52, -0x1.0000000000000p+52 } },
+  { { .f = { -0x1.fffffffffffffp+51, -0x1.ffffffffffffep+52 } },
+           { -0x1.0000000000000p+52, -0x1.ffffffffffffep+52 } },
+
+  { { .f = { -0x1.0000000000003p+51, -0x1.0000000000002p+51 } },
+           { -0x1.0000000000004p+51, -0x1.0000000000002p+51 } },
+  { { .f = { -0x1.0000000000001p+51, -0x1.0000000000000p+51 } },
+           { -0x1.0000000000002p+51, -0x1.0000000000000p+51 } },
+  { { .f = { -0x1.fffffffffffffp+50, -0x1.ffffffffffffep+50 } },
+           { -0x1.0000000000000p+51, -0x1.0000000000000p+51 } },
+  { { .f = { -0x1.ffffffffffffdp+50, -0x1.ffffffffffffcp+50 } },
+           { -0x1.0000000000000p+51, -0x1.ffffffffffffcp+50 } },
+
+  { { .f = { -1.00, -0.75 } }, { -1.0, -1.0 } },
+  { { .f = { -0.50, -0.25 } }, { -1.0, -1.0 } }
+};
+
+#include "sse4_1-round.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c
new file mode 100644
index 000000000000..a53ef9aa9e8b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c
@@ -0,0 +1,41 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */
+
+#define NO_WARN_X86_INTRINSICS 1
+#include <smmintrin.h>
+
+#define VEC_T __m128
+#define FP_T float
+
+#define ROUND_INTRIN(x, mode) _mm_floor_ps (x)
+
+#include "sse4_1-round-data.h"
+
+static struct data data[] = {
+  { { .f = {  0.00,  0.25,  0.50,  0.75 } }, {  0.0,  0.0,  0.0,  0.0 } },
+
+  { { .f = {  0x1.fffff8p+21,  0x1.fffffap+21,
+	      0x1.fffffcp+21,  0x1.fffffep+21 } },
+           {  0x1.fffff8p+21,  0x1.fffff8p+21,
+	      0x1.fffff8p+21,  0x1.fffff8p+21 } },
+
+  { { .f = {  0x1.fffffap+22,  0x1.fffffcp+22,
+	      0x1.fffffep+22,  0x1.fffffep+23 } },
+           {  0x1.fffff8p+22,  0x1.fffffcp+22,
+	      0x1.fffffcp+22,  0x1.fffffep+23 } },
+
+  { { .f = { -0x1.fffffep+23, -0x1.fffffep+22,
+	     -0x1.fffffcp+22, -0x1.fffffap+22 } },
+           { -0x1.fffffep+23, -0x1.000000p+23,
+	     -0x1.fffffcp+22, -0x1.fffffcp+22 } },
+
+  { { .f = { -0x1.fffffep+21, -0x1.fffffcp+21,
+	     -0x1.fffffap+21, -0x1.fffff8p+21 } },
+           { -0x1.000000p+22, -0x1.000000p+22,
+	     -0x1.000000p+22, -0x1.fffff8p+21 } },
+
+  { { .f = { -1.00, -0.75, -0.50, -0.25 } }, { -1.0, -1.0, -1.0, -1.0 } }
+};
+
+#include "sse4_1-round.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c
new file mode 100644
index 000000000000..e4ebc550556f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c
@@ -0,0 +1,119 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */
+
+#define NO_WARN_X86_INTRINSICS 1
+#include <smmintrin.h>
+
+#define VEC_T __m128d
+#define FP_T double
+
+#define ROUND_INTRIN(x, y) _mm_floor_sd (x, y)
+
+#include "sse4_1-round-data.h"
+
+static struct data2 data[] = {
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0.00, IGNORED } },
+    .answer = {  0.0, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0.25, IGNORED } },
+    .answer = {  0.0, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0.50, IGNORED } },
+    .answer = {  0.0, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0.75, IGNORED } },
+    .answer = {  0.0, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.ffffffffffffcp+50, IGNORED } },
+    .answer = {  0x1.ffffffffffffcp+50, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.ffffffffffffdp+50, IGNORED } },
+    .answer = {  0x1.ffffffffffffcp+50, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.ffffffffffffep+50, IGNORED } },
+    .answer = {  0x1.ffffffffffffcp+50, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffffffffffp+50, IGNORED } },
+    .answer = {  0x1.ffffffffffffcp+50, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.0000000000000p+51, IGNORED } },
+    .answer = {  0x1.0000000000000p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.0000000000001p+51, IGNORED } },
+    .answer = {  0x1.0000000000000p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.0000000000002p+51, IGNORED } },
+    .answer = {  0x1.0000000000002p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.0000000000003p+51, IGNORED } },
+    .answer = {  0x1.0000000000002p+51, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.ffffffffffffep+51, IGNORED } },
+    .answer = {  0x1.ffffffffffffep+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffffffffffp+51, IGNORED } },
+    .answer = {  0x1.ffffffffffffep+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.0000000000000p+52, IGNORED } },
+    .answer = {  0x1.0000000000000p+52, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.0000000000001p+52, IGNORED } },
+    .answer = {  0x1.0000000000001p+52, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.0000000000001p+52, IGNORED } },
+    .answer = { -0x1.0000000000001p+52, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.0000000000000p+52, IGNORED } },
+    .answer = { -0x1.0000000000000p+52, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffffffffffffp+51, IGNORED } },
+    .answer = { -0x1.0000000000000p+52, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.ffffffffffffep+51, IGNORED } },
+    .answer = { -0x1.ffffffffffffep+51, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.0000000000003p+51, IGNORED } },
+    .answer = { -0x1.0000000000004p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.0000000000002p+51, IGNORED } },
+    .answer = { -0x1.0000000000002p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.0000000000001p+51, IGNORED } },
+    .answer = { -0x1.0000000000002p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.0000000000000p+51, IGNORED } },
+    .answer = { -0x1.0000000000000p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.ffffffffffffcp+50, IGNORED } },
+    .answer = { -0x1.ffffffffffffcp+50, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.ffffffffffffep+50, IGNORED } },
+    .answer = { -0x1.0000000000000p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.ffffffffffffdp+50, IGNORED } },
+    .answer = { -0x1.0000000000000p+51, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.ffffffffffffcp+50, IGNORED } },
+    .answer = { -0x1.ffffffffffffcp+50, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -1.00, IGNORED } },
+    .answer = { -1.0, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0.75, IGNORED } },
+    .answer = { -1.0, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0.50, IGNORED } },
+    .answer = { -1.0, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH } },
+    .value2 = { .f = { -0.25, IGNORED } },
+    .answer = { -1.0, PASSTHROUGH } }
+};
+
+#include "sse4_1-round2.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c
new file mode 100644
index 000000000000..cfbfe2b1eba7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c
@@ -0,0 +1,95 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */
+
+#define NO_WARN_X86_INTRINSICS 1
+#include <smmintrin.h>
+
+#define VEC_T __m128
+#define FP_T float
+
+#define ROUND_INTRIN(x, y) _mm_floor_ss (x, y)
+
+#include "sse4_1-round-data.h"
+
+static struct data2 data[] = {
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0.00,  IGNORED, IGNORED, IGNORED } },
+    .answer = {  0.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0.25, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0.50, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0.75, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffff8p+21, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffap+21, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffcp+21, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffep+21, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffap+22, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0x1.fffff8p+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffcp+22, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0x1.fffffcp+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffep+22, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0x1.fffffcp+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = {  0x1.fffffep+23, IGNORED, IGNORED, IGNORED } },
+    .answer = {  0x1.fffffep+23, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffffep+23, IGNORED, IGNORED, IGNORED } },
+    .answer = { -0x1.fffffep+23, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffffep+22, IGNORED, IGNORED, IGNORED } },
+    .answer = { -0x1.000000p+23, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffffcp+22, IGNORED, IGNORED, IGNORED } },
+    .answer = { -0x1.fffffcp+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffffap+22, IGNORED, IGNORED, IGNORED } },
+    .answer = { -0x1.fffffcp+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffffep+21, IGNORED, IGNORED, IGNORED } },
+    .answer = { -0x1.000000p+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffffcp+21, IGNORED, IGNORED, IGNORED } },
+    .answer = { -0x1.000000p+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffffap+21, IGNORED, IGNORED, IGNORED } },
+    .answer = { -0x1.000000p+22, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0x1.fffff8p+21, IGNORED, IGNORED, IGNORED } },
+    .answer = { -0x1.fffff8p+21, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -1.00, IGNORED, IGNORED, IGNORED } },
+    .answer = { -1.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0.75, IGNORED, IGNORED, IGNORED } },
+    .answer = { -1.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0.50, IGNORED, IGNORED, IGNORED } },
+    .answer = { -1.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+  { .value1 = { .f = { IGNORED, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } },
+    .value2 = { .f = { -0.25, IGNORED, IGNORED, IGNORED } },
+    .answer = { -1.0, PASSTHROUGH, PASSTHROUGH, PASSTHROUGH } }
+};
+
+#include "sse4_1-round2.h"
diff --git a/gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c b/gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c
new file mode 100644
index 000000000000..cec16175473f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c
@@ -0,0 +1,36 @@ 
+/* { dg-do run } */
+/* { dg-require-effective-target p8vector_hw } */
+/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */
+
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
+
+#include <smmintrin.h>
+
+static void
+TEST (void)
+{
+  union128d u, s;
+  double e[2] = {0.0};
+  int i;
+
+  s.x = _mm_set_pd (1.1234, -2.3478);
+  u.x = _mm_floor_pd (s.x);
+
+  for (i = 0; i < 2; i++)
+    {
+      __m128d tmp = _mm_load_sd (&s.a[i]);
+      tmp = _mm_floor_sd (tmp, tmp);
+      _mm_store_sd (&e[i], tmp);
+    }
+  
+  if (check_union128d (u, e))
+    abort ();
+}