From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20165 invoked by alias); 13 Feb 2014 12:55:28 -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 20156 invoked by uid 89); 13 Feb 2014 12:55:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-oa0-f45.google.com Received: from mail-oa0-f45.google.com (HELO mail-oa0-f45.google.com) (209.85.219.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 13 Feb 2014 12:55:26 +0000 Received: by mail-oa0-f45.google.com with SMTP id i11so12727874oag.32 for ; Thu, 13 Feb 2014 04:55:25 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.119.73 with SMTP id ks9mr1043343oeb.45.1392296124929; Thu, 13 Feb 2014 04:55:24 -0800 (PST) Received: by 10.182.137.136 with HTTP; Thu, 13 Feb 2014 04:55:24 -0800 (PST) In-Reply-To: References: <20140213104430.GA42503@msticlxl57.ims.intel.com> Date: Thu, 13 Feb 2014 12:55:00 -0000 Message-ID: Subject: Re: [PATCH i386 13/8] [AVX-512] Fix argument order for perm and recp intrinsics. From: Uros Bizjak To: Kirill Yukhin Cc: Jakub Jelinek , GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-02/txt/msg00835.txt.bz2 On Thu, Feb 13, 2014 at 1:37 PM, Uros Bizjak wrote: >> I've noticed that _mm512_permutexvar_epi[64|32] intrinsics >> have wrong arguments order. As per [1] first argument is index. >> For vmpermps/vpermpd intrinsics are fine, but I've changed tests >> to call CALC with same arg order as intrinsic. here is the same >> problem (wrong argument order) with vrcp14s[d|s]. >> Also avx512er-vrcp28ss-2.c test called wrong intrinsic. >> >> [1] http://software.intel.com/sites/landingpage/IntrinsicsGuide/ >> >> gcc/ >> * config/i386/avx512fintrin.h (_mm512_maskz_permutexvar_epi64): Swap >> arguments order in builtin. >> (_mm512_permutexvar_epi64): Ditto. >> (_mm512_mask_permutexvar_epi64): Ditto >> (_mm512_maskz_permutexvar_epi32): Ditto >> (_mm512_permutexvar_epi32): Ditto >> (_mm512_mask_permutexvar_epi32): Ditto >> * config/i386/sse.md (srcp14): Swap operands. >> >> gcc/testsuite/ >> * gcc.target/i386/avx512er-vrcp28ss-2.c: Call rigth intrinsic. >> * gcc.target/i386/avx512f-vpermd-2.c: Fix reference calculations. >> * gcc.target/i386/avx512f-vpermpd-2.c: Ditto. >> * gcc.target/i386/avx512f-vpermps-2.c: Ditto. >> * gcc.target/i386/avx512f-vpermq-var-2.c: Ditto. >> * gcc.target/i386/avx512f-vrcp14sd-2.c: Ditto. >> * gcc.target/i386/avx512f-vrcp14ss-2.c: Ditto. >> >> diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md >> index a04b289..d3b2dc5 100644 >> --- a/gcc/config/i386/sse.md >> +++ b/gcc/config/i386/sse.md >> @@ -1456,12 +1456,12 @@ >> [(set (match_operand:VF_128 0 "register_operand" "=v") >> (vec_merge:VF_128 >> (unspec:VF_128 >> - [(match_operand:VF_128 1 "nonimmediate_operand" "vm")] >> + [(match_operand:VF_128 2 "nonimmediate_operand" "vm")] >> UNSPEC_RCP14) >> - (match_operand:VF_128 2 "register_operand" "v") >> + (match_operand:VF_128 1 "register_operand" "v") >> (const_int 1)))] >> "TARGET_AVX512F" >> - "vrcp14\t{%1, %2, %0|%0, %2, %1}" >> + "vrcp14\t{%2, %1, %0|%0, %1, %2}" > > Please don't change srcp pattern, it should be defined similar to > vrcpss (aka sse_vmrcpv4sf). You need to switch operand order > elsewhere. No, you are correct. Operands should be swapped as in your patch. The patch is OK for mainline. Thanks, Uros.