intel/compiler: Properly handle shift count for 8-bit sources

This fixes the Crucible func.shader.shift.int8_t test on Gen8 and Gen9.
See crucible!76.

No changes in fossil-db because there are no shaders in fossil-db that
use shaderInt8. :(

A couple alternatives were considered.

1. Lower 8-bit integers to 16-bit on all platforms.  I looked at the
   output of a few shaders from the Vulkan CTS, and it was a mess.
   There were so many extra type converting MOVs.  I think all of that
   could be cleaned up, but it would be more work.  It would also not be
   great for cherry-picking to a stable branch.

   This *is* the approach that will be taken Mesa 21.1.  See also
   !8730.

2. Disable the optimization that prunes the `& 7`.  This would be more
   optimal in shaders that don't have the explicit mask, but it's not
   very future proof.  It would potentially require auditing future
   optimizations to make sure they don't run afoul of this problem.

In the end, the easiest solution seems to be adding the extra mask to
implement the specified semantics of the NIR shift instructions...
especially since the only shaders we have that use shaderInt8 are from
the CTS.

v2: Use braces in the else part because they were used in the then part.
Suggested by Jason.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Fixes: 26fc5e1f ("nir/algebraic: expand existing 32-bit patterns to all bit sizes using loops")
Part-of: <!9001>
35 jobs for !9001 with fix-8-bit-shift in 18 minutes and 56 seconds (queued for 3 seconds)
latest detached
Status Job ID Name Coverage
  Sanity
passed #7421309
sanity

00:00:09

 
  Container
passed #7421314
aarch64
arm_build

00:00:28

passed #7421317
arm_test-base

00:00:12

passed #7421318
windows shell 1809 mesa
windows_build_vs2019

00:00:09

passed #7421310
x86_build-base

00:00:14

passed #7421312
x86_test-base

00:00:13

 
  Container 2
passed #7421326
android_build

00:00:12

passed #7421329
arm64_test

00:00:12

passed #7421330
armhf_test

00:00:16

passed #7421323
i386_build

00:00:13

passed #7421319
kernel+rootfs_amd64

00:00:55

passed #7421320
aarch64
kernel+rootfs_arm64

00:01:02

passed #7421321
aarch64
kernel+rootfs_armhf

00:00:22

passed #7421324
ppc64el_build

00:00:16

passed #7421325
s390x_build

00:00:16

passed #7421322
x86_build

00:00:13

passed #7421327
x86_test-gl

00:00:16

passed #7421328
x86_test-vk

00:00:13

 
  Meson X86 64
passed #7421336
meson-clang

00:02:22

passed #7421337
meson-clover

00:02:38

passed #7421333
meson-clover-testing

00:01:23

passed #7421334
meson-gallium

00:18:16

passed #7421335
meson-release

00:01:22

passed #7421331
meson-testing

00:02:16

passed #7421332
meson-testing-asan

00:02:32

passed #7421338
meson-vulkan

00:04:10

 
  Build Misc
passed #7421339
meson-android

00:01:38

passed #7421341
aarch64
meson-arm64

00:01:27

passed #7421342
aarch64
meson-arm64-build-test

00:01:24

passed #7421340
aarch64
meson-armhf

00:01:27

passed #7421344
meson-i386

00:01:33

passed #7421347
meson-mingw32-x86_64

00:04:18

passed #7421346
kvm
meson-ppc64el

00:02:30

passed #7421345
kvm
meson-s390x

00:03:33

passed #7421343
scons-win64

00:05:41