public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/55752] New: __builtin_ia32_ldmxcsr / __builtin_ia32_stmxcsr are not scheduling barriers
@ 2012-12-20 12:35 rguenth at gcc dot gnu.org
  2012-12-20 12:59 ` [Bug target/55752] " ubizjak at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-20 12:35 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55752

             Bug #: 55752
           Summary: __builtin_ia32_ldmxcsr / __builtin_ia32_stmxcsr are
                    not scheduling barriers
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
            Target: x86_64-*-*


float foo (float x, float f32)
{
  unsigned int mxscr_stat;
  mxscr_stat = __builtin_ia32_stmxcsr ();
  __builtin_ia32_ldmxcsr (mxscr_stat | 0x00000800);
  f32 = (x + f32) - f32;
  mxscr_stat = mxscr_stat & 0xffffffc0;
  __builtin_ia32_ldmxcsr (mxscr_stat);
  return f32;
}

Compiled at O2 yields:

foo:
.LFB0:
        .cfi_startproc
        stmxcsr -4(%rsp)
        movl    -4(%rsp), %eax
        movl    %eax, %edx
        orb     $8, %dh
        movl    %edx, -4(%rsp)
        ldmxcsr -4(%rsp)
        addss   %xmm1, %xmm0
        andl    $-64, %eax
        movl    %eax, -4(%rsp)
        ldmxcsr -4(%rsp)
        subss   %xmm1, %xmm0
        ret

note how the subss is scheduled after the ldmxcsr call.

It's ok (by pure luck of course) at the GIMPLE level.


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

end of thread, other threads:[~2012-12-20 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20 12:35 [Bug target/55752] New: __builtin_ia32_ldmxcsr / __builtin_ia32_stmxcsr are not scheduling barriers rguenth at gcc dot gnu.org
2012-12-20 12:59 ` [Bug target/55752] " ubizjak at gmail dot com
2012-12-20 13:07 ` rguenther at suse dot de
2012-12-20 13:32 ` rguenth at gcc dot gnu.org

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).