[X86] Improve handling of UDIVREM8_ZEXT_HREG/SDIVREM8_SEXT_HREG to support 64-bit...
authorCraig Topper <craig.topper@intel.com>
Thu, 26 Oct 2017 21:12:03 +0000 (21:12 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 26 Oct 2017 21:12:03 +0000 (21:12 +0000)
commitb8d7d4d683ada9f4d0cf40a07ab794ee9fddfafe
tree8c7ad9f637f4f55ee69bc0b0e934f9b00f99c64a
parent6631036893b27123614ad379f13a803d11907070
[X86] Improve handling of UDIVREM8_ZEXT_HREG/SDIVREM8_SEXT_HREG to support 64-bit extensions.

If the extend type is 64-bits, emit a 32-bit -> 64-bit extend after the UDIVREM8_ZEXT_HREG/UDIVREM8_SEXT_HREG operation.

This gives a shorter encoding for the second extend in the sext case, and allows us to completely remove the second extend in the zext case.

This also adds known bit and num sign bits support for UDIVREM8_ZEXT_HREG/SDIVREM8_SEXT_HREG.

Differential Revision: https://reviews.llvm.org/D38275

llvm-svn: 316702
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/divrem8_ext.ll