36 */ 37 public class HSAILControlFlow { 38 39 public static class ReturnOp extends HSAILLIRInstruction { 40 41 @Use({REG, ILLEGAL}) protected Value x; 42 43 public ReturnOp(Value x) { 44 this.x = x; 45 } 46 47 @Override 48 public void emitCode(TargetMethodAssembler tasm, HSAILAssembler masm) { 49 if (tasm.frameContext != null) { 50 tasm.frameContext.leave(tasm); 51 } 52 masm.exit(); 53 } 54 } 55 56 public static class CompareBranchOp extends HSAILLIRInstruction implements StandardOp.BranchOp { 57 58 @Opcode protected final HSAILCompare opcode; 59 @Use({REG, CONST}) protected Value x; 60 @Use({REG, CONST}) protected Value y; 61 @Def({REG}) protected Value z; 62 protected Condition condition; 63 protected LabelRef destination; 64 protected boolean unordered = false; 65 @Def({REG}) protected Value result; 66 67 public CompareBranchOp(HSAILCompare opcode, Condition condition, Value x, Value y, Value z, Value result, LabelRef destination) { 68 this.condition = condition; 69 this.opcode = opcode; 70 this.x = x; 71 this.y = y; 72 this.z = z; 73 this.result = result; 74 this.destination = destination; 75 } | 36 */ 37 public class HSAILControlFlow { 38 39 public static class ReturnOp extends HSAILLIRInstruction { 40 41 @Use({REG, ILLEGAL}) protected Value x; 42 43 public ReturnOp(Value x) { 44 this.x = x; 45 } 46 47 @Override 48 public void emitCode(TargetMethodAssembler tasm, HSAILAssembler masm) { 49 if (tasm.frameContext != null) { 50 tasm.frameContext.leave(tasm); 51 } 52 masm.exit(); 53 } 54 } 55 56 57 public static class ForeignCallNoOp0 extends HSAILLIRInstruction { 58 59 @Def({REG}) protected Value out; 60 String callName; 61 62 public ForeignCallNoOp0(String callName, Value out) { 63 this.out = out; 64 this.callName = callName; 65 } 66 67 @Override 68 public void emitCode(TargetMethodAssembler tasm, HSAILAssembler masm) { 69 masm.emitComment("//ForeignCall to " + callName + " would have gone here"); 70 } 71 } 72 73 public static class ForeignCallNoOp1 extends ForeignCallNoOp0 { 74 75 @Use({REG, ILLEGAL}) protected Value arg1; 76 77 public ForeignCallNoOp1(String callName, Value out, Value arg1) { 78 super(callName, out); 79 this.arg1 = arg1; 80 } 81 } 82 83 84 public static class CompareBranchOp extends HSAILLIRInstruction implements StandardOp.BranchOp { 85 86 @Opcode protected final HSAILCompare opcode; 87 @Use({REG, CONST}) protected Value x; 88 @Use({REG, CONST}) protected Value y; 89 @Def({REG}) protected Value z; 90 protected Condition condition; 91 protected LabelRef destination; 92 protected boolean unordered = false; 93 @Def({REG}) protected Value result; 94 95 public CompareBranchOp(HSAILCompare opcode, Condition condition, Value x, Value y, Value z, Value result, LabelRef destination) { 96 this.condition = condition; 97 this.opcode = opcode; 98 this.x = x; 99 this.y = y; 100 this.z = z; 101 this.result = result; 102 this.destination = destination; 103 } |