From patchwork Thu Mar 29 14:47:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kelvin Nilsen X-Patchwork-Id: 892818 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-475614-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.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="muWOFA31"; 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 40Bnfl5fMyz9s0n for ; Fri, 30 Mar 2018 01:47:59 +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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=kFRTs nymwrlSZ9VubbeIg37STkIq1xvcqJ8NwTRBU5UsbJggkFplEd/b5RuRAFFWxAsxX K7AyhZE6eG0ZKFxoIFaHY3sFMkW8SS7mLEp/nWxCqynZtfEC4gFHKBRa8DbwihDF vP2NaW2ewFUrwhwEAlbptTeGVUfdUjAnOWh1V4= 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:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=LicgBGiKjLy wbD/OIjQXNv64ooQ=; b=muWOFA31ubezmbk+F3LSaseIlN0+AjShfIP73+NWHTq xWU6Dt5JFf0mRdzSPjqqzOabXJceV8/vzdI3IQHl6cOd6RB78CY7mKmP1Q2Zibeh j7teNg/tME8o+1HOBdq1fD8oAz252QGF+fIvINmcUl0afMiDN2lSIa3u7APA3jOo = Received: (qmail 114843 invoked by alias); 29 Mar 2018 14:47:51 -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 114218 invoked by uid 89); 29 Mar 2018 14:47:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-15.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, 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; Thu, 29 Mar 2018 14:47:48 +0000 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2TEfRR3024820 for ; Thu, 29 Mar 2018 10:47:46 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h11kg1sad-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 29 Mar 2018 10:47:45 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 29 Mar 2018 10:47:45 -0400 Received: from b01cxnp22036.gho.pok.ibm.com (9.57.198.26) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 29 Mar 2018 10:47:43 -0400 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2TElhb256623268; Thu, 29 Mar 2018 14:47:43 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0636124035; Thu, 29 Mar 2018 11:49:50 -0400 (EDT) Received: from kelvins-mbp.rchland.ibm.com (unknown [9.10.86.22]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP id 607F3124037; Thu, 29 Mar 2018 11:49:50 -0400 (EDT) To: gcc-patches@gcc.gnu.org Cc: segher@gcc.gnu.org From: Kelvin Nilsen Subject: [PATCH, rs6000] Tidy implementation of vec_ldl Date: Thu, 29 Mar 2018 09:47:42 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18032914-0036-0000-0000-000002D8D36A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008765; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01010144; UDB=6.00514644; IPR=6.00789423; MB=3.00020312; MTD=3.00000008; XFM=3.00000015; UTC=2018-03-29 14:47:44 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18032914-0037-0000-0000-000043CD89E8 Message-Id: <4c2f94d7-f1fe-078e-d5cf-6f106caebaba@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-03-29_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 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-1803290155 X-IsSubscribed: yes During code review, an inconsistency was noticed in some of the prototypes defined for the vec_ldl built-in function. In particular, the vector fetched from an address declare to be long long * was returned as "vector int".  In addressing this problem, certain other inconsistencies and omissions were discovered.  This patch tidies up the implementation of this function.  A separate patch is in preparation to address the documentation for this and all other PowerPC built-in functions. In summary, this patch removes two prototypes:   vector int vec_ldl (int, long int *)   vector unsigned int vec_ldl (int, unsigned long int *) and adds eight:   vector bool char vec_ldl (int, bool char *)   vector bool short vec_ldl (int, bool short *)   vector bool int vec_ldl (int, bool int *)   vector bool long long vec_ldl (int, bool long long *)   vector pixel vec_ldl (int, pixel *)   vector long long vec_ldl (int, long long *)   vector unsigned long long vec_ldl (int, unsigned long long *) This patch has been bootstrapped and tested without regressions on both powerpc64le-unknown-linux (P8) and on powerpc-linux (P7 big-endian, with both -m32 and -m64 target options). Is this ok for trunk? gcc/ChangeLog: 2018-03-29  Kelvin Nilsen     * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Remove     erroneous entries for     "vector int vec_ldl (int, long int *)", and     "vector    unsigned int vec_ldl (int, unsigned long int *)".     Add comments and entries for     "vector bool char vec_ldl (int, bool char *)",     "vector bool short vec_ldl (int, bool short *)",     "vector bool int vec_ldl (int, bool int *)",     "vector bool long long vec_ldl (int, bool long long *)",     "vector pixel vec_ldl (int, pixel *)",     "vector long long vec_ldl (int, long long *)",     "vector unsigned long long vec_ldl (int, unsigned long long *)".     * config/rs6000/rs6000.c (rs6000_init_builtins): Initialize new     type tree bool_long_long_type_node and correct definition of     bool_V2DI_type_node to make reference to this new type tree.     (rs6000_mangle_type): Replace erroneous reference to     bool_long_type_node with bool_long_long_type_node.     * config/rs6000/rs6000.h (enum rs6000_builtin_type_index): Add     comments to emphasize sign distinctions for char and int types and     replace RS6000_BTI_bool_long constant with     RS6000_BTI_bool_long_long constant.     (bool_long_type_node): Remove this macro definition.     (bool_long_long_type_node): New macro definition gcc/testsuite/ChangeLog: 2018-03-29  Kelvin Nilsen     * gcc.target/powerpc/vec-ldl-1.c: New test.     * gcc.dg/vmx/ops-long-1.c: Correct test programs to reflect     corrections to ABI implementation. +  return 0; +} Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c    (revision 258800) +++ gcc/config/rs6000/rs6000.c    (working copy) @@ -16947,7 +16947,7 @@ rs6000_init_builtins (void)    bool_char_type_node = build_distinct_type_copy (unsigned_intQI_type_node);    bool_short_type_node = build_distinct_type_copy (unsigned_intHI_type_node);    bool_int_type_node = build_distinct_type_copy (unsigned_intSI_type_node); -  bool_long_type_node = build_distinct_type_copy (unsigned_intDI_type_node); +  bool_long_long_type_node = build_distinct_type_copy (unsigned_intDI_type_node);    pixel_type_node = build_distinct_type_copy (unsigned_intHI_type_node);    long_integer_type_internal_node = long_integer_type_node; @@ -17064,7 +17064,7 @@ rs6000_init_builtins (void)    bool_V2DI_type_node = rs6000_vector_type (TARGET_POWERPC64                          ? "__vector __bool long"                          : "__vector __bool long long", -                        bool_long_type_node, 2); +                        bool_long_long_type_node, 2);    pixel_V8HI_type_node = rs6000_vector_type ("__vector __pixel",                           pixel_type_node, 8); @@ -32855,7 +32855,7 @@ rs6000_mangle_type (const_tree type)    if (type == bool_short_type_node) return "U6__bools";    if (type == pixel_type_node) return "u7__pixel";    if (type == bool_int_type_node) return "U6__booli"; -  if (type == bool_long_type_node) return "U6__booll"; +  if (type == bool_long_long_type_node) return "U6__booll";    /* Use a unique name for __float128 rather than trying to use "e" or "g". Use       "g" for IBM extended double, no matter whether it is long double (using Index: gcc/config/rs6000/rs6000.h =================================================================== --- gcc/config/rs6000/rs6000.h    (revision 258800) +++ gcc/config/rs6000/rs6000.h    (working copy) @@ -2578,7 +2578,7 @@ enum rs6000_builtin_type_index    RS6000_BTI_opaque_V2SF,    RS6000_BTI_opaque_p_V2SI,    RS6000_BTI_opaque_V4SI, -  RS6000_BTI_V16QI, +  RS6000_BTI_V16QI,              /* __vector signed char */    RS6000_BTI_V1TI,    RS6000_BTI_V2SI,    RS6000_BTI_V2SF, @@ -2588,7 +2588,7 @@ enum rs6000_builtin_type_index    RS6000_BTI_V4SI,    RS6000_BTI_V4SF,    RS6000_BTI_V8HI, -  RS6000_BTI_unsigned_V16QI, +  RS6000_BTI_unsigned_V16QI,     /* __vector unsigned char */    RS6000_BTI_unsigned_V1TI,    RS6000_BTI_unsigned_V8HI,    RS6000_BTI_unsigned_V4SI, @@ -2596,7 +2596,7 @@ enum rs6000_builtin_type_index    RS6000_BTI_bool_char,          /* __bool char */    RS6000_BTI_bool_short,         /* __bool short */    RS6000_BTI_bool_int,           /* __bool int */ -  RS6000_BTI_bool_long,         /* __bool long */ +  RS6000_BTI_bool_long_long,     /* __bool long long */    RS6000_BTI_pixel,              /* __pixel */    RS6000_BTI_bool_V16QI,         /* __vector __bool char */    RS6000_BTI_bool_V8HI,          /* __vector __bool short */ @@ -2607,11 +2607,11 @@ enum rs6000_builtin_type_index    RS6000_BTI_unsigned_long,      /* long_unsigned_type_node */    RS6000_BTI_long_long,             /* long_long_integer_type_node */    RS6000_BTI_unsigned_long_long, /* long_long_unsigned_type_node */ -  RS6000_BTI_INTQI,             /* intQI_type_node */ +  RS6000_BTI_INTQI,             /* (signed) intQI_type_node */    RS6000_BTI_UINTQI,         /* unsigned_intQI_type_node */    RS6000_BTI_INTHI,             /* intHI_type_node */    RS6000_BTI_UINTHI,         /* unsigned_intHI_type_node */ -  RS6000_BTI_INTSI,         /* intSI_type_node */ +  RS6000_BTI_INTSI,         /* intSI_type_node (signed) */    RS6000_BTI_UINTSI,         /* unsigned_intSI_type_node */    RS6000_BTI_INTDI,         /* intDI_type_node */    RS6000_BTI_UINTDI,         /* unsigned_intDI_type_node */ @@ -2652,7 +2652,7 @@ enum rs6000_builtin_type_index  #define bool_char_type_node (rs6000_builtin_types[RS6000_BTI_bool_char])  #define bool_short_type_node (rs6000_builtin_types[RS6000_BTI_bool_short])  #define bool_int_type_node (rs6000_builtin_types[RS6000_BTI_bool_int]) -#define bool_long_type_node (rs6000_builtin_types[RS6000_BTI_bool_long]) +#define bool_long_long_type_node (rs6000_builtin_types[RS6000_BTI_bool_long_long])  #define pixel_type_node (rs6000_builtin_types[RS6000_BTI_pixel])  #define bool_V16QI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V16QI])  #define bool_V8HI_type_node (rs6000_builtin_types[RS6000_BTI_bool_V8HI]) Index: gcc/config/rs6000/rs6000-c.c =================================================================== --- gcc/config/rs6000/rs6000-c.c    (revision 258800) +++ gcc/config/rs6000/rs6000-c.c    (working copy) @@ -1656,29 +1656,50 @@ const struct altivec_builtin_types altivec_overloa      RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 },    { ALTIVEC_BUILTIN_VEC_LVEBX, ALTIVEC_BUILTIN_LVEBX,      RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + +  /*     vector float vec_ldl (int, vector float *); +   *     vector float vec_ldl (int, float *); */    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SF,      RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_V4SF, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SF,      RS6000_BTI_V4SF, RS6000_BTI_INTSI, ~RS6000_BTI_float, 0 }, + +  /*     vector bool int vec_ldl (int, vector bool int *); +   *     vector bool int vec_ldl (int, bool int *); +   *          vector int vec_ldl (int, vector int *); +   *          vector int vec_ldl (int, int *); +   * vector unsigned int vec_ldl (int, vector unsigned int *); +   * vector unsigned int vec_ldl (int, unsigned int *); */    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SI,      RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V4SI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SI, +    RS6000_BTI_bool_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_int, 0 }, +  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SI,      RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_V4SI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SI,      RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_INTSI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SI, -    RS6000_BTI_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_long, 0 }, -  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SI,      RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V4SI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SI,      RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTSI, 0 }, -  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V4SI, -    RS6000_BTI_unsigned_V4SI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_long, 0 }, + +  /*     vector bool short vec_ldl (int, vector bool short *); +   *     vector bool short vec_ldl (int, bool short *); +   *          vector pixel vec_ldl (int, vector pixel *); +   *          vector pixel vec_ldl (int, pixel *); +   *          vector short vec_ldl (int, vector short *); +   *          vector short vec_ldl (int, short *); +   * vector unsigned short vec_ldl (int, vector unsigned short *); +   * vector unsigned short vec_ldl (int, unsigned short *); */    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V8HI,      RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V8HI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V8HI, +    RS6000_BTI_bool_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_short, 0 }, +  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V8HI,      RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel_V8HI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V8HI, +    RS6000_BTI_pixel_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_pixel, 0 }, +  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V8HI,      RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_V8HI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V8HI,      RS6000_BTI_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_INTHI, 0 }, @@ -1686,9 +1707,18 @@ const struct altivec_builtin_types altivec_overloa      RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_unsigned_V8HI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V8HI,      RS6000_BTI_unsigned_V8HI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTHI, 0 }, + +  /*     vector bool char vec_ldl (int, vector bool char *); +   *     vector bool char vec_ldl (int, bool char *); +   *          vector char vec_ldl (int, vector char *); +   *          vector char vec_ldl (int, char *); +   * vector unsigned char vec_ldl (int, vector unsigned char *); +   * vector unsigned char vec_ldl (int, unsigned char *); */    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V16QI,      RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V16QI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V16QI, +    RS6000_BTI_bool_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_char, 0 }, +  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V16QI,      RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_V16QI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V16QI,      RS6000_BTI_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_INTQI, 0 }, @@ -1697,15 +1727,35 @@ const struct altivec_builtin_types altivec_overloa      ~RS6000_BTI_unsigned_V16QI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V16QI,      RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 }, + +  /*     vector double vec_ldl (int, vector double *); +   *     vector double vec_ldl (int, double *); */    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V2DF,      RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_V2DF, 0 }, +  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V2DF, +    RS6000_BTI_V2DF, RS6000_BTI_INTSI, ~RS6000_BTI_double, 0 }, + +  /*          vector long long vec_ldl (int, vector long long *); +   *          vector long long vec_ldl (int, long long *); +   * vector unsigned long long vec_ldl (int, vector unsigned long long *); +   * vector unsigned long long vec_ldl (int, unsigned long long *); +   *     vector bool long long vec_ldl (int, vector bool long long *); +   *     vector bool long long vec_ldl (int, bool long long *); */    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V2DI,      RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_V2DI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V2DI, +    RS6000_BTI_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_long_long, 0 }, +  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V2DI,      RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI,      ~RS6000_BTI_unsigned_V2DI, 0 },    { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V2DI, +    RS6000_BTI_unsigned_V2DI, RS6000_BTI_INTSI, +    ~RS6000_BTI_unsigned_long_long, 0 }, +  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V2DI,      RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_V2DI, 0 }, +  { ALTIVEC_BUILTIN_VEC_LDL, ALTIVEC_BUILTIN_LVXL_V2DI, +    RS6000_BTI_bool_V2DI, RS6000_BTI_INTSI, ~RS6000_BTI_bool_long_long, 0 }, +    { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL,      RS6000_BTI_unsigned_V16QI, RS6000_BTI_INTSI, ~RS6000_BTI_UINTQI, 0 },    { ALTIVEC_BUILTIN_VEC_LVSL, ALTIVEC_BUILTIN_LVSL, Index: gcc/testsuite/gcc.dg/vmx/ops-long-1.c =================================================================== --- gcc/testsuite/gcc.dg/vmx/ops-long-1.c    (revision 258800) +++ gcc/testsuite/gcc.dg/vmx/ops-long-1.c    (working copy) @@ -1,5 +1,6 @@  /* { dg-do compile } */ -/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mno-vsx -Wno-deprecated" } */ +/* { dg-require-effective-target vmx_hw } */ +/* { dg-options "-maltivec -mabi=altivec -std=gnu99 -mvsx -Wno-deprecated" } */  /* Checks from the original ops.c that pass pointers to long or     unsigned long for operations that support that in released versions @@ -10,6 +11,8 @@  extern int *var_int;  extern long * *var_long_ptr;  extern unsigned long * *var_unsigned_long_ptr; +extern long long int * *var_long_long_ptr; +extern unsigned long long int * *var_unsigned_long_long_ptr;  extern vector signed int * *var_vec_s32_ptr;  extern vector signed int *var_vec_s32;  extern vector unsigned char * *var_vec_u8_ptr; @@ -16,22 +19,25 @@ extern vector unsigned char * *var_vec_u8_ptr;  extern vector unsigned char *var_vec_u8;  extern vector unsigned int * *var_vec_u32_ptr;  extern vector unsigned int *var_vec_u32; +/* Use of long long int types requires -mvsx command-line option. */ +extern vector long long int *var_vec_s64; +extern vector unsigned long long int *var_vec_u64;  void f13() {    *var_vec_s32++ = vec_ld(var_int[0], var_long_ptr[1]);    *var_vec_s32++ = vec_lde(var_int[0], var_long_ptr[1]); -  *var_vec_s32++ = vec_ldl(var_int[0], var_long_ptr[1]); +  *var_vec_s64++ = vec_ldl(var_int[0], var_long_long_ptr[1]);    *var_vec_s32++ = vec_lvewx(var_int[0], var_long_ptr[1]);    *var_vec_s32++ = vec_lvx(var_int[0], var_long_ptr[1]); -  *var_vec_s32++ = vec_lvxl(var_int[0], var_long_ptr[1]); +  *var_vec_s64++ = vec_lvxl(var_int[0], var_long_long_ptr[1]);  }  void f22() {    *var_vec_u32++ = vec_ld(var_int[0], var_unsigned_long_ptr[1]);    *var_vec_u32++ = vec_lde(var_int[0], var_unsigned_long_ptr[1]); -  *var_vec_u32++ = vec_ldl(var_int[0], var_unsigned_long_ptr[1]); +  *var_vec_u64++ = vec_ldl(var_int[0], var_unsigned_long_long_ptr[1]);    *var_vec_u32++ = vec_lvewx(var_int[0], var_unsigned_long_ptr[1]);    *var_vec_u32++ = vec_lvx(var_int[0], var_unsigned_long_ptr[1]); -  *var_vec_u32++ = vec_lvxl(var_int[0], var_unsigned_long_ptr[1]); +  *var_vec_u64++ = vec_lvxl(var_int[0], var_unsigned_long_long_ptr[1]);  }  void f25() {    *var_vec_u8++ = vec_lvsl(var_int[0], var_long_ptr[1]); Index: gcc/testsuite/gcc.target/powerpc/vec-ldl-1.c =================================================================== --- gcc/testsuite/gcc.target/powerpc/vec-ldl-1.c (nonexistent) +++ gcc/testsuite/gcc.target/powerpc/vec-ldl-1.c    (revision 258889) @@ -0,0 +1,214 @@ +/* { dg-do run { target powerpc*-*-* } } */ +/* { dg-require-effective-target vmx_hw } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-options "-maltivec -O0 -Wall" } */ + +#include +#include + +/* vec_ldl and vec_lvxl (an alias for vec_ldl) do an aligned vector + * load from memory, marking the fetched memory as least recently used + * (hinting that we do not anticipate a need to fetch this vector + * again within the near future.) + * + * vector result = vec_ldl (int offset, *address) + * vector result = vec_ldl (int offset, vector *address) + * + * The effect of these instructions is to perform the following: + * + *  resuilt = *((vector *)((((char *) address) + offset) & ~0x0f)) + * + * This test exercises the following new prototypes of the vec_ldl + * service which were added in late March 2018: + * + *  vector bool int vec_ldl (int, bool int *) + *  vector bool short vec_ldl (int, bool short *) + *  vector pixel vec_ldl (int, pixel *) + *  vector bool char vec_ldl (int, bool char *) + *  vector double vec_ldl (int, double *) + *  vector long long int vec_ldl (int, long long int *) + *  vector unsigned long long int vec_ldl (int, unsigned long long int *) + *  vector bool long long vec_ldl (int, bool long long *) + */ + +static signed char ca[64] __attribute__((aligned(16))); +static unsigned char uca[64] __attribute__((aligned(16))); + +static vector signed char *vcp = (vector signed char *) ca; +static unsigned vector char *vucp = (vector unsigned char *) uca; + +static short sa[32] __attribute__((aligned(16))); +static unsigned short usa[32] __attribute__((aligned(16))); + +static vector short *vsp = (vector short *) sa; +static unsigned vector short *vusp = (vector unsigned short *) usa; + +static int ia[16] __attribute__((aligned(16))); +static unsigned int uia[16] __attribute__((aligned(16))); + +static vector int *vip = (vector int *) ia; +static unsigned vector int *vuip = (vector unsigned int *) uia; + +static long long la[8] __attribute__((aligned(16))); +static unsigned long long ula[8] __attribute__((aligned(16))); + +static vector long long *vlp = (vector long long *) la; +static unsigned vector long long *vulp = (vector unsigned long long *) ula; + +static double da[8] __attribute__((aligned(16))); + +static vector double *vdp = (vector double *) da; + + +void +doInitialization () +{ +  unsigned int i; + +  for (i = 0; i < 64; i++) +    ca[i] = uca[i] = i; + +  for (i = 0; i < 32; i++) +    sa[i] = usa[i] = i; + +  for (i = 0; i < 16; i++) +    ia[i] = uia[i] = i; + +  for (i = 0; i < 8; i++) +    la[i] = ula[i] = i; + +  for (i = 0; i < 8; i++) +    da[i] = 0.125 * i; +} + +int +main (int argc, char *argv[]) +{ +  vector long long int lv; +  vector unsigned long long int ulv; +  vector int iv; +  vector unsigned int uiv; +  vector short sv; +  vector unsigned short usv; +  vector signed char cv; +  vector unsigned char ucv; +  vector double dv; + +  doInitialization (); + +  /* Do vector of char.  */ +  for (int i = 0; i < 16; i++) { +    /* Focus on ca[16] ... ca[31].  */ +    cv = vec_ldl (i+16, ca);    /* compiler: invalid parameter combination */ +    if (cv[4] != ca[20]) +      abort (); +    /* Focus on uca[32] ... uca[47].  */ +    ucv = vec_ldl (i+32, uca); +    if (ucv[7] != uca[39]) +      abort (); +    /* Focus on ca[0] ... ca[15].  */ +    cv = vec_ldl (i, vcp); +    if (cv[3] != ca[3]) +      abort (); +    /* Focus on ca[0] ... ca[15] while i <= 8. +       Focus on ca[16] ... ca[31] while i > 8.  */ +    ucv = vec_ldl (i+7, vucp); +    if ((i+7 > 15) && (ucv[13] != uca[29])) +      abort (); +    if ((i + 7 <= 15) && (ucv[13] != uca[13])) +      abort (); +  } + +  /* Do vector of short.  */ +  for (int i = 0; i < 16; i++) { +    /* Focus on sa[8] ... sa[15].  */ +    sv = vec_ldl (i+16, sa); +    if (sv[4] != sa[12]) +      abort (); +    /* Focus on usa[24] ... usa[31].  */ +    usv = vec_ldl (i+48, usa); +    if (usv[7] != usa[31]) +      abort (); +    /* Focus on sa[0] ... sa[7].  */ +    sv = vec_ldl (i, vsp); +    if (sv[3] != sa[3]) +      abort (); +    /* Focus on usa[0] ... ca[7] while i <= 8. +       Focus on usa[8] ... ca[15] while i > .  */ +    usv = vec_ldl (i+7, vusp); +    if ((i+7 > 15) && (usv[5] != usa[13])) +      abort (); +    if ((i + 7 <= 15) && (usv[5] != usa[5])) +      abort (); +  } + +  /* Do vector of int.  */ +  for (int i = 0; i < 16; i++) { +    /* Focus on ia[8] ... ia[11].  */ +    iv = vec_ldl (i+32, ia); +    if (iv[3] != ia[11]) +      abort (); +    /* Focus on uia[12] ... uia[15].  */ +    uiv = vec_ldl (i+48, uia); +    if (uiv[2] != uia[14]) +      abort (); +    /* Focus on ia[0] ... ia[3].  */ +    iv = vec_ldl (i, vip); +    if (iv[3] != ia[3]) +      abort (); +    /* Focus on uia[0] ... uia[3] while i <= 8. +       Focus on uia[4] ... uia[7] while i > 8.  */ +    uiv = vec_ldl (i+7, vuip); +    if ((i+7 > 15) && (uiv[1] != uia[5])) +      abort (); +    if ((i + 7 <= 15) && (uiv[1] != uia[1])) +      abort (); +  } + +  /* Do vector of long long int.  */ +  for (int i = 0; i < 16; i++) { +    /* Focus on la[4] ... la[5].  */ +    lv = vec_ldl (i+32, la); +    if (lv[1] != la[5]) +      abort (); +    /* Focus on ula[6] ... ula[7].  */ +    ulv = vec_ldl (i+48, ula); +    if (ulv[0] != uia[6]) +      abort (); +    /* Focus on la[0] ... la[1].  */ +    lv = vec_ldl (i, vlp); +    if (iv[1] != la[1]) +      abort (); +    /* Focus on ula[0] ... uia[1] while i <= 8. +       Focus on uia[2] ... uia[3] while i > 8.  */ +    ulv = vec_ldl (i+7, vulp); +    if ((i+7 > 15) && (ulv[1] != ula[3])) +      abort (); +    if ((i + 7 <= 15) && (ulv[1] != ula[1])) +      abort (); +  } + +  /* Do vector of double.  */ +  for (int i = 0; i < 16; i++) { +    /* Focus on da[2] ... da[3].  */ +    dv = vec_ldl (i+16, da); +    if (dv[1] != da[3]) +      abort (); +    /* Focus on da[6] ... da[7].  */ +    dv = vec_ldl (i+48, vdp); +    if (dv[0] != da[6]) +      abort (); +    /* Focus on da[0] ... da[1].  */ +    dv = vec_ldl (i, da); +    if (dv[1] != da[1]) +      abort (); +    /* Focus on da[0] ... da[1] while i <= 8. +       Focus on da[2] ... da[3] while i > 8.  */ +    dv = vec_ldl (i+7, vdp); +    if ((i+7 <= 15) && (dv[1] != da[1])) +      abort (); +    if ((i + 7 > 15) && (dv[1] != da[3])) +      abort (); +  }