From f0425d621173bc953a823677cdcaed46b051b9db Mon Sep 17 00:00:00 2001 From: Guo Yejun Date: Thu, 25 Feb 2016 06:19:50 +0800 Subject: change behavior of mul24/mad24 when out of range mul24 and mad24 are supposed to be fast integer functions, but the current implementation is slower. At least we should provide same performance if not faster, so change the behavior when the parameters are out of range since it is implementation-defined. passed test: integer_ops of conformance test Signed-off-by: Guo Yejun Reviewed-by: Yang Rong --- utests/compiler_mad24.cpp | 2 +- utests/compiler_mul24.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'utests') diff --git a/utests/compiler_mad24.cpp b/utests/compiler_mad24.cpp index a3890a14..ba2dcf60 100644 --- a/utests/compiler_mad24.cpp +++ b/utests/compiler_mad24.cpp @@ -34,7 +34,7 @@ void compiler_mad24(void) OCL_MAP_BUFFER(3); for (int i = 0; i < n; ++i) - OCL_ASSERT(((int*)buf_data[3])[i] == ((src1[i] << 8) >> 8) * ((src2[i] << 8) >> 8) + src3[i]); + OCL_ASSERT(((int*)buf_data[3])[i] == (src1[i]) * (src2[i]) + src3[i]); OCL_UNMAP_BUFFER(3); } diff --git a/utests/compiler_mul24.cpp b/utests/compiler_mul24.cpp index 8a369476..f1a9a40c 100644 --- a/utests/compiler_mul24.cpp +++ b/utests/compiler_mul24.cpp @@ -29,7 +29,7 @@ void compiler_mul24(void) OCL_MAP_BUFFER(2); for (int i = 0; i < n; ++i) - OCL_ASSERT(((int*)buf_data[2])[i] == ((src1[i] << 8) >> 8) * ((src2[i] << 8) >> 8)); + OCL_ASSERT(((int*)buf_data[2])[i] == (src1[i]) * (src2[i])); OCL_UNMAP_BUFFER(2); } -- cgit v1.2.1