[PATCH] D28016: [Builtins] [ARM] Adding Thumb1 support for fcmp

Weiming Zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 28 00:32:44 PST 2016


weimingz added inline comments.


================
Comment at: lib/builtins/arm/comparesf2.S:253
+    movs    r0,         #1
+    1:
+#else
----------------
compnerd wrote:
> Hmm, won't this possibly execute both sides of the `ITE` which the T2 path doesnt do IIRC.  Shouldnt we write this as:
> 
>       bhi 1f
>       cmp r3, r1
>       b 2f
>     1:
>       movs r0, #1
>       @ b 2f @ for symmetry
>     2:
> 
The original code is not an "if-else". the "cmpls" will update the flags as well. It's a short-circuited comparison like "  r0 = (r2 < 0xff0000000 || r3 < 0xff000000) ? r0 : 1


https://reviews.llvm.org/D28016





More information about the llvm-commits mailing list