public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104978] New: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch
@ 2022-03-18 12:21 crazylht at gmail dot com
  2022-03-18 12:37 ` [Bug target/104978] " crazylht at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: crazylht at gmail dot com @ 2022-03-18 12:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104978

            Bug ID: 104978
           Summary: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---

#include<immintrin.h>
__m128h
foo (__m128h a, __m128h b, __m128h c, __mmask8 m)
{ 
    return _mm_mask_fcmadd_round_sch (a, m, b, c, 8);
}


_Z3fooDv8_DF16_S_S_h:
        kmovd   k1, edi
        vfcmaddcsh      xmm2{k1}, xmm0, xmm1, {rn-sae}
        vmovaps xmm0{k1}, xmm2
        ret

k1 must & 1 before vmovaps xmm0{k1}, xmm2.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104978] [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch
  2022-03-18 12:21 [Bug target/104978] New: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch crazylht at gmail dot com
@ 2022-03-18 12:37 ` crazylht at gmail dot com
  2022-03-18 12:52 ` crazylht at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: crazylht at gmail dot com @ 2022-03-18 12:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104978

--- Comment #1 from Hongtao.liu <crazylht at gmail dot com> ---
Similar for _mm_mask_fmadd_round_sch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104978] [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch
  2022-03-18 12:21 [Bug target/104978] New: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch crazylht at gmail dot com
  2022-03-18 12:37 ` [Bug target/104978] " crazylht at gmail dot com
@ 2022-03-18 12:52 ` crazylht at gmail dot com
  2022-03-18 12:57 ` crazylht at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: crazylht at gmail dot com @ 2022-03-18 12:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104978

--- Comment #2 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Hongtao.liu from comment #0)
> #include<immintrin.h>
> __m128h
> foo (__m128h a, __m128h b, __m128h c, __mmask8 m)
> { 
>     return _mm_mask_fcmadd_round_sch (a, m, b, c, 8);
> }
> 
> 
> _Z3fooDv8_DF16_S_S_h:
>         kmovd   k1, edi
>         vfcmaddcsh      xmm2{k1}, xmm0, xmm1, {rn-sae}
>         vmovaps xmm0{k1}, xmm2
>         ret
> 
> k1 must & 1 before vmovaps xmm0{k1}, xmm2.

Or just vmovaps xmm0, xmm2 since vfcmaddcsh will copy upper [32:128] from
src1(xmm0) here.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104978] [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch
  2022-03-18 12:21 [Bug target/104978] New: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch crazylht at gmail dot com
  2022-03-18 12:37 ` [Bug target/104978] " crazylht at gmail dot com
  2022-03-18 12:52 ` crazylht at gmail dot com
@ 2022-03-18 12:57 ` crazylht at gmail dot com
  2022-03-22  3:48 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: crazylht at gmail dot com @ 2022-03-18 12:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104978

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Hongtao.liu from comment #2)
> (In reply to Hongtao.liu from comment #0)
> > #include<immintrin.h>
> > __m128h
> > foo (__m128h a, __m128h b, __m128h c, __mmask8 m)
> > { 
> >     return _mm_mask_fcmadd_round_sch (a, m, b, c, 8);
> > }
> > 
> > 
> > _Z3fooDv8_DF16_S_S_h:
> >         kmovd   k1, edi
> >         vfcmaddcsh      xmm2{k1}, xmm0, xmm1, {rn-sae}
> >         vmovaps xmm0{k1}, xmm2
> >         ret
> > 
> > k1 must & 1 before vmovaps xmm0{k1}, xmm2.
> 
> Or just vmovaps xmm0, xmm2 since vfcmaddcsh will copy upper [32:128] from
> src1(xmm0) here.

No, intrinsic guide it using writemask k (elements are copied from a when mask
bit 0 is not set)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104978] [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch
  2022-03-18 12:21 [Bug target/104978] New: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch crazylht at gmail dot com
                   ` (2 preceding siblings ...)
  2022-03-18 12:57 ` crazylht at gmail dot com
@ 2022-03-22  3:48 ` cvs-commit at gcc dot gnu.org
  2022-03-22  3:49 ` wwwhhhyyy333 at gmail dot com
  2022-03-22  9:41 ` crazylht at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-22  3:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104978

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hongyu Wang <hongyuw@gcc.gnu.org>:

https://gcc.gnu.org/g:7bce0be03b857eefe5990c3ef0af06ea8f8ae04e

commit r12-7747-g7bce0be03b857eefe5990c3ef0af06ea8f8ae04e
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Sat Mar 19 01:16:29 2022 +0800

    AVX512FP16: Fix wrong code for _mm_mask_f[c]madd.*sch [PR 104978]

    For complex scalar intrinsic like _mm_mask_fcmadd_sch, the
    mask should be and by 1 to ensure the mask is bind to lowest byte.
    Use masked vmovss to perform same operation which omits higher bits
    of mask.

    gcc/ChangeLog:

            PR target/104978
            * config/i386/sse.md
            (avx512fp16_fmaddcsh_v8hf_mask1<round_expand_name):
            Use avx512f_movsf_mask instead of vmovaps or vblend, and
            force_reg before lowpart_subreg.
            (avx512fp16_fcmaddcsh_v8hf_mask1<round_expand_name): Likewise.

    gcc/testsuite/ChangeLog:

            PR target/104978
            * gcc.target/i386/avx512fp16-vfcmaddcsh-1a.c: Adjust asm scan.
            * gcc.target/i386/avx512fp16-vfmaddcsh-1a.c: Ditto.
            * gcc.target/i386/avx512fp16-vfcmaddcsh-1c.c: Removed.
            * gcc.target/i386/avx512fp16-vfmaddcsh-1c.c: Ditto.
            * gcc.target/i386/pr104978.c: New test.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104978] [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch
  2022-03-18 12:21 [Bug target/104978] New: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch crazylht at gmail dot com
                   ` (3 preceding siblings ...)
  2022-03-22  3:48 ` cvs-commit at gcc dot gnu.org
@ 2022-03-22  3:49 ` wwwhhhyyy333 at gmail dot com
  2022-03-22  9:41 ` crazylht at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2022-03-22  3:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104978

--- Comment #5 from Hongyu Wang <wwwhhhyyy333 at gmail dot com> ---
Fixed for GCC 12.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104978] [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch
  2022-03-18 12:21 [Bug target/104978] New: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch crazylht at gmail dot com
                   ` (4 preceding siblings ...)
  2022-03-22  3:49 ` wwwhhhyyy333 at gmail dot com
@ 2022-03-22  9:41 ` crazylht at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: crazylht at gmail dot com @ 2022-03-22  9:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104978

Hongtao.liu <crazylht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #6 from Hongtao.liu <crazylht at gmail dot com> ---
.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-22  9:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 12:21 [Bug target/104978] New: [avx512fp16] wrong code for _mm_mask_fcmadd_round_sch crazylht at gmail dot com
2022-03-18 12:37 ` [Bug target/104978] " crazylht at gmail dot com
2022-03-18 12:52 ` crazylht at gmail dot com
2022-03-18 12:57 ` crazylht at gmail dot com
2022-03-22  3:48 ` cvs-commit at gcc dot gnu.org
2022-03-22  3:49 ` wwwhhhyyy333 at gmail dot com
2022-03-22  9:41 ` crazylht at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).