diff options
author | Jason Sams <jsams@google.com> | 2014-05-19 15:06:59 -0700 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2014-05-19 15:07:32 -0700 |
commit | 3ff0fe77fdba8ad4a920dc27157d8c1786bb3661 (patch) | |
tree | 0f8ccb5694ebfc688f521c18536a52a717829915 /driver | |
parent | e30d17aee86a306deb8138e45118bf6d624efbea (diff) | |
download | rs-3ff0fe77fdba8ad4a920dc27157d8c1786bb3661.tar.gz |
Cleanup 64bit and remove deprecated functions
Change-Id: I8f4570af8ab7da05831258dd264118b28ce5d352
Diffstat (limited to 'driver')
-rwxr-xr-x | driver/runtime/Android.mk | 3 | ||||
-rw-r--r-- | driver/runtime/matrix.ll | 176 | ||||
-rw-r--r-- | driver/runtime/rsClamp.ll | 60 | ||||
-rw-r--r-- | driver/runtime/rs_allocation.c | 1 | ||||
-rw-r--r-- | driver/runtime/rs_core.c | 23 | ||||
-rw-r--r-- | driver/runtime/rs_element.c | 1 | ||||
-rw-r--r-- | driver/runtime/rs_matrix.c | 1 | ||||
-rw-r--r-- | driver/runtime/rs_mesh.c | 5 | ||||
-rw-r--r-- | driver/runtime/rs_program.c | 4 | ||||
-rw-r--r-- | driver/runtime/rs_sample.c | 1 | ||||
-rw-r--r-- | driver/runtime/rs_sampler.c | 1 | ||||
-rw-r--r-- | driver/runtime/rs_structs.h | 4 |
12 files changed, 36 insertions, 244 deletions
diff --git a/driver/runtime/Android.mk b/driver/runtime/Android.mk index c16b1f2b..5f5a7081 100755 --- a/driver/runtime/Android.mk +++ b/driver/runtime/Android.mk @@ -28,8 +28,7 @@ clcore_base_files := \ rs_sample.c \ rs_sampler.c \ rs_convert.c \ - allocation.ll \ - rsClamp.ll + allocation.ll clcore_files := \ $(clcore_base_files) \ diff --git a/driver/runtime/matrix.ll b/driver/runtime/matrix.ll deleted file mode 100644 index c56405d1..00000000 --- a/driver/runtime/matrix.ll +++ /dev/null @@ -1,176 +0,0 @@ -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32-S64" -target triple = "armv7-none-linux-gnueabi" - - -%struct.rs_matrix4x4 = type { [16 x float] } -%struct.rs_matrix3x3 = type { [9 x float] } -%struct.rs_matrix2x2 = type { [4 x float] } - -define internal <4 x float> @smear_f(float %in) nounwind readnone alwaysinline { - %1 = insertelement <4 x float> undef, float %in, i32 0 - %2 = insertelement <4 x float> %1, float %in, i32 1 - %3 = insertelement <4 x float> %2, float %in, i32 2 - %4 = insertelement <4 x float> %3, float %in, i32 3 - ret <4 x float> %4 -} - - -define <3 x float> @_Z16rsMatrixMultiplyPK12rs_matrix3x3Dv3_f(%struct.rs_matrix3x3* nocapture %m, <3 x float> %in) nounwind readonly { - %x0 = extractelement <3 x float> %in, i32 0 - %x = tail call <4 x float> @smear_f(float %x0) nounwind readnone - %y0 = extractelement <3 x float> %in, i32 1 - %y = tail call <4 x float> @smear_f(float %y0) nounwind readnone - %z0 = extractelement <3 x float> %in, i32 2 - %z = tail call <4 x float> @smear_f(float %z0) nounwind readnone - - %px = getelementptr inbounds %struct.rs_matrix3x3* %m, i32 0, i32 0, i32 0 - %px2 = bitcast float* %px to <4 x float>* - %xm = load <4 x float>* %px2, align 4 - %py = getelementptr inbounds %struct.rs_matrix3x3* %m, i32 0, i32 0, i32 3 - %py2 = bitcast float* %py to <4 x float>* - %ym = load <4 x float>* %py2, align 4 - %pz = getelementptr inbounds %struct.rs_matrix3x3* %m, i32 0, i32 0, i32 6 - %pz2 = bitcast float* %pz to <3 x float>* - %zm2 = load <3 x float>* %pz2, align 4 - %zm = shufflevector <3 x float> %zm2, <3 x float> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3> - - %a1 = fmul <4 x float> %x, %xm - %a2 = fmul <4 x float> %y, %ym - %a3 = fadd <4 x float> %a1, %a2 - %a4 = fmul <4 x float> %z, %zm - %a5 = fadd <4 x float> %a4, %a3 - %a6 = shufflevector <4 x float> %a5, <4 x float> undef, <3 x i32> <i32 0, i32 1, i32 2> - ret <3 x float> %a6 -} - -define <3 x float> @_Z16rsMatrixMultiplyP12rs_matrix3x3Dv3_f(%struct.rs_matrix3x3* nocapture %m, <3 x float> %in) nounwind readonly { - %r = tail call <3 x float> @_Z16rsMatrixMultiplyPK12rs_matrix3x3Dv3_f(%struct.rs_matrix3x3* nocapture %m, <3 x float> %in) nounwind - ret <3 x float> %r -} - -define <3 x float> @_Z16rsMatrixMultiplyPK12rs_matrix3x3Dv2_f(%struct.rs_matrix3x3* nocapture %m, <2 x float> %in) nounwind readonly { - %x0 = extractelement <2 x float> %in, i32 0 - %x = tail call <4 x float> @smear_f(float %x0) nounwind readnone - %y0 = extractelement <2 x float> %in, i32 1 - %y = tail call <4 x float> @smear_f(float %y0) nounwind readnone - - %px = getelementptr inbounds %struct.rs_matrix3x3* %m, i32 0, i32 0, i32 0 - %px2 = bitcast float* %px to <4 x float>* - %xm = load <4 x float>* %px2, align 4 - %py = getelementptr inbounds %struct.rs_matrix3x3* %m, i32 0, i32 0, i32 3 - %py2 = bitcast float* %py to <4 x float>* - %ym = load <4 x float>* %py2, align 4 - - %a1 = fmul <4 x float> %x, %xm - %a2 = fmul <4 x float> %y, %ym - %a3 = fadd <4 x float> %a1, %a2 - %a4 = shufflevector <4 x float> %a3, <4 x float> undef, <3 x i32> <i32 0, i32 1, i32 2> - ret <3 x float> %a4 -} - -define <3 x float> @_Z16rsMatrixMultiplyP12rs_matrix3x3Dv2_f(%struct.rs_matrix3x3* nocapture %m, <2 x float> %in) nounwind readonly { - %r = tail call <3 x float> @_Z16rsMatrixMultiplyPK12rs_matrix3x3Dv2_f(%struct.rs_matrix3x3* nocapture %m, <2 x float> %in) nounwind - ret <3 x float> %r -} - -define <4 x float> @_Z16rsMatrixMultiplyPK12rs_matrix4x4Dv4_f(%struct.rs_matrix4x4* nocapture %m, <4 x float> %in) nounwind readonly { - %x0 = extractelement <4 x float> %in, i32 0 - %x = tail call <4 x float> @smear_f(float %x0) nounwind readnone - %y0 = extractelement <4 x float> %in, i32 1 - %y = tail call <4 x float> @smear_f(float %y0) nounwind readnone - %z0 = extractelement <4 x float> %in, i32 2 - %z = tail call <4 x float> @smear_f(float %z0) nounwind readnone - %w0 = extractelement <4 x float> %in, i32 3 - %w = tail call <4 x float> @smear_f(float %w0) nounwind readnone - - %px = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 0 - %px2 = bitcast float* %px to <4 x float>* - %xm = load <4 x float>* %px2, align 4 - %py = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 4 - %py2 = bitcast float* %py to <4 x float>* - %ym = load <4 x float>* %py2, align 4 - %pz = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 8 - %pz2 = bitcast float* %pz to <4 x float>* - %zm = load <4 x float>* %pz2, align 4 - %pw = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 12 - %pw2 = bitcast float* %pw to <4 x float>* - %wm = load <4 x float>* %pw2, align 4 - - %a1 = fmul <4 x float> %x, %xm - %a2 = fmul <4 x float> %y, %ym - %a3 = fadd <4 x float> %a1, %a2 - %a4 = fmul <4 x float> %z, %zm - %a5 = fadd <4 x float> %a3, %a4 - %a6 = fmul <4 x float> %w, %wm - %a7 = fadd <4 x float> %a5, %a6 - ret <4 x float> %a7 -} - -define <4 x float> @_Z16rsMatrixMultiplyP12rs_matrix4x4Dv4_f(%struct.rs_matrix4x4* nocapture %m, <4 x float> %in) nounwind readonly { - %r = tail call <4 x float> @_Z16rsMatrixMultiplyPK12rs_matrix4x4Dv4_f(%struct.rs_matrix4x4* nocapture %m, <4 x float> %in) nounwind - ret <4 x float> %r -} - -define <4 x float> @_Z16rsMatrixMultiplyPK12rs_matrix4x4Dv3_f(%struct.rs_matrix4x4* nocapture %m, <3 x float> %in) nounwind readonly { - %x0 = extractelement <3 x float> %in, i32 0 - %x = tail call <4 x float> @smear_f(float %x0) nounwind readnone - %y0 = extractelement <3 x float> %in, i32 1 - %y = tail call <4 x float> @smear_f(float %y0) nounwind readnone - %z0 = extractelement <3 x float> %in, i32 2 - %z = tail call <4 x float> @smear_f(float %z0) nounwind readnone - - %px = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 0 - %px2 = bitcast float* %px to <4 x float>* - %xm = load <4 x float>* %px2, align 4 - %py = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 4 - %py2 = bitcast float* %py to <4 x float>* - %ym = load <4 x float>* %py2, align 4 - %pz = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 8 - %pz2 = bitcast float* %pz to <4 x float>* - %zm = load <4 x float>* %pz2, align 4 - %pw = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 12 - %pw2 = bitcast float* %pw to <4 x float>* - %wm = load <4 x float>* %pw2, align 4 - - %a1 = fmul <4 x float> %x, %xm - %a2 = fadd <4 x float> %wm, %a1 - %a3 = fmul <4 x float> %y, %ym - %a4 = fadd <4 x float> %a2, %a3 - %a5 = fmul <4 x float> %z, %zm - %a6 = fadd <4 x float> %a4, %a5 - ret <4 x float> %a6 -} - -define <4 x float> @_Z16rsMatrixMultiplyP12rs_matrix4x4Dv3_f(%struct.rs_matrix4x4* nocapture %m, <3 x float> %in) nounwind readonly { - %r = tail call <4 x float> @_Z16rsMatrixMultiplyPK12rs_matrix4x4Dv3_f(%struct.rs_matrix4x4* nocapture %m, <3 x float> %in) nounwind - ret <4 x float> %r -} - -define <4 x float> @_Z16rsMatrixMultiplyPK12rs_matrix4x4Dv2_f(%struct.rs_matrix4x4* nocapture %m, <2 x float> %in) nounwind readonly { - %x0 = extractelement <2 x float> %in, i32 0 - %x = tail call <4 x float> @smear_f(float %x0) nounwind readnone - %y0 = extractelement <2 x float> %in, i32 1 - %y = tail call <4 x float> @smear_f(float %y0) nounwind readnone - - %px = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 0 - %px2 = bitcast float* %px to <4 x float>* - %xm = load <4 x float>* %px2, align 4 - %py = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 4 - %py2 = bitcast float* %py to <4 x float>* - %ym = load <4 x float>* %py2, align 4 - %pw = getelementptr inbounds %struct.rs_matrix4x4* %m, i32 0, i32 0, i32 12 - %pw2 = bitcast float* %pw to <4 x float>* - %wm = load <4 x float>* %pw2, align 4 - - %a1 = fmul <4 x float> %x, %xm - %a2 = fadd <4 x float> %wm, %a1 - %a3 = fmul <4 x float> %y, %ym - %a4 = fadd <4 x float> %a2, %a3 - ret <4 x float> %a4 -} - -define <4 x float> @_Z16rsMatrixMultiplyP12rs_matrix4x4Dv2_f(%struct.rs_matrix4x4* nocapture %m, <2 x float> %in) nounwind readonly { - %r = tail call <4 x float> @_Z16rsMatrixMultiplyPK12rs_matrix4x4Dv2_f(%struct.rs_matrix4x4* nocapture %m, <2 x float> %in) nounwind - ret <4 x float> %r -} - diff --git a/driver/runtime/rsClamp.ll b/driver/runtime/rsClamp.ll deleted file mode 100644 index eba678a0..00000000 --- a/driver/runtime/rsClamp.ll +++ /dev/null @@ -1,60 +0,0 @@ -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:128-a0:0:64-n32-S64" -target triple = "armv7-none-linux-gnueabi" - - -define float @_Z7rsClampfff(float %value, float %low, float %high) nounwind readonly { - %1 = fcmp olt float %value, %high - %2 = select i1 %1, float %value, float %high - %3 = fcmp ogt float %2, %low - %4 = select i1 %3, float %2, float %low - ret float %4 -} - -define signext i8 @_Z7rsClampccc(i8 signext %value, i8 signext %low, i8 signext %high) nounwind readonly { - %1 = icmp slt i8 %value, %high - %2 = select i1 %1, i8 %value, i8 %high - %3 = icmp sgt i8 %2, %low - %4 = select i1 %3, i8 %2, i8 %low - ret i8 %4 -} - -define zeroext i8 @_Z7rsClamphhh(i8 zeroext %value, i8 zeroext %low, i8 zeroext %high) nounwind readonly { - %1 = icmp ult i8 %value, %high - %2 = select i1 %1, i8 %value, i8 %high - %3 = icmp ugt i8 %2, %low - %4 = select i1 %3, i8 %2, i8 %low - ret i8 %4 -} - -define signext i16 @_Z7rsClampsss(i16 signext %value, i16 signext %low, i16 signext %high) nounwind readonly { - %1 = icmp slt i16 %value, %high - %2 = select i1 %1, i16 %value, i16 %high - %3 = icmp sgt i16 %2, %low - %4 = select i1 %3, i16 %2, i16 %low - ret i16 %4 -} - -define zeroext i16 @_Z7rsClampttt(i16 zeroext %value, i16 zeroext %low, i16 zeroext %high) nounwind readonly { - %1 = icmp ult i16 %value, %high - %2 = select i1 %1, i16 %value, i16 %high - %3 = icmp ugt i16 %2, %low - %4 = select i1 %3, i16 %2, i16 %low - ret i16 %4 -} - -define i32 @_Z7rsClampiii(i32 %value, i32 %low, i32 %high) nounwind readonly { - %1 = icmp slt i32 %value, %high - %2 = select i1 %1, i32 %value, i32 %high - %3 = icmp sgt i32 %2, %low - %4 = select i1 %3, i32 %2, i32 %low - ret i32 %4 -} - -define i32 @_Z7rsClampjjj(i32 %value, i32 %low, i32 %high) nounwind readonly { - %1 = icmp ult i32 %value, %high - %2 = select i1 %1, i32 %value, i32 %high - %3 = icmp ugt i32 %2, %low - %4 = select i1 %3, i32 %2, i32 %low - ret i32 %4 -} - diff --git a/driver/runtime/rs_allocation.c b/driver/runtime/rs_allocation.c index 0722680d..bf377138 100644 --- a/driver/runtime/rs_allocation.c +++ b/driver/runtime/rs_allocation.c @@ -1,5 +1,4 @@ #include "rs_core.rsh" -#include "rs_graphics.rsh" #include "rs_structs.h" // Opaque Allocation type operations diff --git a/driver/runtime/rs_core.c b/driver/runtime/rs_core.c index b1c2af1e..f908e9ea 100644 --- a/driver/runtime/rs_core.c +++ b/driver/runtime/rs_core.c @@ -1,5 +1,4 @@ #include "rs_core.rsh" -#include "rs_graphics.rsh" #include "rs_structs.h" /* Function declarations from libRS */ @@ -13,6 +12,28 @@ extern float4 rsUnpackColor8888(uchar4 c) } +extern float __attribute__((overloadable)) rsClamp(float v, float l, float h) { + return clamp(v, l, h); +} +extern char __attribute__((overloadable)) rsClamp(char v, char l, char h) { + return clamp(v, l, h); +} +extern uchar __attribute__((overloadable)) rsClamp(uchar v, uchar l, uchar h) { + return clamp(v, l, h); +} +extern short __attribute__((overloadable)) rsClamp(short v, short l, short h) { + return clamp(v, l, h); +} +extern ushort __attribute__((overloadable)) rsClamp(ushort v, ushort l, ushort h) { + return clamp(v, l, h); +} +extern int __attribute__((overloadable)) rsClamp(int v, int l, int h) { + return clamp(v, l, h); +} +extern uint __attribute__((overloadable)) rsClamp(uint v, uint l, uint h) { + return clamp(v, l, h); +} + extern int32_t __attribute__((overloadable)) rsAtomicCas(volatile int32_t *ptr, int32_t expectedValue, int32_t newValue) { return __sync_val_compare_and_swap(ptr, expectedValue, newValue); } diff --git a/driver/runtime/rs_element.c b/driver/runtime/rs_element.c index 4db5883c..a67bdd5c 100644 --- a/driver/runtime/rs_element.c +++ b/driver/runtime/rs_element.c @@ -1,5 +1,4 @@ #include "rs_core.rsh" -#include "rs_graphics.rsh" #include "rs_structs.h" /** diff --git a/driver/runtime/rs_matrix.c b/driver/runtime/rs_matrix.c index 3afccc18..052e829a 100644 --- a/driver/runtime/rs_matrix.c +++ b/driver/runtime/rs_matrix.c @@ -1,5 +1,4 @@ #include "rs_core.rsh" -#include "rs_graphics.rsh" #include "rs_structs.h" /* Function declarations from libRS */ diff --git a/driver/runtime/rs_mesh.c b/driver/runtime/rs_mesh.c index bb533bc4..283b448d 100644 --- a/driver/runtime/rs_mesh.c +++ b/driver/runtime/rs_mesh.c @@ -1,3 +1,5 @@ +#ifndef __LP64__ + #include "rs_core.rsh" #include "rs_graphics.rsh" #include "rs_structs.h" @@ -53,3 +55,6 @@ extern rs_primitive __attribute__((overloadable)) } return mesh->mHal.state.primitives[index]; } + +#endif + diff --git a/driver/runtime/rs_program.c b/driver/runtime/rs_program.c index 64c656f8..320c5a4e 100644 --- a/driver/runtime/rs_program.c +++ b/driver/runtime/rs_program.c @@ -1,3 +1,5 @@ +#ifndef __LP64__ + #include "rs_core.rsh" #include "rs_graphics.rsh" #include "rs_structs.h" @@ -106,3 +108,5 @@ extern rs_cull_mode __attribute__((overloadable)) } return prog->mHal.state.cull; } + +#endif diff --git a/driver/runtime/rs_sample.c b/driver/runtime/rs_sample.c index 2cd5bdc0..f4d52f72 100644 --- a/driver/runtime/rs_sample.c +++ b/driver/runtime/rs_sample.c @@ -1,5 +1,4 @@ #include "rs_core.rsh" -#include "rs_graphics.rsh" #include "rs_structs.h" diff --git a/driver/runtime/rs_sampler.c b/driver/runtime/rs_sampler.c index 39782de6..6c3e7ffe 100644 --- a/driver/runtime/rs_sampler.c +++ b/driver/runtime/rs_sampler.c @@ -1,5 +1,4 @@ #include "rs_core.rsh" -#include "rs_graphics.rsh" #include "rs_structs.h" /** diff --git a/driver/runtime/rs_structs.h b/driver/runtime/rs_structs.h index 26a41eed..80c129cc 100644 --- a/driver/runtime/rs_structs.h +++ b/driver/runtime/rs_structs.h @@ -63,6 +63,7 @@ typedef struct Allocation { } mHal; } Allocation_t; +#ifndef __LP64__ /***************************************************************************** * CAUTION * @@ -124,6 +125,7 @@ typedef struct ProgramRaster { } state; } mHal; } ProgramRaster_t; +#endif //__LP64__ /***************************************************************************** * CAUTION @@ -231,6 +233,7 @@ typedef struct Type { } mHal; } Type_t; +#ifndef __LP64__ /***************************************************************************** * CAUTION * @@ -264,4 +267,5 @@ typedef struct Mesh { } state; } mHal; } Mesh_t; +#endif //__LP64__ #endif // _RS_CORE_H_ |