From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) by sourceware.org (Postfix) with ESMTPS id 0D9583858D28 for ; Fri, 7 Jan 2022 20:51:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0D9583858D28 Received: by mail-ua1-x92b.google.com with SMTP id y4so12461238uad.1 for ; Fri, 07 Jan 2022 12:51:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0M8RO+4o9iVX+s+cdH1H3conPt/KHIaYLNJ3aBQfzJo=; b=QPOOHIQvpAhJkDNp60i1ytbPotWnSTVQxf9M+ITAynAPHTaRoyUQpRnB4mcAVqktXQ L/At6fht93/71MXIwuGknYjN81YmRnNnUPCD2gLiT4lt89vNIU8LZIyiWF9ojSLZJ1HG BgUJNk5psLdPaWrV8ssiew3FSp+xagZobCON1eLaetpfFfMDgfC7P92PGdJM7kw2cT8w iYUZRA2ajN3DSeoRxRIJbMfkkqFMwQBovC/dnlTT0rhEJoRIbsPSrH5acpPrGYbMzheZ YFMXTCnC5B1kPkjhl7xbPCHNpiay6lcVfpGeJEpYD64p/Ya5W8q9hepvW2qJ3sjNuIE/ B0rw== X-Gm-Message-State: AOAM532LhRTkFf1pCGpDu8lR2N9F6xSN6sZsYmTIrRFP1af7mqfd+crn enECHci00wbxi37475oOcj131dF2rGuOy5PvRkk= X-Google-Smtp-Source: ABdhPJznXGcrTszQBFB93zQpcm/lPZREilCt02rGHA1jC9FDTglcEwGKCAhSNBmrA/lmteMS0kKTk+WB82L8jAEjoHU= X-Received: by 2002:a67:cb0d:: with SMTP id b13mr21732060vsl.81.1641588663498; Fri, 07 Jan 2022 12:51:03 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: David Edelsohn Date: Fri, 7 Jan 2022 15:50:52 -0500 Message-ID: Subject: Re: [PATCH] rs6000: Add Power10 optimization for _mm_blendv* To: "Paul A. Clarke" Cc: Segher Boessenkool , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2022 20:51:06 -0000 On Fri, Jan 7, 2022 at 3:32 PM Paul A. Clarke wrote: > > On Fri, Jan 07, 2022 at 02:15:22PM -0500, David Edelsohn wrote: > > > Power10 ISA added `xxblendv*` instructions which are realized in the > > > `vec_blendv` instrinsic. > > > > > > Use `vec_blendv` for `_mm_blendv_epi8`, `_mm_blendv_ps`, and > > > `_mm_blendv_pd` compatibility intrinsics, when `_ARCH_PWR10`. > > > > > > Also, copy a test from i386 for testing `_mm_blendv_ps`. > > > This should have come with commit ed04cf6d73e233c74c4e55c27f1cbd89ae4710e8, > > > but was inadvertently omitted. > > > > > > 2021-10-20 Paul A. Clarke > > > > > > gcc > > > * config/rs6000/smmintrin.h (_mm_blendv_epi8): Use vec_blendv > > > when _ARCH_PWR10. > > > (_mm_blendv_ps): Likewise. > > > (_mm_blendv_pd): Likewise. > > > > > > gcc/testsuite > > > * gcc.target/powerpc/sse4_1-blendvps.c: Copy from gcc.target/i386, > > > adjust dg directives to suit. > > > --- > > > Tested on Power10 powerpc64le-linux (compiled with and without > > > `-mcpu=power10`). > > > > > > OK for trunk? > > > > This is okay modulo > > > > > + return (__m128i) vec_blendv ((__v16qu) __A, (__v16qu) __B, (__v16qu) __mask); > > > > Should the above be __v16qi like x86? > > That does arguably match the types involved (epi8) better. > > Shall I change the original implementation as well (4 lines later)? > > > return (__m128i) vec_sel ((__v16qi) __A, (__v16qi) __B, __lmask); vec_blendv supports the signed type, so it seems that the function should use that type, unless unsigned is preferred because PowerPC defaults to unsigned char. I wasn't going to recommend changing the existing code because I don't know how the signed type interacts with the other builtins. Thanks, David