From patchwork Mon Jul 9 19:08:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: will schmidt X-Patchwork-Id: 941583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-481237-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=vnet.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="GiTiRXKO"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41PZd036Gdz9s0W for ; Tue, 10 Jul 2018 05:09:08 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:content-type:date:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=i/DPF 0qKhjnRq142JUw93pxEeb/uzl7R2EGNl1saDHZxHWF/8h9oT8EvbYVfrSOr72KU3 j6slMAcwm6JOgcG0b7zAICl88xqLINPCTMFSBkNQ0xqJ5Vg7wMB4PhXN6Hh+NO8+ tf4Ei/PkBEA4EmLPbJqpk3PNR7Cf09YDcDqDYc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:reply-to:to:cc:content-type:date:mime-version :content-transfer-encoding:message-id; s=default; bh=tOWv83xkXWs jrJNqcUllAGyPXPU=; b=GiTiRXKODrH33nxTKYpODBGfBDf7RxKJx98dR4vTonG sLEdBxNgpZCovfDE/JELp1XVEMSaGFznnQ2ZCXzop/2oy10FbF8+1Qg2G2+99CqQ tK07bBSumTtb/4eIptufeuoY0aIzexQktopbzgIzS6mNLRqzeewssqwdfvxKzwrI = Received: (qmail 39593 invoked by alias); 9 Jul 2018 19:08:59 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 39570 invoked by uid 89); 9 Jul 2018 19:08:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-27.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:dg-requ, sk:dgrequ X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Jul 2018 19:08:56 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w69J4CLL086357 for ; Mon, 9 Jul 2018 15:08:55 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2k4c3mwmek-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 09 Jul 2018 15:08:55 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Jul 2018 15:08:53 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 9 Jul 2018 15:08:51 -0400 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w69J8oqX11206932 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Jul 2018 19:08:50 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE4C12805A; Mon, 9 Jul 2018 15:08:15 -0400 (EDT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6EB8E28059; Mon, 9 Jul 2018 15:08:15 -0400 (EDT) Received: from [9.10.86.107] (unknown [9.10.86.107]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 9 Jul 2018 15:08:15 -0400 (EDT) Subject: [PATCH, rs6000] Testcase adds for vec_unpack From: Will Schmidt Reply-To: will_schmidt@vnet.ibm.com To: Segher Boessenkool , David Edelsohn , Bill Schmidt Cc: GCC Patches Date: Mon, 09 Jul 2018 14:08:49 -0500 Mime-Version: 1.0 x-cbid: 18070919-0072-0000-0000-0000037D6534 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009340; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01058948; UDB=6.00543436; IPR=6.00836868; MB=3.00022074; MTD=3.00000008; XFM=3.00000015; UTC=2018-07-09 19:08:52 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18070919-0073-0000-0000-000048A779D2 Message-Id: <1531163329.17604.40.camel@brimstone.rchland.ibm.com> X-IsSubscribed: yes Hi, Testcases to exercise the vec_unpack intrinsics. Tested clean across assorted systems. OK for trunk? Thanks, -Will [testsuite] 2018-07-09 Will Schmidt * gcc.target/powerpc/fold-vec-unpack-char.c: New. * gcc.target/powerpc/fold-vec-unpack-float.c: New. * gcc.target/powerpc/fold-vec-unpack-int.c: New. * gcc.target/powerpc/fold-vec-unpack-pixel.c: New. * gcc.target/powerpc/fold-vec-unpack-short.c: New. diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c new file mode 100644 index 0000000..7f4b372 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-char.c @@ -0,0 +1,36 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with char + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector bool short +testbc_l (vector bool char vbc2) +{ + return vec_unpackl (vbc2); +} + +vector signed short +testsc_l (vector signed char vsc2) +{ + return vec_unpackl (vsc2); +} + +vector bool short +testbc_h (vector bool char vbc2) +{ + return vec_unpackh (vbc2); +} + +vector signed short +testsc_h (vector signed char vsc2) +{ + return vec_unpackh (vsc2); +} + +/* { dg-final { scan-assembler-times "vupkhsb" 2 } } */ +/* { dg-final { scan-assembler-times "vupklsb" 2 } } */ + diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c new file mode 100644 index 0000000..78e8eb3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-float.c @@ -0,0 +1,23 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with float + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include + +vector double +testf_l (vector float vf2) +{ + return vec_unpackl (vf2); +} + +vector double +testf_h (vector float vf2) +{ + return vec_unpackh (vf2); +} + +/* { dg-final { scan-assembler-times "xxsldwi" 4 } } */ +/* { dg-final { scan-assembler-times "xvcvspdp" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c new file mode 100644 index 0000000..621c4eb --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-int.c @@ -0,0 +1,35 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with int + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_p8vector_ok } */ +/* { dg-options "-mpower8-vector -O2" } */ + +#include + +vector bool long long +testbi_l (vector bool int vbi2) +{ + return vec_unpackl (vbi2); +} + +vector signed long long +testsi_l (vector signed int vsi2) +{ + return vec_unpackl (vsi2); +} + +vector bool long long +testbi_h (vector bool int vbi2) +{ + return vec_unpackh (vbi2); +} + +vector signed long long +testsi_h (vector signed int vsi2) +{ + return vec_unpackh (vsi2); +} + +/* { dg-final { scan-assembler-times "vupkhsw" 2 } } */ +/* { dg-final { scan-assembler-times "vupklsw" 2 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c new file mode 100644 index 0000000..8e7d110 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-pixel.c @@ -0,0 +1,23 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with pixel + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector unsigned int +testf_el (vector pixel vpx2) +{ + return vec_unpackl (vpx2); +} + +vector unsigned int +testf_eh (vector pixel vpx2) +{ + return vec_unpackh (vpx2); +} + +/* { dg-final { scan-assembler-times "vupkhpx" 1 } } */ +/* { dg-final { scan-assembler-times "vupklpx" 1 } } */ diff --git a/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c new file mode 100644 index 0000000..da51012 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/fold-vec-unpack-short.c @@ -0,0 +1,36 @@ +/* Verify that overloaded built-ins for vec_unpackh and vec_unpackl with int + inputs produce the right code. */ + +/* { dg-do compile } */ +/* { dg-require-effective-target powerpc_altivec_ok } */ +/* { dg-options "-maltivec -O2" } */ + +#include + +vector bool int +testbi_el (vector bool short vbs2) +{ + return vec_unpackl (vbs2); +} + +vector signed int +testsi_el (vector signed short vss2) +{ + return vec_unpackl (vss2); +} + +vector bool int +testbi_eh (vector bool short vbs2) +{ + return vec_unpackh (vbs2); +} + +vector signed int +testsi_eh (vector signed short vss2) +{ + return vec_unpackh (vss2); +} + +/* { dg-final { scan-assembler-times "vupkhsh" 2 } } */ +/* { dg-final { scan-assembler-times "vupklsh" 2 } } */ +