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

            Bug ID: 126933
           Summary: FAIL: gcc.target/i386/truncsfbf-2.c execution test
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
            Blocks: 126927
  Target Milestone: ---
            Target: x86

On x86-64, when AVX512BF16 is enabled by default, I got

FAIL: gcc.target/i386/truncsfbf-2.c execution test

The codegen differences for

__bf16
foo (float a)
{
  return a;
}

are

Dump of assembler code for function foo:
   0x0000000000401166 <+0>:     push   %rbp
   0x0000000000401167 <+1>:     mov    %rsp,%rbp
   0x000000000040116a <+4>:     movss  %xmm0,-0x4(%rbp)
   0x000000000040116f <+9>:     movss  -0x4(%rbp),%xmm0
   0x0000000000401174 <+14>:    psrld  $0x10,%xmm0
   0x0000000000401179 <+19>:    movd   %xmm0,%eax
   0x000000000040117d <+23>:    movd   %eax,%xmm0
   0x0000000000401181 <+27>:    pop    %rbp
   0x0000000000401182 <+28>:    ret
End of assembler dump.

vs

Dump of assembler code for function foo:
   0x0000000000401166 <+0>:     push   %rbp
   0x0000000000401167 <+1>:     mov    %rsp,%rbp
   0x000000000040116a <+4>:     vmovss %xmm0,-0x4(%rbp)
   0x000000000040116f <+9>:     vmovss -0x4(%rbp),%xmm0
   0x0000000000401174 <+14>:    vcvtneps2bf16 %xmm0,%xmm0
   0x000000000040117a <+20>:    vmovd  %xmm0,%eax
   0x000000000040117e <+24>:    vmovd  %eax,%xmm0
   0x0000000000401182 <+28>:    pop    %rbp
   0x0000000000401183 <+29>:    ret
End of assembler dump.

For the float value of 1e-8f, vcvtneps2bf16 generates 1.001e-08 while
GCC emulation generates 9.954e-09.  Should GCC emulation generate
1.001e-08?


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126927
[Bug 126927] FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c

Reply via email to