llvm-project/llvm/test/CodeGen
Richard Sandiford a59012577c [SystemZ] Fix sign of integer memcmp result
r188163 used CLC to implement memcmp.  Code that compares the result
directly against zero can test the CC value produced by CLC, but code
that needs an integer result must use IPM.  The sequence I'd used was:

   ipm <reg>
   sll <reg>, 2
   sra <reg>, 30

but I'd forgotten that this inverts the order, so that CC==1 ("less")
becomes an integer greater than zero, and CC==2 ("greater") becomes
an integer less than zero.  This sequence should only be used if the
CLC arguments are reversed to compensate.  The problem then is that
the branch condition must also be reversed when testing the CLC
result directly.

Rather than do that, I went for a different sequence that works with
the natural CLC order:

   ipm <reg>
   srl <reg>, 28
   rll <reg>, <reg>, 31

One advantage of this is that it doesn't clobber CC.  A disadvantage
is that any sign extension to 64 bits must be done separately,
rather than being folded into the shifts.

llvm-svn: 188538
2013-08-16 10:22:54 +00:00
..
AArch64 [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
ARM [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
CPP [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Generic [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Hexagon [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Inputs Debug Info Verifier: verify SPs in llvm.dbg.sp. 2013-07-27 01:26:08 +00:00
MSP430 [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Mips [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
NVPTX [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
PowerPC [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
R600 Revert "R600/SI: Fix incorrect encoding of DS_WRITE_B32 instructions" 2013-08-16 01:18:43 +00:00
SPARC [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
SystemZ [SystemZ] Fix sign of integer memcmp result 2013-08-16 10:22:54 +00:00
Thumb [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
Thumb2 [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00
X86 Don't use v16i32 for load pattern matching. All 512-bit loads are cated to v8i64. 2013-08-16 06:07:34 +00:00
XCore [tests] Cleanup initialization of test suffixes. 2013-08-16 00:37:11 +00:00