From patchwork Tue Jul 6 22:50:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul A. Clarke" X-Patchwork-Id: 1501477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=cdZLF8Gt; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GKHvN2hn4z9sWq for ; Wed, 7 Jul 2021 08:55:12 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F0CDE393AC2C for ; Tue, 6 Jul 2021 22:55:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0CDE393AC2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1625612110; bh=a7y6x2fGMyshUeVJ7OsfjgfQvKPEQgANtI95HYoPngU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=cdZLF8GtnZqUaUMzvtxVJFmxfwUCjlP1hbIx/RSwUfctd9EASNeVn4ff1bXqyayXr zSMHx/Yzu4AOrCWxZWDVSVv3ufSHZfhR0/5B2YhI5+Mer/HNIaMsiZipyOdyNQbeJu gNrzG3CeO5zmCg4qsp1qC+U38Kzgm0ttm5hDnxMw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 5CCD6393AC36 for ; Tue, 6 Jul 2021 22:51:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5CCD6393AC36 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 166MXrrx002437; Tue, 6 Jul 2021 18:51:21 -0400 Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com with ESMTP id 39mn8ab3nq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Jul 2021 18:51:21 -0400 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 166Mm523020238; Tue, 6 Jul 2021 22:51:20 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma02wdc.us.ibm.com with ESMTP id 39jfhbaqn7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Jul 2021 22:51:19 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 166MpJvx17498542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Jul 2021 22:51:19 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E7C53C6059; Tue, 6 Jul 2021 22:51:18 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 930BCC605A; Tue, 6 Jul 2021 22:51:18 +0000 (GMT) Received: from localhost (unknown [9.80.195.169]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Tue, 6 Jul 2021 22:51:18 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 2/2] rs6000: Add tests for SSE4.1 "floor" intrinsics Date: Tue, 6 Jul 2021 17:50:57 -0500 Message-Id: <20210706225057.644872-3-pc@us.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210706225057.644872-1-pc@us.ibm.com> References: <20210706225057.644872-1-pc@us.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: nEJBOFMh8R5KyOXMxtECMeRUykBVVplj X-Proofpoint-GUID: nEJBOFMh8R5KyOXMxtECMeRUykBVVplj X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-06_13:2021-07-06, 2021-07-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 mlxscore=0 clxscore=1015 spamscore=0 impostorscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107060106 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Paul A. Clarke via Gcc-patches" From: "Paul A. Clarke" Reply-To: "Paul A. Clarke" Cc: segher@kernel.crashing.org Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" 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-06 Paul A. Clarke gcc/testsuite/ChangeLog: * gcc/testsuite/gcc.target/powerpc/sse4_1-floorpd.c: New. * gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c: New. * gcc/testsuite/gcc.target/powerpc/sse4_1-floorsd.c: New. * gcc/testsuite/gcc.target/powerpc/sse4_1-floorss.c: New. * gcc/testsuite/gcc.target/powerpc/sse4_1-roundpd-2.c: Copy from gcc/testsuite/gcc.target/i386. --- .../gcc.target/powerpc/sse4_1-floorpd.c | 51 ++++++++ .../gcc.target/powerpc/sse4_1-floorps.c | 33 +++++ .../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, 334 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 + +#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..17ff35a7360f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/sse4_1-floorps.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-require-effective-target p8vector_hw } */ +/* { dg-options "-O2 -mpower8-vector -Wno-psabi" } */ + +#define NO_WARN_X86_INTRINSICS 1 +#include + +#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 + +#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 + +#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 + +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 (); +}