1 // RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefixes=GISEL-NOOPT %s
2 // RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns -optimize-match-table=true -I %p/../../include -I %p/Common %s -o - | FileCheck -check-prefixes=GISEL-OPT %s
4 include "llvm/Target/Target.td"
5 include "GlobalISelEmitterCommon.td"
7 // GISEL-OPT: GIM_SwitchOpcode
8 // GISEL-OPT-NEXT: /*TargetOpcode::G_SHL*/
9 // GISEL-OPT-NEXT: /*TargetOpcode::G_LSHR*/
10 // GISEL-OPT-NEXT: // Label
13 // GISEL-OPT: GIM_Try,
14 // GISEL-OPT: GIM_CheckType, /*MI*/0, /*Op*/2, /*Type*/GILLT_v4s16,
15 // GISEL-OPT: GIM_CheckOpcodeIsEither, /*MI*/1, TargetOpcode::G_BUILD_VECTOR, TargetOpcode::G_BUILD_VECTOR_TRUNC,
16 // GISEL-OPT: GIM_CheckIsBuildVectorAllZeros, /*MI*/1,
18 // GISEL-OPT: GIM_Try,
19 // GISEL-OPT: GIM_CheckType, /*MI*/0, /*Op*/2, /*Type*/GILLT_v4s16,
20 // GISEL-OPT: GIM_CheckOpcodeIsEither, /*MI*/1, TargetOpcode::G_BUILD_VECTOR, TargetOpcode::G_BUILD_VECTOR_TRUNC,
21 // GISEL-OPT: GIM_CheckIsBuildVectorAllOnes, /*MI*/1,
25 // GISEL-NOOPT: GIM_CheckOpcode, /*MI*/0, TargetOpcode::G_LSHR,
26 // GISEL-NOOPT: // MIs[0] Operand 2
27 // GISEL-NOOPT-NEXT: GIM_CheckType, /*MI*/0, /*Op*/2, /*Type*/GILLT_v4s16,
28 // GISEL-NOOPT-NEXT: GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
29 // GISEL-NOOPT-NEXT: GIM_CheckOpcodeIsEither, /*MI*/1, TargetOpcode::G_BUILD_VECTOR, TargetOpcode::G_BUILD_VECTOR_TRUNC,
30 // GISEL-NOOPT-NEXT: GIM_CheckIsBuildVectorAllOnes, /*MI*/1,
31 // GISEL-NOOPT-NEXT: // MIs[1] Operand 0
32 // GISEL-NOOPT-NEXT: GIM_CheckType, /*MI*/1, /*Op*/0, /*Type*/GILLT_v4s16,
33 // GISEL-NOOPT-NEXT: GIM_CheckIsSafeToFold, /*InsnID*/1,
34 // GISEL-NOOPT-NEXT: // (srl:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$src0, immAllOnesV:{ *:[v4i16] }) => (VFOOONES:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$src0)
35 def VFOOONES : I<(outs VecReg128:$dst), (ins VecReg128:$src0),
36 [(set v4i32:$dst, (srl v4i32:$src0, (v4i16 immAllOnesV)))]
40 // GISEL-NOOPT: GIM_CheckOpcode, /*MI*/0, TargetOpcode::G_SHL,
41 // GISEL-NOOPT: // MIs[0] Operand 2
42 // GISEL-NOOPT-NEXT: GIM_CheckType, /*MI*/0, /*Op*/2, /*Type*/GILLT_v4s16,
43 // GISEL-NOOPT-NEXT: GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
44 // GISEL-NOOPT-NEXT: GIM_CheckOpcodeIsEither, /*MI*/1, TargetOpcode::G_BUILD_VECTOR, TargetOpcode::G_BUILD_VECTOR_TRUNC,
45 // GISEL-NOOPT-NEXT: GIM_CheckIsBuildVectorAllZeros, /*MI*/1,
46 // GISEL-NOOPT-NEXT: // MIs[1] Operand 0
47 // GISEL-NOOPT-NEXT: GIM_CheckType, /*MI*/1, /*Op*/0, /*Type*/GILLT_v4s16,
48 // GISEL-NOOPT-NEXT: GIM_CheckIsSafeToFold, /*InsnID*/1,
49 // GISEL-NOOPT-NEXT: // (shl:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$src0, immAllZerosV:{ *:[v4i16] }) => (VFOOZERO:{ *:[v4i32] } v4i32:{ *:[v4i32] }:$src0)
50 def VFOOZERO : I<(outs VecReg128:$dst), (ins VecReg128:$src0),
51 [(set v4i32:$dst, (shl v4i32:$src0, (v4i16 immAllZerosV)))]