saturated conversion of native GPU data type, larger to narrower
authorHomer Hsing <homer.xing@intel.com>
Thu, 10 Oct 2013 02:13:41 +0000 (10:13 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Thu, 10 Oct 2013 05:22:38 +0000 (13:22 +0800)
commit04efbda63e00bef950ac35dde9285b3002ba9ba4
treea50955c21d1472ed231e009b7f0e591fdff2fd51
parent1ad7e368cf9e1ac2f5256b70b20e1e46a06a92e0
saturated conversion of native GPU data type, larger to narrower

This patch supports saturated conversion of
native GPU data type (char/short/int/float),
from a larger-range data type to a narrower-range data type.
For instance,  convert_uchar_sat(int)

Several test cases are in this patch.

v2: add uint->int, int->uint

Signed-off-by: Homer Hsing <homer.xing@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
backend/src/backend/gen_insn_selection.cpp
backend/src/ir/instruction.cpp
backend/src/ir/instruction.hpp
backend/src/ir/instruction.hxx
backend/src/llvm/llvm_gen_backend.cpp
backend/src/llvm/llvm_gen_ocl_function.hxx
backend/src/ocl_stdlib.tmpl.h
kernels/builtin_convert_sat.cl [new file with mode: 0644]
utests/CMakeLists.txt
utests/builtin_convert_sat.cpp [new file with mode: 0644]