[PATCH] D68717: [Codegen] More add_sat and sub_sat promotion
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 11:08:06 PDT 2019
dmgreen marked an inline comment as done.
dmgreen added inline comments.
================
Comment at: llvm/test/CodeGen/X86/sadd_sat_vec.ll:496
+; SSE2-NEXT: psubb %xmm1, %xmm0
+; SSE2-NEXT: retq
+;
----------------
If we always went though the min/max pair, this would look like:
```
+; SSE2-NEXT: paddb %xmm1, %xmm0
+; SSE2-NEXT: movdqa {{.*#+}} xmm1 = [7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7]
+; SSE2-NEXT: movdqa %xmm1, %xmm2
+; SSE2-NEXT: pcmpgtb %xmm0, %xmm2
+; SSE2-NEXT: pand %xmm2, %xmm0
+; SSE2-NEXT: pandn %xmm1, %xmm2
+; SSE2-NEXT: por %xmm0, %xmm2
+; SSE2-NEXT: movdqa {{.*#+}} xmm1 = [248,248,248,248,248,248,248,248,248,248,248,248,248,
+; SSE2-NEXT: movdqa %xmm2, %xmm0
+; SSE2-NEXT: pcmpgtb %xmm1, %xmm0
+; SSE2-NEXT: pand %xmm0, %xmm2
+; SSE2-NEXT: pandn %xmm1, %xmm0
+; SSE2-NEXT: por %xmm2, %xmm0
+; SSE2-NEXT: retq
```
Which is a little larger.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68717/new/
https://reviews.llvm.org/D68717
More information about the llvm-commits
mailing list