From patchwork Fri Feb 9 16:22:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Carl Love X-Patchwork-Id: 871471 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-472961-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.b="wRRD7k8h"; 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 3zdL2q3CHBz9s72 for ; Sat, 10 Feb 2018 03:23:14 +1100 (AEDT) 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:to:cc:date:content-type:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=wBAg5 CiRmwnS7oyiN7NenLrEXrTE8B2AlOh93QK5jfXLbBl4n+NynR2VEAhwXTz1Hfj/3 lxXNPSAPMWz9r8wGJsUTqYi3WFagD98qfa2JiShi4nUW8LbJ/sx4Ia5sTYNEP5M5 j2r4dXxOxaGXtmUgmigmbhdZzgY8VlFLFGJgOQ= 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:to:cc:date:content-type:mime-version :content-transfer-encoding:message-id; s=default; bh=6qGTd6U3Bpe f/FLz/wHwiHGvDbE=; b=wRRD7k8hJrprX1IauDuRux0Dhzl2p38fZNzAQI8IiUN ggHbPcfn0GYy+T+VNZgUTqVlfU3OCEl3RkGTaXwqftEW/c9muTIjLYYgpHEnXR0O 4ADTiw4n9t1oeZNYaGvr/FuiAppU8UoKi8Yr99t1DUfYkxDCCE+qtfej0iruLGwI = Received: (qmail 51492 invoked by alias); 9 Feb 2018 16:23:07 -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 51476 invoked by uid 89); 9 Feb 2018 16:23:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Feb 2018 16:23:04 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w19GKNMd115966 for ; Fri, 9 Feb 2018 11:23:03 -0500 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0b-001b2d01.pphosted.com with ESMTP id 2g1brn94ta-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 09 Feb 2018 11:23:02 -0500 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 9 Feb 2018 11:23:01 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 9 Feb 2018 11:22:59 -0500 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w19GMwoA47382742; Fri, 9 Feb 2018 16:22:58 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7B6E32803D; Fri, 9 Feb 2018 11:22:22 -0500 (EST) Received: from oc3304648336.ibm.com (unknown [9.70.82.121]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP id E87312803F; Fri, 9 Feb 2018 11:22:21 -0500 (EST) Subject: [PATCH rs6000] Fix for builtins-4-runnable.c testcase FAIL on power7/BE 32-bit From: Carl Love To: gcc-patches@gcc.gnu.org, David Edelsohn , Segher Boessenkool Cc: Bill Schmidt , cel@us.ibm.com Date: Fri, 09 Feb 2018 08:22:57 -0800 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18020916-0008-0000-0000-000002CF46D0 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008504; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000251; SDB=6.00987268; UDB=6.00501107; IPR=6.00766626; BA=6.00005821; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019461; XFM=3.00000015; UTC=2018-02-09 16:23:00 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18020916-0009-0000-0000-000038344045 Message-Id: <1518193377.7508.2.camel@us.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-02-09_08:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802090208 X-IsSubscribed: yes GCC maintainers: The following patch contains fixes for the builtins4-runnable.c test in 32-bit mode for the current GCC 8 branch. This is issue #290 in Bill Schmidt's issues. The int128 and uint128 variable types are not supported in 32-bit mode. The tests were moved to a new test file and restricted to run only when int128 type is supported. The patch passes the regression testing on Power 8 BE enabled for 64- bit and 32-bit modes. Additionally, the patch passes regression testing on Power 8 LE. Let me know if the patch looks OK or not.  Carl Love gcc/testsuite/ChangeLog: 2018-02-09  Carl Love   * gcc.target/powerpc/builtins-4-runnable.c (main): Move int128 and uint128 tests to new testfile. * gcc.target/powerpc/builtins-4-int128-runnable.c: New testfile for int128 and uint128 tests. * gcc.target/powerpc/powerpc.exp: Add builtins-4-int128- runnable.c to list oftorture tests. ---  .../powerpc/builtins-4-int128-runnable.c           | 108 +++++++++++++++++++++  .../gcc.target/powerpc/builtins-4-runnable.c       |  84 ----------- -----  gcc/testsuite/gcc.target/powerpc/powerpc.exp       |   1 +  3 files changed, 109 insertions(+), 84 deletions(-)  create mode 100644 gcc/testsuite/gcc.target/powerpc/builtins-4-int128- runnable.c $DEFAULT_CFLAGS --  2.7.4 diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-4-int128- runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-4-int128- runnable.c new file mode 100644 index 0000000..a6973f7 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/builtins-4-int128-runnable.c @@ -0,0 +1,108 @@ +/* { dg-do run } */ +/* { dg-require-effective-target vsx_hw } */ +/* { dg-options "-maltivec -mvsx" } */ + +#include +#include // vector + +#ifdef DEBUG +#include +#endif + +void abort (void); + +int main() { +  int i; +  __uint128_t data_u128[100]; +  __int128_t data_128[100]; + +  vector __int128_t vec_128_expected1, vec_128_result1; +  vector __uint128_t vec_u128_expected1, vec_u128_result1; +  signed long long zero = (signed long long) 0; + +  for (i = 0; i < 100; i++) +    { +      data_128[i] = i + 12800000; +      data_u128[i] = i + 12800001; +    } + +  /* vec_xl() tests */ + +  vec_128_expected1 = (vector __int128_t){12800000}; +  vec_128_result1 = vec_xl (zero, data_128); + +  if (vec_128_expected1[0] != vec_128_result1[0]) +    { +#ifdef DEBUG + printf("Error: vec_xl(), vec_128_result1[0] = %lld %llu; ", +        vec_128_result1[0] >> 64, +        vec_128_result1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF); + printf("vec_128_expected1[0] = %lld %llu\n", +        vec_128_expected1[0] >> 64, +        vec_128_expected1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF); +#else + abort (); +#endif +    } + +  vec_u128_result1 = vec_xl (zero, data_u128); +  vec_u128_expected1 = (vector __uint128_t){12800001}; +  if (vec_u128_expected1[0] != vec_u128_result1[0]) +    { +#ifdef DEBUG + printf("Error: vec_xl(), vec_u128_result1[0] = %lld; ", +        vec_u128_result1[0] >> 64, +        vec_u128_result1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF); + printf("vec_u128_expected1[0] = %lld\n", +        vec_u128_expected1[0] >> 64, +        vec_u128_expected1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF); +#else + abort (); +#endif +    } + +  /* vec_xl_be() tests */ + +  vec_128_result1 = vec_xl_be (zero, data_128); +#ifdef __BIG_ENDIAN__ +  vec_128_expected1 = (vector __int128_t){ (__int128_t)12800000 }; +#else +  vec_128_expected1 = (vector __int128_t){ (__int128_t)12800000 }; +#endif + +  if (vec_128_expected1[0] != vec_128_result1[0]) +    { +#ifdef DEBUG + printf("Error: vec_xl_be(), vec_128_result1[0] = %llu %llu;", +        vec_128_result1[0] >> 64, +        vec_128_result1[0] & 0xFFFFFFFFFFFFFFFF); + printf(" vec_128_expected1[0] = %llu %llu\n", +        vec_128_expected1[0] >> 64, +        vec_128_expected1[0] & 0xFFFFFFFFFFFFFFFF); +#else +      abort (); +#endif +    } + +#ifdef __BIG_ENDIAN__ +  vec_u128_expected1 = (vector __uint128_t){ (__uint128_t)12800001 }; +#else +  vec_u128_expected1 = (vector __uint128_t){ (__uint128_t)12800001 }; +#endif + +  vec_u128_result1 = vec_xl_be (zero, data_u128); + +  if (vec_u128_expected1[0] != vec_u128_result1[0]) +    { +#ifdef DEBUG + printf("Error: vec_xl_be(), vec_u128_result1[0] = %llu %llu;", +        vec_u128_result1[0] >> 64, +        vec_u128_result1[0] & 0xFFFFFFFFFFFFFFFF); + printf(" vec_u128_expected1[0] = %llu %llu\n", +        vec_u128_expected1[0] >> 64, +        vec_u128_expected1[0] & 0xFFFFFFFFFFFFFFFF); +#else +      abort (); +#endif +    } +} diff --git a/gcc/testsuite/gcc.target/powerpc/builtins-4-runnable.c b/gcc/testsuite/gcc.target/powerpc/builtins-4-runnable.c index de9b916..35884b5 100644 --- a/gcc/testsuite/gcc.target/powerpc/builtins-4-runnable.c +++ b/gcc/testsuite/gcc.target/powerpc/builtins-4-runnable.c @@ -27,9 +27,6 @@ int main() {      float data_f[100];    double data_d[100]; -  __uint128_t data_u128[100]; -  __int128_t data_128[100]; -    signed long long disp;      vector signed char vec_c_expected1, vec_c_expected2, vec_c_result1, vec_c_result2; @@ -47,8 +44,6 @@ int main() {      vec_sll_result1, vec_sll_result2;    vector unsigned long long vec_ull_expected1, vec_ull_expected2,      vec_ull_result1, vec_ull_result2; -  vector __int128_t vec_128_expected1, vec_128_result1; -  vector __uint128_t vec_u128_expected1, vec_u128_result1;    vector float vec_f_expected1, vec_f_expected2, vec_f_result1, vec_f_result2;    vector double vec_d_expected1, vec_d_expected2, vec_d_result1, vec_d_result2;    char buf[20]; @@ -66,8 +61,6 @@ int main() {        data_ull[i] = i+1001;        data_f[i] = i+100000.0;        data_d[i] = i+1000000.0; -      data_128[i] = i + 12800000; -      data_u128[i] = i + 12800001;      }      // vec_xl() tests @@ -319,39 +312,6 @@ int main() {  #endif      }   -  vec_128_expected1 = (vector __int128_t){12800000}; -  vec_128_result1 = vec_xl (zero, data_128); - -  if (vec_128_expected1[0] != vec_128_result1[0]) -    { -#ifdef DEBUG - printf("Error: vec_xl(), vec_128_result1[0] = %lld %llu; ", -        vec_128_result1[0] >> 64, -        vec_128_result1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF); - printf("vec_128_expected1[0] = %lld %llu\n", -        vec_128_expected1[0] >> 64, -        vec_128_expected1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF); -#else - abort (); -#endif -    } - -  vec_u128_result1 = vec_xl (zero, data_u128); -  vec_u128_expected1 = (vector __uint128_t){12800001}; -  if (vec_u128_expected1[0] != vec_u128_result1[0]) -    { -#ifdef DEBUG - printf("Error: vec_xl(), vec_u128_result1[0] = %lld; ", -        vec_u128_result1[0] >> 64, -        vec_u128_result1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF); - printf("vec_u128_expected1[0] = %lld\n", -        vec_u128_expected1[0] >> 64, -        vec_u128_expected1[0] & (__int128_t)0xFFFFFFFFFFFFFFFF); -#else - abort (); -#endif -    } -    // vec_xl_be() tests    disp = 1;  #ifdef __BIG_ENDIAN__ @@ -710,48 +670,4 @@ int main() {   abort ();  #endif      } - -  disp = 0; -  vec_128_result1 = vec_xl_be (zero, data_128); -#ifdef __BIG_ENDIAN__ -  vec_128_expected1 = (vector __int128_t){ (__int128_t)12800000 }; -#else -  vec_128_expected1 = (vector __int128_t){ (__int128_t)12800000 }; -#endif - -  if (vec_128_expected1[0] != vec_128_result1[0]) -    { -#ifdef DEBUG - printf("Error: vec_xl_be(), vec_128_result1[0] = %llu %llu;", -        vec_128_result1[0] >> 64, -        vec_128_result1[0] & 0xFFFFFFFFFFFFFFFF); - printf(" vec_128_expected1[0] = %llu %llu\n", -        vec_128_expected1[0] >> 64, -        vec_128_expected1[0] & 0xFFFFFFFFFFFFFFFF); -#else -      abort (); -#endif -    } - -#ifdef __BIG_ENDIAN__ -  vec_u128_expected1 = (vector __uint128_t){ (__uint128_t)12800001 }; -#else -  vec_u128_expected1 = (vector __uint128_t){ (__uint128_t)12800001 }; -#endif - -  vec_u128_result1 = vec_xl_be (zero, data_u128); - -  if (vec_u128_expected1[0] != vec_u128_result1[0]) -    { -#ifdef DEBUG - printf("Error: vec_xl_be(), vec_u128_result1[0] = %llu %llu;", -        vec_u128_result1[0] >> 64, -        vec_u128_result1[0] & 0xFFFFFFFFFFFFFFFF); - printf(" vec_u128_expected1[0] = %llu %llu\n", -        vec_u128_expected1[0] >> 64, -        vec_u128_expected1[0] & 0xFFFFFFFFFFFFFFFF); -#else -      abort (); -#endif -    }  } diff --git a/gcc/testsuite/gcc.target/powerpc/powerpc.exp b/gcc/testsuite/gcc.target/powerpc/powerpc.exp index 148acb1..fdb3e93 100644 --- a/gcc/testsuite/gcc.target/powerpc/powerpc.exp +++ b/gcc/testsuite/gcc.target/powerpc/powerpc.exp @@ -54,6 +54,7 @@ torture-init  # Test load/store builtins at multiple optimizations  set-torture-options [list -O0 -Os -O1 -O2 -O3]  gcc-dg-runtest [list $srcdir/$subdir/builtins-4-runnable.c \ + $srcdir/$subdir/builtins-4-int128-runnable.c \   $srcdir/$subdir/builtins-6-runnable.c \   $srcdir/$subdir/builtins-5-p9-runnable.c \           $srcdir/$subdir/builtins-6-p9-runnable.c] ""