diff options
author | Guo Yejun <yejun.guo@intel.com> | 2015-05-12 16:27:49 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-05-12 17:20:00 +0800 |
commit | 7179227e123b028cb9e63eb8d9eb97af0fa4be38 (patch) | |
tree | 29004285e787d8722f186ea0be8e27c9eb67a88c /backend/src/llvm/llvm_gen_backend.cpp | |
parent | 9eb83c751b070268d077c5b71a25fee6ca1676f9 (diff) |
add sub group functions intel_sub_group_shuffle
floatN intel_sub_group_shuffle(floatN x, uint c);
intN intel_sub_group_shuffle(intN x, uint c);
uintN intel_sub_group_shuffle(uintN x, uint c);
the value of x of the c-th channel of the SIMD is returned, for all SIMD channels,
the behavior is undefined if c is larger than simdsize - 1
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'backend/src/llvm/llvm_gen_backend.cpp')
-rw-r--r-- | backend/src/llvm/llvm_gen_backend.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/backend/src/llvm/llvm_gen_backend.cpp b/backend/src/llvm/llvm_gen_backend.cpp index f46bc793..f5743ba3 100644 --- a/backend/src/llvm/llvm_gen_backend.cpp +++ b/backend/src/llvm/llvm_gen_backend.cpp @@ -2807,6 +2807,7 @@ namespace gbe case GEN_OCL_READ_TM: case GEN_OCL_REGION: case GEN_OCL_SIMD_ID: + case GEN_OCL_SIMD_SHUFFLE: this->newRegister(&I); break; case GEN_OCL_PRINTF: @@ -3468,6 +3469,14 @@ namespace gbe ctx.ALU0(ir::OP_SIMD_ID, getType(ctx, I.getType()), dst); break; } + case GEN_OCL_SIMD_SHUFFLE: + { + const ir::Register src0 = this->getRegister(*AI); ++AI; + const ir::Register src1 = this->getRegister(*AI); ++AI; + const ir::Register dst = this->getRegister(&I); + ctx.SIMD_SHUFFLE(getType(ctx, I.getType()), dst, src0, src1); + break; + } default: break; } } |