From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 70016 invoked by alias); 29 Sep 2018 16:29:32 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 69867 invoked by uid 89); 29 Sep 2018 16:29:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=da, sx, dx, 75 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 29 Sep 2018 16:29:29 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6569AC049D53; Sat, 29 Sep 2018 16:29:28 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-82.ams2.redhat.com [10.36.116.82]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A0FA60C5F; Sat, 29 Sep 2018 16:29:27 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w8TGTPWt004277; Sat, 29 Sep 2018 18:29:26 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w8TGTOEY004276; Sat, 29 Sep 2018 18:29:24 +0200 Date: Sat, 29 Sep 2018 16:36:00 -0000 From: Jakub Jelinek To: Uros Bizjak , Kirill Yukhin Cc: gcc-patches@gcc.gnu.org Subject: [committed] Fix _mm512_{,mask_}abs_pd (PR target/87467) Message-ID: <20180929162924.GP8250@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg01768.txt.bz2 Hi! These two functions were copied from their _mm512_*abs_ps counterparts and weren't fully adjusted, plus avx512f-abspd-1.c testcase was identical to avx512f-absps-1.c and thus nothing caught this up in the testsuite. Sorry for that. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, committed to trunk, 8 and 7 branches as obvious. 2018-09-29 Jakub Jelinek PR target/87467 * config/i386/avx512fintrin.h (_mm512_abs_pd, _mm512_mask_abs_pd): Use __m512d type for __A argument rather than __m512. * gcc.target/i386/avx512f-abspd-1.c (SIZE): Divide by two. (CALC): Use double instead of float. (TEST): Adjust to test _mm512_abs_pd and _mm512_mask_abs_pd rather than _mm512_abs_ps and _mm512_mask_abs_ps. --- gcc/config/i386/avx512fintrin.h.jj 2018-07-11 22:55:44.660456510 +0200 +++ gcc/config/i386/avx512fintrin.h 2018-09-29 10:29:46.731170222 +0200 @@ -7798,7 +7798,7 @@ _mm512_mask_abs_ps (__m512 __W, __mmask1 extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_abs_pd (__m512 __A) +_mm512_abs_pd (__m512d __A) { return (__m512d) _mm512_and_epi64 ((__m512i) __A, _mm512_set1_epi64 (0x7fffffffffffffffLL)); @@ -7806,7 +7806,7 @@ _mm512_abs_pd (__m512 __A) extern __inline __m512d __attribute__ ((__gnu_inline__, __always_inline__, __artificial__)) -_mm512_mask_abs_pd (__m512d __W, __mmask8 __U, __m512 __A) +_mm512_mask_abs_pd (__m512d __W, __mmask8 __U, __m512d __A) { return (__m512d) _mm512_mask_and_epi64 ((__m512i) __W, __U, (__m512i) __A, --- gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c.jj 2017-04-07 21:20:58.092845868 +0200 +++ gcc/testsuite/gcc.target/i386/avx512f-abspd-1.c 2018-09-29 10:25:59.062006644 +0200 @@ -6,11 +6,11 @@ #include "avx512f-helper.h" -#define SIZE (AVX512F_LEN / 32) +#define SIZE (AVX512F_LEN / 64) #include "avx512f-mask-type.h" static void -CALC (float *i1, float *r) +CALC (double *i1, double *r) { int i; @@ -24,27 +24,27 @@ CALC (float *i1, float *r) void TEST (void) { - float ck[SIZE]; + double ck[SIZE]; int i; - UNION_TYPE (AVX512F_LEN, ) s, d, dm; + UNION_TYPE (AVX512F_LEN, d) s, d, dm; MASK_TYPE mask = MASK_VALUE; for (i = 0; i < SIZE; i++) { - s.a[i] = i * ((i & 1) ? 3.5f : -7.5f); + s.a[i] = i * ((i & 1) ? 3.5 : -7.5); d.a[i] = DEFAULT_VALUE; dm.a[i] = DEFAULT_VALUE; } CALC (s.a, ck); - d.x = INTRINSIC (_abs_ps) (s.x); - dm.x = INTRINSIC (_mask_abs_ps) (dm.x, mask, s.x); + d.x = INTRINSIC (_abs_pd) (s.x); + dm.x = INTRINSIC (_mask_abs_pd) (dm.x, mask, s.x); - if (UNION_CHECK (AVX512F_LEN, ) (d, ck)) + if (UNION_CHECK (AVX512F_LEN, d) (d, ck)) abort (); - MASK_MERGE () (ck, mask, SIZE); - if (UNION_CHECK (AVX512F_LEN, ) (dm, ck)) + MASK_MERGE (d) (ck, mask, SIZE); + if (UNION_CHECK (AVX512F_LEN, d) (dm, ck)) abort (); } Jakub