diff options
author | Aaron Watry <awatry@gmail.com> | 2013-06-17 14:27:06 -0500 |
---|---|---|
committer | Aaron Watry <awatry@gmail.com> | 2013-06-17 14:27:06 -0500 |
commit | 0444744a42bd5d15038da497f10463f3252718ee (patch) | |
tree | 88d25f223a67ffaddcb597acc14764044e5ee579 | |
parent | 34ccfda2be968d29f2420fc9cd8b8f9f071c2cab (diff) |
libclc: Enable assembly versions of int2 load/store to global address space
The bug in R600 which prevented them from working has been mitigated.
Signed-off-by: Aaron Watry<awatry@gmail.com>
-rw-r--r-- | generic/lib/shared/vload.cl | 18 | ||||
-rw-r--r-- | generic/lib/shared/vstore.cl | 20 |
2 files changed, 20 insertions, 18 deletions
diff --git a/generic/lib/shared/vload.cl b/generic/lib/shared/vload.cl index e47aa2e..dd28347 100644 --- a/generic/lib/shared/vload.cl +++ b/generic/lib/shared/vload.cl @@ -51,26 +51,24 @@ VLOAD_VECTORIZE(uint, __private) VLOAD_VECTORIZE(uint, __local) VLOAD_VECTORIZE(uint, __constant) -_CLC_OVERLOAD _CLC_DEF int2 vload2(size_t offset, const global int *x) { - return (int2)(x[offset] , x[offset+1]); -} _CLC_OVERLOAD _CLC_DEF int3 vload3(size_t offset, const global int *x) { return (int3)(vload2(offset, x), x[offset+2]); } -_CLC_OVERLOAD _CLC_DEF uint2 vload2(size_t offset, const global uint *x) { - return (uint2)(x[offset] , x[offset+1]); -} _CLC_OVERLOAD _CLC_DEF uint3 vload3(size_t offset, const global uint *x) { return (uint3)(vload2(offset, x), x[offset+2]); } -/*Note: It is known that R600 doesn't support load <2 x ?> and <3 x ?>... so - * they aren't actually overridden here +/*Note: R600 doesn't support load <3 x ?>... so + * those functions aren't actually overridden here */ +_CLC_DECL int2 __clc_vload2_int__global(size_t offset, const __global int *); _CLC_DECL int4 __clc_vload4_int__global(size_t offset, const __global int *); _CLC_DECL int8 __clc_vload8_int__global(size_t offset, const __global int *); _CLC_DECL int16 __clc_vload16_int__global(size_t offset, const __global int *); +_CLC_OVERLOAD _CLC_DEF int2 vload2(size_t offset, const global int *x) { + return __clc_vload2_int__global(offset, x); +} _CLC_OVERLOAD _CLC_DEF int4 vload4(size_t offset, const global int *x) { return __clc_vload4_int__global(offset, x); } @@ -81,10 +79,14 @@ _CLC_OVERLOAD _CLC_DEF int16 vload16(size_t offset, const global int *x) { return __clc_vload16_int__global(offset, x); } +_CLC_DECL uint2 __clc_vload2_uint__global(size_t offset, const __global uint *); _CLC_DECL uint4 __clc_vload4_uint__global(size_t offset, const __global uint *); _CLC_DECL uint8 __clc_vload8_uint__global(size_t offset, const __global uint *); _CLC_DECL uint16 __clc_vload16_uint__global(size_t offset, const __global uint *); +_CLC_OVERLOAD _CLC_DEF uint2 vload2(size_t offset, const global uint *x) { + return __clc_vload2_uint__global(offset, x); +} _CLC_OVERLOAD _CLC_DEF uint4 vload4(size_t offset, const global uint *x) { return __clc_vload4_uint__global(offset, x); } diff --git a/generic/lib/shared/vstore.cl b/generic/lib/shared/vstore.cl index c6d9551..c8b8cd5 100644 --- a/generic/lib/shared/vstore.cl +++ b/generic/lib/shared/vstore.cl @@ -56,32 +56,28 @@ VSTORE_VECTORIZE(int, __local) VSTORE_VECTORIZE(uint, __private) VSTORE_VECTORIZE(uint, __local) -_CLC_OVERLOAD _CLC_DEF void vstore2(int2 vec, size_t offset, global int *mem) { - mem[offset] = vec.s0; - mem[offset+1] = vec.s1; -} _CLC_OVERLOAD _CLC_DEF void vstore3(int3 vec, size_t offset, global int *mem) { mem[offset] = vec.s0; mem[offset+1] = vec.s1; mem[offset+2] = vec.s2; } -_CLC_OVERLOAD _CLC_DEF void vstore2(uint2 vec, size_t offset, global uint *mem) { - mem[offset] = vec.s0; - mem[offset+1] = vec.s1; -} _CLC_OVERLOAD _CLC_DEF void vstore3(uint3 vec, size_t offset, global uint *mem) { mem[offset] = vec.s0; mem[offset+1] = vec.s1; mem[offset+2] = vec.s2; } -/*Note: R600 probably doesn't support store <2 x ?> and <3 x ?>... so - * they aren't actually overridden here... lowest-common-denominator +/*Note: R600 doesn't support store <3 x ?>... so + * those functions aren't actually overridden here... lowest-common-denominator */ +_CLC_DECL void __clc_vstore2_int__global(int2 vec, size_t offset, __global int *); _CLC_DECL void __clc_vstore4_int__global(int4 vec, size_t offset, __global int *); _CLC_DECL void __clc_vstore8_int__global(int8 vec, size_t offset, __global int *); _CLC_DECL void __clc_vstore16_int__global(int16 vec, size_t offset, __global int *); +_CLC_OVERLOAD _CLC_DEF void vstore2(int2 vec, size_t offset, global int *x) { + __clc_vstore2_int__global(vec, offset, x); +} _CLC_OVERLOAD _CLC_DEF void vstore4(int4 vec, size_t offset, global int *x) { __clc_vstore4_int__global(vec, offset, x); } @@ -92,10 +88,14 @@ _CLC_OVERLOAD _CLC_DEF void vstore16(int16 vec, size_t offset, global int *x) { __clc_vstore16_int__global(vec, offset, x); } +_CLC_DECL void __clc_vstore2_uint__global(uint2 vec, size_t offset, __global uint *); _CLC_DECL void __clc_vstore4_uint__global(uint4 vec, size_t offset, __global uint *); _CLC_DECL void __clc_vstore8_uint__global(uint8 vec, size_t offset, __global uint *); _CLC_DECL void __clc_vstore16_uint__global(uint16 vec, size_t offset, __global uint *); +_CLC_OVERLOAD _CLC_DEF void vstore2(uint2 vec, size_t offset, global uint *x) { + __clc_vstore2_uint__global(vec, offset, x); +} _CLC_OVERLOAD _CLC_DEF void vstore4(uint4 vec, size_t offset, global uint *x) { __clc_vstore4_uint__global(vec, offset, x); } |