107 lines · plain
1; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s2 3; CHECK-DAG: OpName [[VECTOR_SHL:%.+]] "vector_shl"4; CHECK-DAG: OpName [[VECTOR_LSHR:%.+]] "vector_lshr"5; CHECK-DAG: OpName [[VECTOR_ASHR:%.+]] "vector_ashr"6; CHECK-DAG: OpName [[VECTOR_AND:%.+]] "vector_and"7; CHECK-DAG: OpName [[VECTOR_OR:%.+]] "vector_or"8; CHECK-DAG: OpName [[VECTOR_XOR:%.+]] "vector_xor"9 10; CHECK-NOT: DAG-FENCE11 12; CHECK-DAG: [[I16:%.+]] = OpTypeInt 1613; CHECK-DAG: [[VECTOR:%.+]] = OpTypeVector [[I16]]14; CHECK-DAG: [[VECTOR_FN:%.+]] = OpTypeFunction [[VECTOR]] [[VECTOR]] [[VECTOR]]15 16; CHECK-NOT: DAG-FENCE17 18 19;; Test shl on vector:20define <2 x i16> @vector_shl(<2 x i16> %a, <2 x i16> %b) {21 %c = shl <2 x i16> %a, %b22 ret <2 x i16> %c23}24 25; CHECK: [[VECTOR_SHL]] = OpFunction [[VECTOR]] None [[VECTOR_FN]]26; CHECK-NEXT: [[A:%.+]] = OpFunctionParameter [[VECTOR]]27; CHECK-NEXT: [[B:%.+]] = OpFunctionParameter [[VECTOR]]28; CHECK: OpLabel29; CHECK: [[C:%.+]] = OpShiftLeftLogical [[VECTOR]] [[A]] [[B]]30; CHECK: OpReturnValue [[C]]31; CHECK-NEXT: OpFunctionEnd32 33 34;; Test lshr on vector:35define <2 x i16> @vector_lshr(<2 x i16> %a, <2 x i16> %b) {36 %c = lshr <2 x i16> %a, %b37 ret <2 x i16> %c38}39 40; CHECK: [[VECTOR_LSHR]] = OpFunction [[VECTOR]] None [[VECTOR_FN]]41; CHECK-NEXT: [[A:%.+]] = OpFunctionParameter [[VECTOR]]42; CHECK-NEXT: [[B:%.+]] = OpFunctionParameter [[VECTOR]]43; CHECK: OpLabel44; CHECK: [[C:%.+]] = OpShiftRightLogical [[VECTOR]] [[A]] [[B]]45; CHECK: OpReturnValue [[C]]46; CHECK-NEXT: OpFunctionEnd47 48 49;; Test ashr on vector:50define <2 x i16> @vector_ashr(<2 x i16> %a, <2 x i16> %b) {51 %c = ashr <2 x i16> %a, %b52 ret <2 x i16> %c53}54 55; CHECK: [[VECTOR_ASHR]] = OpFunction [[VECTOR]] None [[VECTOR_FN]]56; CHECK-NEXT: [[A:%.+]] = OpFunctionParameter [[VECTOR]]57; CHECK-NEXT: [[B:%.+]] = OpFunctionParameter [[VECTOR]]58; CHECK: OpLabel59; CHECK: [[C:%.+]] = OpShiftRightArithmetic [[VECTOR]] [[A]] [[B]]60; CHECK: OpReturnValue [[C]]61; CHECK-NEXT: OpFunctionEnd62 63 64;; Test and on vector:65define <2 x i16> @vector_and(<2 x i16> %a, <2 x i16> %b) {66 %c = and <2 x i16> %a, %b67 ret <2 x i16> %c68}69 70; CHECK: [[VECTOR_AND]] = OpFunction [[VECTOR]] None [[VECTOR_FN]]71; CHECK-NEXT: [[A:%.+]] = OpFunctionParameter [[VECTOR]]72; CHECK-NEXT: [[B:%.+]] = OpFunctionParameter [[VECTOR]]73; CHECK: OpLabel74; CHECK: [[C:%.+]] = OpBitwiseAnd [[VECTOR]] [[A]] [[B]]75; CHECK: OpReturnValue [[C]]76; CHECK-NEXT: OpFunctionEnd77 78 79;; Test or on vector:80define <2 x i16> @vector_or(<2 x i16> %a, <2 x i16> %b) {81 %c = or <2 x i16> %a, %b82 ret <2 x i16> %c83}84 85; CHECK: [[VECTOR_OR]] = OpFunction [[VECTOR]] None [[VECTOR_FN]]86; CHECK-NEXT: [[A:%.+]] = OpFunctionParameter [[VECTOR]]87; CHECK-NEXT: [[B:%.+]] = OpFunctionParameter [[VECTOR]]88; CHECK: OpLabel89; CHECK: [[C:%.+]] = OpBitwiseOr [[VECTOR]] [[A]] [[B]]90; CHECK: OpReturnValue [[C]]91; CHECK-NEXT: OpFunctionEnd92 93 94;; Test xor on vector:95define <2 x i16> @vector_xor(<2 x i16> %a, <2 x i16> %b) {96 %c = xor <2 x i16> %a, %b97 ret <2 x i16> %c98}99 100; CHECK: [[VECTOR_XOR]] = OpFunction [[VECTOR]] None [[VECTOR_FN]]101; CHECK-NEXT: [[A:%.+]] = OpFunctionParameter [[VECTOR]]102; CHECK-NEXT: [[B:%.+]] = OpFunctionParameter [[VECTOR]]103; CHECK: OpLabel104; CHECK: [[C:%.+]] = OpBitwiseXor [[VECTOR]] [[A]] [[B]]105; CHECK: OpReturnValue [[C]]106; CHECK-NEXT: OpFunctionEnd107