Add a note.
authorBill Wendling <isanbard@gmail.com>
Tue, 27 Oct 2009 22:34:43 +0000 (22:34 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 27 Oct 2009 22:34:43 +0000 (22:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85329 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README.txt

index 046d35ce5b69dc156f86ce915f276a5d4a7d0dc4..5967fd55c09b4d54a00b13c83e70e274c20e73c2 100644 (file)
@@ -1952,3 +1952,26 @@ fact these instructions are identical to the non-lock versions. We need a way to
 add target specific information to target nodes and have this information
 carried over to machine instructions. Asm printer (or JIT) can use this
 information to add the "lock" prefix.
+
+//===---------------------------------------------------------------------===//
+
+int func(int a, int b) { if (a & 0x80) b |= 0x80; else b &= 0x80; return b; }
+
+Current:
+
+        movb    %sil, %al
+        andb    $-128, %sil
+        orb     $-128, %al
+        testb   %dil, %dil
+        js      LBB1_2
+        movb    %sil, %al
+LBB1_2:
+        movsbl  %al, %eax
+
+Better:
+        movl    %esi, %eax
+        orl     $-128, %eax
+        andl    $-128, %esi
+        testb   %dil, %dil
+        cmovns  %esi, %eax
+        movsbl  %al,%eax