GBE: fix uniform/scalar related bugs.
authorZhigang Gong <zhigang.gong@intel.com>
Thu, 29 May 2014 01:26:24 +0000 (09:26 +0800)
committerZhigang Gong <zhigang.gong@intel.com>
Thu, 29 May 2014 06:48:38 +0000 (14:48 +0800)
commit1b8042620e32b05334f6bbbd87bde7ee4b4a8a03
tree58faaef48791c15662c8648b0327395c49186ce7
parent55066d1a0ef13eb3c1af0689b17d0f8b1d5351f4
GBE: fix uniform/scalar related bugs.

One major fix is that even a register is a scalar, when
we move a scalar Dword to a scalar Byte, we have to set
the hstride to 4, otherwise, it breaks the following
register restication:
  B. When the Execution Data Type is wider than the destination data type,
     the destination must be aligned as required by the wider execution data
     type and specify a HorzStride equal to the ratio in sizes of the two data
     types. For example, a mov with a D source and B destination must use a
     4-byte aligned destination and a Dst.HorzStride of 4.

The following instruction may doesn't take effect.
mov.sat(1)  g127.4<1>:B  g126<0,1,0>:D
We have to change it to
mov.sat(1)  g127.4<4>:B  g126<0,1,0>:D

v2: keep the instruction selection stage unchanged, we fix this restircation
    in setDst only.

Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
backend/src/backend/gen_encoder.cpp
backend/src/backend/gen_insn_selection.cpp
backend/src/backend/gen_reg_allocation.cpp