diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2015-03-10 13:59:45 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-03-12 17:27:09 +0800 |
commit | 9dbe62f6830876a4735fc8161a4c61bdfde71b55 (patch) | |
tree | 9b9eda81af288436ff2daa7f1fb8070a739326c5 /backend | |
parent | 499e6e38a6950a2caffc36aa2a68f6df9291338b (diff) |
replace rndu with llvm intrinsic.
translate native rndu to llvm.ceil.
v2:
fix ocl_convert.sh
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Diffstat (limited to 'backend')
-rwxr-xr-x | backend/src/libocl/script/ocl_convert.sh | 2 | ||||
-rw-r--r-- | backend/src/libocl/tmpl/ocl_math.tmpl.cl | 2 | ||||
-rw-r--r-- | backend/src/llvm/llvm_gen_backend.cpp | 2 | ||||
-rw-r--r-- | backend/src/llvm/llvm_gen_ocl_function.hxx | 1 |
4 files changed, 2 insertions, 5 deletions
diff --git a/backend/src/libocl/script/ocl_convert.sh b/backend/src/libocl/script/ocl_convert.sh index 3f5140be..f6263901 100755 --- a/backend/src/libocl/script/ocl_convert.sh +++ b/backend/src/libocl/script/ocl_convert.sh @@ -325,7 +325,7 @@ if [ $1"a" != "-pa" ]; then echo ' CONST float __gen_ocl_rndz(float x) __asm("llvm.trunc" ".f32"); CONST float __gen_ocl_rnde(float x) __asm("llvm.rint" ".f32"); -float __gen_ocl_rndu(float x); +CONST float __gen_ocl_rndu(float x) __asm("llvm.ceil" ".f32"); float __gen_ocl_rndd(float x); OVERLOADABLE float __convert_float_rtz(long x) { diff --git a/backend/src/libocl/tmpl/ocl_math.tmpl.cl b/backend/src/libocl/tmpl/ocl_math.tmpl.cl index d07e5d49..b3288b6d 100644 --- a/backend/src/libocl/tmpl/ocl_math.tmpl.cl +++ b/backend/src/libocl/tmpl/ocl_math.tmpl.cl @@ -34,7 +34,7 @@ PURE CONST float __gen_ocl_pow(float x, float y); PURE CONST float __gen_ocl_rcp(float x); CONST float __gen_ocl_rndz(float x) __asm("llvm.trunc" ".f32"); CONST float __gen_ocl_rnde(float x) __asm("llvm.rint" ".f32"); -PURE CONST float __gen_ocl_rndu(float x); +CONST float __gen_ocl_rndu(float x) __asm("llvm.ceil" ".f32"); PURE CONST float __gen_ocl_rndd(float x); diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index e358938e..02d5d37e 100644 --- a/backend/src/llvm/llvm_gen_backend.cpp +++ b/backend/src/llvm/llvm_gen_backend.cpp @@ -2674,7 +2674,6 @@ namespace gbe case GEN_OCL_POW: case GEN_OCL_RCP: case GEN_OCL_ABS: - case GEN_OCL_RNDU: case GEN_OCL_RNDD: case GEN_OCL_GET_IMAGE_WIDTH: case GEN_OCL_GET_IMAGE_HEIGHT: @@ -3076,7 +3075,6 @@ namespace gbe } case GEN_OCL_RSQ: this->emitUnaryCallInst(I,CS,ir::OP_RSQ); break; case GEN_OCL_RCP: this->emitUnaryCallInst(I,CS,ir::OP_RCP); break; - case GEN_OCL_RNDU: this->emitUnaryCallInst(I,CS,ir::OP_RNDU); break; case GEN_OCL_RNDD: this->emitUnaryCallInst(I,CS,ir::OP_RNDD); break; case GEN_OCL_FORCE_SIMD8: ctx.setSimdWidth(8); break; case GEN_OCL_FORCE_SIMD16: ctx.setSimdWidth(16); break; diff --git a/backend/src/llvm/llvm_gen_ocl_function.hxx b/backend/src/llvm/llvm_gen_ocl_function.hxx index ea75678e..83bd5049 100644 --- a/backend/src/llvm/llvm_gen_ocl_function.hxx +++ b/backend/src/llvm/llvm_gen_ocl_function.hxx @@ -22,7 +22,6 @@ DECL_LLVM_GEN_FUNCTION(GET_WORK_DIM, __gen_ocl_get_work_dim) DECL_LLVM_GEN_FUNCTION(RSQ, __gen_ocl_rsqrt) DECL_LLVM_GEN_FUNCTION(POW, __gen_ocl_pow) DECL_LLVM_GEN_FUNCTION(RCP, __gen_ocl_rcp) -DECL_LLVM_GEN_FUNCTION(RNDU, __gen_ocl_rndu) DECL_LLVM_GEN_FUNCTION(RNDD, __gen_ocl_rndd) DECL_LLVM_GEN_FUNCTION(MAD, __gen_ocl_mad) DECL_LLVM_GEN_FUNCTION(FMAX, __gen_ocl_fmax) |