summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Kyriazis <[email protected]>2018-02-12 13:38:45 -0600
committerGeorge Kyriazis <[email protected]>2018-02-16 10:54:00 -0600
commitb25efa36e674295136ab81d741e575fa43e30edc (patch)
tree940f329a5b604070708811cc4727b23d2ab90eb9
parent8a64593bde93fc3e88bb712c12ebe90837b54d5a (diff)
swr/rast: Fix GATHERPS to avoid assertions.
With the pBase type change, LLVM was asserting because of wrong types. Cast appropriately. Reviewed-by: Bruce Cherniak <[email protected]>
-rw-r--r--src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
index 98d4354c410..6e462d522f7 100644
--- a/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
+++ b/src/gallium/drivers/swr/rasterizer/jitter/builder_mem.cpp
@@ -140,6 +140,7 @@ namespace SwrJit
Value *Builder::GATHERPS(Value *vSrc, Value *pBase, Value *vIndices, Value *vMask, uint8_t scale)
{
Value *vGather;
+ Value *pBasePtr = INT_TO_PTR(pBase, PointerType::get(mInt8Ty, 0));
// use avx2 gather instruction if available
if (JM()->mArch.AVX2())
@@ -147,7 +148,7 @@ namespace SwrJit
// force mask to <N x float>, required by vgather
Value *mask = BITCAST(VMASK(vMask), mSimdFP32Ty);
- vGather = VGATHERPS(vSrc, pBase, vIndices, mask, C(scale));
+ vGather = VGATHERPS(vSrc, pBasePtr, vIndices, mask, C(scale));
}
else
{
@@ -165,7 +166,7 @@ namespace SwrJit
// single component byte index
Value *offset = VEXTRACT(vOffsets, C(i));
// byte pointer to component
- Value *loadAddress = GEP(pBase, offset);
+ Value *loadAddress = GEP(pBasePtr, offset);
loadAddress = BITCAST(loadAddress, PointerType::get(mFP32Ty, 0));
// pointer to the value to load if we're masking off a component
Value *maskLoadAddress = GEP(vSrcPtr, { C(0), C(i) });