[SystemZ] Define remainig *MUL_LOHI patterns
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 21 Aug 2013 09:34:56 +0000 (09:34 +0000)
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>
Wed, 21 Aug 2013 09:34:56 +0000 (09:34 +0000)
commitdf40f8e8ad0aa93defa44b8a136e8d871cfd44ea
tree407c098b758245e1395847a48070aebb96f81cbc
parentf44026bf2639561364747fb6c419eeb5f531e5b9
[SystemZ] Define remainig *MUL_LOHI patterns

The initial port used MLG(R) for i64 UMUL_LOHI but left the other three
combinations as not-legal-or-custom.  Although 32x32->{32,32}
multiplications exist, they're not as quick as doing a normal 64-bit
multiplication, so it didn't seem like i32 SMUL_LOHI and UMUL_LOHI
would be useful.  There's also no direct instruction for i64 SMUL_LOHI,
so it needs to be implemented in terms of UMUL_LOHI.

However, not defining these patterns means that we don't convert
division by a constant into multiplication, so this patch fills
in the other cases.  The new i64 SMUL_LOHI sequence is simpler
than the one that we used previously for 64x64->128 multiplication,
so int-mul-08.ll now tests the full sequence.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188898 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h
test/CodeGen/SystemZ/int-div-06.ll [new file with mode: 0644]
test/CodeGen/SystemZ/int-mul-08.ll