1 // RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/Common -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s
3 include "llvm/Target/Target.td"
4 include "GlobalISelEmitterCommon.td"
6 let TargetPrefix = "mytarget" in {
7 def int_mytarget_sleep0 : Intrinsic<[], [llvm_i32_ty], [ImmArg<ArgIndex<0>>]>;
10 // GISEL: GIM_CheckOpcode, /*MI*/0, TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS,
11 // GISEL-NEXT: // MIs[0] Operand 0
12 // GISEL-NEXT: GIM_CheckIntrinsicID, /*MI*/0, /*Op*/0, Intrinsic::mytarget_sleep0,
13 // GISEL-NEXT: // MIs[0] src
14 // GISEL-NEXT: GIM_CheckIsImm, /*MI*/0, /*Op*/1,
15 // GISEL-NEXT: GIM_CheckImmOperandPredicate, /*MI*/0, /*MO*/1, /*Predicate*/GICXXPred_I64_Predicate_tuimm9,
16 // GISEL-NEXT: // (intrinsic_void {{[0-9]+}}:{ *:[iPTR] }, (timm:{ *:[i32] })<<P:Predicate_tuimm9>>:$src) => (SLEEP0 (timm:{ *:[i32] }):$src)
17 // GISEL-NEXT: GIR_BuildMI, /*InsnID*/0, /*Opcode*/MyTarget::SLEEP0,
18 // GISEL-NEXT: GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/1, // src
19 def tuimm9 : TImmLeaf<i32, [{ return isUInt<9>(Imm); }]>;
20 def SLEEP0 : I<(outs), (ins i32imm:$src),
21 [(int_mytarget_sleep0 tuimm9:$src)]