OSDN Git Service

[X86] Add back fast-isel code for handling i8 shifts.
authorCraig Topper <craig.topper@intel.com>
Wed, 14 Mar 2018 17:57:19 +0000 (17:57 +0000)
committerCraig Topper <craig.topper@intel.com>
Wed, 14 Mar 2018 17:57:19 +0000 (17:57 +0000)
commit2671f80b2d151c9a87a4a93860f8a6b98db57aad
treed2b74e086ec20a7d3d46248c16673ec386c1eb7e
parent9c2e5e4f7854b75acaf1c57075752d7590b74939
[X86] Add back fast-isel code for handling i8 shifts.

I removed this in r316797 because the coverage report showed no coverage and I thought it should have been handled by the auto generated table. I now see that there is code that bypasses the table if the shift amount is out of bounds.

This adds back the code. We'll codegen out of bounds i8 shifts to effectively (amount & 0x1f). The 0x1f is a strange quirk of x86 that shift amounts are always masked to 5-bits(except 64-bits). So if the masked value is still out bounds the result will be 0.

Fixes PR36731.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327540 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FastISel.cpp
test/CodeGen/X86/fast-isel-shift.ll