]> granicus.if.org Git - llvm/commit
Merging r327540:
authorTom Stellard <tstellar@redhat.com>
Tue, 8 May 2018 22:21:28 +0000 (22:21 +0000)
committerTom Stellard <tstellar@redhat.com>
Tue, 8 May 2018 22:21:28 +0000 (22:21 +0000)
commit19fb6975c5f250b051ffeaa54dee5a5a25ab6684
tree8c5c3ef686a7d2ae8fb0f3bdb507714113db5636
parentd74441c80b53e17ebd027e4a9515707f6abc633c
Merging r327540:

------------------------------------------------------------------------
r327540 | ctopper | 2018-03-14 10:57:19 -0700 (Wed, 14 Mar 2018) | 7 lines

[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/branches/release_60@331815 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86FastISel.cpp
test/CodeGen/X86/fast-isel-shift.ll