blob: 5e67fe6a5f3a5507a711aac64686a35220fbf90a [file]
; RUN: clspv-opt -ReplaceOpenCLBuiltin %s -o %t.ll
; RUN: FileCheck %s < %t.ll
; AUTO-GENERATED TEST FILE
; This test was generated by add_sat_test_gen.cpp.
; Please modify the that file and regenerate the tests to make changes.
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spir-unknown-unknown"
define <3 x i8> @rhadd_uchar3(<3 x i8> %a, <3 x i8> %b) {
entry:
%call = call <3 x i8> @_Z5rhaddDv3_hS_(<3 x i8> %a, <3 x i8> %b)
ret <3 x i8> %call
}
declare <3 x i8> @_Z5rhaddDv3_hS_(<3 x i8>, <3 x i8>)
; CHECK: [[a_shr:%[a-zA_Z0-9_.]+]] = lshr <3 x i8> %a, <i8 1, i8 1, i8 1>
; CHECK: [[b_shr:%[a-zA-Z0-9_.]+]] = lshr <3 x i8> %b, <i8 1, i8 1, i8 1>
; CHECK: [[add:%[a-zA-Z0-9_.]+]] = add <3 x i8> [[a_shr]], [[b_shr]]
; CHECK: [[join:%[a-zA-Z0-9_.]+]] = or <3 x i8> %a, %b
; CHECK: [[and:%[a-zA-Z0-9_.]+]] = and <3 x i8> [[join]], <i8 1, i8 1, i8 1>
; CHECK: [[hadd:%[a-zA-Z0-9_.]+]] = add <3 x i8> [[add]], [[and]]
; CHECK: ret <3 x i8> [[hadd]]