diff options
| author | Pablo Barrio <pablo.barrio@arm.com> | 2018-01-31 13:20:10 +0000 |
|---|---|---|
| committer | Pablo Barrio <pablo.barrio@arm.com> | 2018-01-31 13:20:10 +0000 |
| commit | 2e442a78312036309f53cb915c2c6a8c295b6575 (patch) | |
| tree | 16cc7957e99ea0e726f9a4b6dead7d72f82fee6e /llvm/test/CodeGen/Thumb/select.ll | |
| parent | 99dbec52bec36ce0a93e27311f39eca65b8f166c (diff) | |
| download | bcm5719-llvm-2e442a78312036309f53cb915c2c6a8c295b6575.tar.gz bcm5719-llvm-2e442a78312036309f53cb915c2c6a8c295b6575.zip | |
[ARM] Lower lower saturate to 0 and lower saturate to -1 using bit-operations
Summary:
Expressions of the form x < 0 ? 0 : x; and x < -1 ? -1 : x can be lowered using bit-operations instead of branching or conditional moves
In thumb-mode this results in a two-instruction sequence, a shift followed by a bic or or while in ARM/thumb2 mode that has flexible second operand the shift can be folded into a single bic/or instructions. In most cases this results in smaller code and possibly less branches, and in no case larger than before.
Patch by Marten Svanfeldt.
Reviewers: fhahn, pbarrio
Reviewed By: pbarrio
Subscribers: efriedma, rogfer01, aemerson, javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D42574
llvm-svn: 323869
Diffstat (limited to 'llvm/test/CodeGen/Thumb/select.ll')
| -rw-r--r-- | llvm/test/CodeGen/Thumb/select.ll | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/CodeGen/Thumb/select.ll b/llvm/test/CodeGen/Thumb/select.ll index 75dbeab5ad0..91d0453304c 100644 --- a/llvm/test/CodeGen/Thumb/select.ll +++ b/llvm/test/CodeGen/Thumb/select.ll @@ -73,8 +73,8 @@ define double @f7(double %a, double %b) { ret double %tmp1 } ; CHECK-LABEL: f7: -; CHECK: blt -; CHECK: {{blt|bge}} +; CHECK: bge +; CHECK: bic ; CHECK: __ltdf2 ; CHECK-EABI-LABEL: f7: ; CHECK-EABI: __aeabi_dcmplt |

