{
public:
INLINE BranchInstruction(Opcode op, LabelIndex labelIndex, Register predicate, bool inv_pred=false) {
- GBE_ASSERT(op == OP_BRA || op == OP_IF);
+ GBE_ASSERT(op == OP_BRA || op == OP_IF || op == OP_WHILE);
this->opcode = op;
this->predicate = predicate;
this->labelIndex = labelIndex;
return internal::BranchInstruction(OP_ENDIF, labelIndex).convert();
}
+ // WHILE
+ Instruction WHILE(LabelIndex labelIndex, Register pred) {
+ return internal::BranchInstruction(OP_WHILE, labelIndex, pred).convert();
+ }
+
// RET
Instruction RET(void) {
return internal::BranchInstruction(OP_RET).convert();
Instruction ELSE(LabelIndex labelIndex);
/*! endif */
Instruction ENDIF(LabelIndex labelIndex);
+ /*! (pred) while labelIndex */
+ Instruction WHILE(LabelIndex labelIndex, Register pred);
/*! ret */
Instruction RET(void);
/*! load.type.space {dst1,...,dst_valueNum} offset value */
DECL_INSN(IF, BranchInstruction)
DECL_INSN(ENDIF, BranchInstruction)
DECL_INSN(ELSE, BranchInstruction)
+DECL_INSN(WHILE, BranchInstruction)