diff --git a/lib/Target/ARM/README.txt b/lib/Target/ARM/README.txt index ba4e5da5a05..c31f22766af 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. + +//===---------------------------------------------------------------------===// +