summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/README.txt
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2010-07-26 21:48:35 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2010-07-26 21:48:35 +0000
commit25a6ab0144f5e206729cb38da654c256d1672aac (patch)
treea6d3f6dd86b4e200d2e7462fb1194e443df4e4f3 /lib/Target/ARM/README.txt
parent72eb3007150837e4996485457ff120e3ad1c10fa (diff)
downloadllvm-25a6ab0144f5e206729cb38da654c256d1672aac.tar.gz
llvm-25a6ab0144f5e206729cb38da654c256d1672aac.tar.bz2
llvm-25a6ab0144f5e206729cb38da654c256d1672aac.tar.xz
Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109448 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/README.txt')
-rw-r--r--lib/Target/ARM/README.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Target/ARM/README.txt b/lib/Target/ARM/README.txt
index ba4e5da5a0..c31f22766a 100644
--- a/lib/Target/ARM/README.txt
+++ b/lib/Target/ARM/README.txt
@@ -636,3 +636,24 @@ A custom Thumb version would also be a slight improvement over the generic
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.
+
+//===---------------------------------------------------------------------===//
+