From patchwork Mon Oct 22 18:29:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 987844 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-488051-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="rmqUkplb"; 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 42f4mr5ljTz9sCh for ; Tue, 23 Oct 2018 05:29:32 +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=mgq0w niri7xQgSUq1dIQ8oMoWXwIkoTl/FaoSoHbTqMMyVjmPqbSNaUYHACGXsIK3QuRt qoNsepfG2KW4H3hAY6iYK3imVVTtyOvurHfmgqpuFwog9GAjLMucyzXxKs7dehMs Afx/1a7OoivIfLyS13vlkGIDTAeXviN0D/idEQ= 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=C/FoFNbQ1N6 zIz1zqkWFkwNzrvY=; b=rmqUkplbNcaO/ClkRZj5Ah2mm+wc8HnPnEZB5MifQ2U VVbsxW9L2p0btSPwkwNI8m/cIaAyTIInyrcdwSdDk9lNYoqiRh/TznN6QSx9wI/n v+K57ctdrvU8KoWohYeCey5X8XD9K026kSbZr75Rjzof64qlnqbV2Va3rXLhOEUg = Received: (qmail 107141 invoked by alias); 22 Oct 2018 18:29:25 -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 106417 invoked by uid 89); 22 Oct 2018 18:29:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW, SPF_PASS 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; Mon, 22 Oct 2018 18:29:23 +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 w9MINwF6115963 for ; Mon, 22 Oct 2018 14:29:21 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0b-001b2d01.pphosted.com with ESMTP id 2n9kqy8b9g-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 22 Oct 2018 14:29:21 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 22 Oct 2018 12:29:19 -0600 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 22 Oct 2018 12:29:16 -0600 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w9MITFCk66322682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 22 Oct 2018 11:29:15 -0700 Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C309778064; Mon, 22 Oct 2018 18:29:15 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8FDEB7805F; Mon, 22 Oct 2018 18:29:15 +0000 (GMT) Received: from bigmac.rchland.ibm.com (unknown [9.10.86.17]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 22 Oct 2018 18:29:15 +0000 (GMT) To: GCC Patches Cc: Segher Boessenkool From: Bill Schmidt Subject: [PATCH, rs6000] Use explicit casts for vec_sel argument 3 in intrinsic headers Date: Mon, 22 Oct 2018 13:29:15 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 x-cbid: 18102218-0036-0000-0000-00000A4FBDC7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009917; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000268; SDB=6.01106445; UDB=6.00572979; IPR=6.00886529; MB=3.00023860; MTD=3.00000008; XFM=3.00000015; UTC=2018-10-22 18:29:17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18102218-0037-0000-0000-00004960C79A Message-Id: Hi, The vec_sel intrinsic is overloaded for multiple types. There are a couple of cases in our intrinsic compatibility headers where the types used don't match any allowable type signature. GCC is able to correctly infer which matching built-in function is meant, but not all compilers can. For compatibility, cast the third parameter correctly in the source code. Bootstrapped and tested on powerpc64le-linux-gnu with no regressions. Is this okay for trunk? Thanks, Bill 2018-10-22 Bill Schmidt Jinsong Ji * config/rs6000/emmintrin.h (_mm_sll_epi64): Explicitly cast third argument of vec_sel to vector unsigned long long. * config/rs6000/xmmintrin.h (_mm_min_ps): Explicitly cast third argument of vec_sel to vector unsigned int. Index: gcc/config/rs6000/emmintrin.h =================================================================== --- gcc/config/rs6000/emmintrin.h (revision 265389) +++ gcc/config/rs6000/emmintrin.h (working copy) @@ -1766,7 +1766,7 @@ _mm_sll_epi64 (__m128i __A, __m128i __B) shmask = lshift < shmax; result = vec_vsld ((__v2du) __A, lshift); result = (__v2du) vec_sel ((__v2df) shmask, (__v2df) result, - (__v2df) shmask); + (vector unsigned long long) shmask); return (__m128i) result; } Index: gcc/config/rs6000/xmmintrin.h =================================================================== --- gcc/config/rs6000/xmmintrin.h (revision 265389) +++ gcc/config/rs6000/xmmintrin.h (working copy) @@ -458,7 +458,7 @@ extern __inline __m128 __attribute__((__gnu_inline _mm_min_ps (__m128 __A, __m128 __B) { __m128 m = (__m128) vec_vcmpgtfp ((__v4sf) __B, (__v4sf) __A); - return vec_sel (__B, __A, m); + return vec_sel (__B, __A, (vector unsigned int)m); } extern __inline __m128 __attribute__((__gnu_inline__, __always_inline__, __artificial__))