]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libitm: Avoid non-portable x86 branch prediction mnemonic.
authorRichard Henderson <rth@redhat.com>
Wed, 9 Nov 2011 19:51:49 +0000 (11:51 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 9 Nov 2011 19:51:49 +0000 (11:51 -0800)
From-SVN: r181233

libitm/ChangeLog
libitm/config/x86/cacheline.h

index e78716d2a378f864c455b2fc95bb6b786faa23c6..0501d168a23e1b08497b9f19c64d71c36dccb861 100644 (file)
@@ -1,5 +1,8 @@
 2011-11-09  Richard Henderson  <rth@redhat.com>
 
+       * config/x86/cacheline.h (gtm_cacheline::store_mask): Use .byte
+       to emit branch prediction hint.
+
        * config/x86/sjlj.S: Protect elf directives with __ELF__.
        Protect .note.GNU-stack with __linux__.
 
index 15a95b0be5bd537701f4bcac4ea39b5bbbe9c335..f91d7ccb8020235973a5aca1b320d489176d4caf 100644 (file)
@@ -144,7 +144,7 @@ gtm_cacheline::operator= (const gtm_cacheline & __restrict s)
 }
 #endif
 
-// ??? Support masked integer stores more efficiently with an unlocked cmpxchg
+// Support masked integer stores more efficiently with an unlocked cmpxchg
 // insn.  My reasoning is that while we write to locations that we do not wish
 // to modify, we do it in an uninterruptable insn, and so we either truely
 // write back the original data or the insn fails -- unlike with a
@@ -171,7 +171,8 @@ gtm_cacheline::store_mask (uint32_t *d, uint32_t s, uint8_t m)
                "and    %[m], %[n]\n\t"
                "or     %[s], %[n]\n\t"
                "cmpxchg %[n], %[d]\n\t"
-               "jnz,pn 0b"
+               ".byte  0x2e\n\t"       // predict not-taken, aka jnz,pn
+               "jnz    0b"
                : [d] "+m"(*d), [n] "=&r" (n), [o] "+a"(o)
                : [s] "r" (s & bm), [m] "r" (~bm));
        }
@@ -198,7 +199,8 @@ gtm_cacheline::store_mask (uint64_t *d, uint64_t s, uint8_t m)
                "and    %[m], %[n]\n\t"
                "or     %[s], %[n]\n\t"
                "cmpxchg %[n], %[d]\n\t"
-               "jnz,pn 0b"
+               ".byte  0x2e\n\t"       // predict not-taken, aka jnz,pn
+               "jnz    0b"
                : [d] "+m"(*d), [n] "=&r" (n), [o] "+a"(o)
                : [s] "r" (s & bm), [m] "r" (~bm));
 #else