[llvm-commits] [llvm] r109448 - /llvm/trunk/lib/Target/ARM/README.txt
Anton Korobeynikov
asl at math.spbu.ru
Mon Jul 26 14:48:36 PDT 2010
Author: asl
Date: Mon Jul 26 16:48:35 2010
New Revision: 109448
URL: http://llvm.org/viewvc/llvm-project?rev=109448&view=rev
Log:
Add a note
Modified:
llvm/trunk/lib/Target/ARM/README.txt
Modified: llvm/trunk/lib/Target/ARM/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/README.txt?rev=109448&r1=109447&r2=109448&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/README.txt (original)
+++ llvm/trunk/lib/Target/ARM/README.txt Mon Jul 26 16:48:35 2010
@@ -636,3 +636,24 @@
version.
//===---------------------------------------------------------------------===//
+
+Consider the following simple C code:
+
+void foo(unsigned char *a, unsigned char *b, int *c) {
+ if ((*a | *b) == 0) *c = 0;
+}
+
+currently llvm-gcc generates something like this (nice branchless code I'd say):
+
+    ldrb   r0, [r0]
+    ldrb   r1, [r1]
+    orr   r0, r1, r0
+    tst   r0, #255
+    moveq  r0, #0
+    streq  r0, [r2]
+    bx    lr
+
+Note that both "tst" and "moveq" are redundant.
+
+//===---------------------------------------------------------------------===//
+
More information about the llvm-commits
mailing list