/* * THIS FILE IS MACHINE_GENERATED. DO NOT EDIT. * See InstructionFormats.template, InstructionFormatList.dat, * OperatorList.dat, etc. */ package org.jikesrvm.compilers.opt.ir; import org.jikesrvm.VM_Configuration; import org.jikesrvm.compilers.opt.ir.ia32.OPT_IA32ConditionOperand; //NOPMD /** * The Prepare InstructionFormat class. * * The header comment for {@link OPT_Instruction} contains * an explanation of the role of InstructionFormats in the * opt compiler's IR. */ @SuppressWarnings("unused") // Machine generated code is never 100% clean public final class Prepare extends OPT_InstructionFormat { /** * InstructionFormat identification method for Prepare. * @param i an instruction * @return <code>true</code> if the InstructionFormat of the argument * instruction is Prepare or <code>false</code> * if it is not. */ public static boolean conforms(OPT_Instruction i) { return conforms(i.operator); } /** * InstructionFormat identification method for Prepare. * @param o an instruction * @return <code>true</code> if the InstructionFormat of the argument * operator is Prepare or <code>false</code> * if it is not. */ public static boolean conforms(OPT_Operator o) { return o.format == Prepare_format; } /** * Get the operand called Result from the * argument instruction. Note that the returned operand * will still point to its containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Result */ public static OPT_RegisterOperand getResult(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_RegisterOperand) i.getOperand(0); } /** * Get the operand called Result from the argument * instruction clearing its instruction pointer. The returned * operand will not point to any containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Result */ public static OPT_RegisterOperand getClearResult(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_RegisterOperand) i.getClearOperand(0); } /** * Set the operand called Result in the argument * instruction to the argument operand. The operand will * now point to the argument instruction as its containing * instruction. * @param i the instruction in which to store the operand * @param Result the operand to store */ public static void setResult(OPT_Instruction i, OPT_RegisterOperand Result) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); i.putOperand(0, Result); } /** * Return the index of the operand called Result * in the argument instruction. * @param i the instruction to access. * @return the index of the operand called Result * in the argument instruction */ public static int indexOfResult(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return 0; } /** * Does the argument instruction have a non-null * operand named Result? * @param i the instruction to access. * @return <code>true</code> if the instruction has an non-null * operand named Result or <code>false</code> * if it does not. */ public static boolean hasResult(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return i.getOperand(0) != null; } /** * Get the operand called Address from the * argument instruction. Note that the returned operand * will still point to its containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Address */ public static OPT_Operand getAddress(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_Operand) i.getOperand(1); } /** * Get the operand called Address from the argument * instruction clearing its instruction pointer. The returned * operand will not point to any containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Address */ public static OPT_Operand getClearAddress(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_Operand) i.getClearOperand(1); } /** * Set the operand called Address in the argument * instruction to the argument operand. The operand will * now point to the argument instruction as its containing * instruction. * @param i the instruction in which to store the operand * @param Address the operand to store */ public static void setAddress(OPT_Instruction i, OPT_Operand Address) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); i.putOperand(1, Address); } /** * Return the index of the operand called Address * in the argument instruction. * @param i the instruction to access. * @return the index of the operand called Address * in the argument instruction */ public static int indexOfAddress(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return 1; } /** * Does the argument instruction have a non-null * operand named Address? * @param i the instruction to access. * @return <code>true</code> if the instruction has an non-null * operand named Address or <code>false</code> * if it does not. */ public static boolean hasAddress(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return i.getOperand(1) != null; } /** * Get the operand called Offset from the * argument instruction. Note that the returned operand * will still point to its containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Offset */ public static OPT_Operand getOffset(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_Operand) i.getOperand(2); } /** * Get the operand called Offset from the argument * instruction clearing its instruction pointer. The returned * operand will not point to any containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Offset */ public static OPT_Operand getClearOffset(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_Operand) i.getClearOperand(2); } /** * Set the operand called Offset in the argument * instruction to the argument operand. The operand will * now point to the argument instruction as its containing * instruction. * @param i the instruction in which to store the operand * @param Offset the operand to store */ public static void setOffset(OPT_Instruction i, OPT_Operand Offset) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); i.putOperand(2, Offset); } /** * Return the index of the operand called Offset * in the argument instruction. * @param i the instruction to access. * @return the index of the operand called Offset * in the argument instruction */ public static int indexOfOffset(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return 2; } /** * Does the argument instruction have a non-null * operand named Offset? * @param i the instruction to access. * @return <code>true</code> if the instruction has an non-null * operand named Offset or <code>false</code> * if it does not. */ public static boolean hasOffset(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return i.getOperand(2) != null; } /** * Get the operand called Location from the * argument instruction. Note that the returned operand * will still point to its containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Location */ public static OPT_LocationOperand getLocation(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_LocationOperand) i.getOperand(3); } /** * Get the operand called Location from the argument * instruction clearing its instruction pointer. The returned * operand will not point to any containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Location */ public static OPT_LocationOperand getClearLocation(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_LocationOperand) i.getClearOperand(3); } /** * Set the operand called Location in the argument * instruction to the argument operand. The operand will * now point to the argument instruction as its containing * instruction. * @param i the instruction in which to store the operand * @param Location the operand to store */ public static void setLocation(OPT_Instruction i, OPT_LocationOperand Location) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); i.putOperand(3, Location); } /** * Return the index of the operand called Location * in the argument instruction. * @param i the instruction to access. * @return the index of the operand called Location * in the argument instruction */ public static int indexOfLocation(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return 3; } /** * Does the argument instruction have a non-null * operand named Location? * @param i the instruction to access. * @return <code>true</code> if the instruction has an non-null * operand named Location or <code>false</code> * if it does not. */ public static boolean hasLocation(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return i.getOperand(3) != null; } /** * Get the operand called Guard from the * argument instruction. Note that the returned operand * will still point to its containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Guard */ public static OPT_Operand getGuard(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_Operand) i.getOperand(4); } /** * Get the operand called Guard from the argument * instruction clearing its instruction pointer. The returned * operand will not point to any containing instruction. * @param i the instruction to fetch the operand from * @return the operand called Guard */ public static OPT_Operand getClearGuard(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return (OPT_Operand) i.getClearOperand(4); } /** * Set the operand called Guard in the argument * instruction to the argument operand. The operand will * now point to the argument instruction as its containing * instruction. * @param i the instruction in which to store the operand * @param Guard the operand to store */ public static void setGuard(OPT_Instruction i, OPT_Operand Guard) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); i.putOperand(4, Guard); } /** * Return the index of the operand called Guard * in the argument instruction. * @param i the instruction to access. * @return the index of the operand called Guard * in the argument instruction */ public static int indexOfGuard(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return 4; } /** * Does the argument instruction have a non-null * operand named Guard? * @param i the instruction to access. * @return <code>true</code> if the instruction has an non-null * operand named Guard or <code>false</code> * if it does not. */ public static boolean hasGuard(OPT_Instruction i) { if (VM_Configuration.ExtremeAssertions && !conforms(i)) fail(i, "Prepare"); return i.getOperand(4) != null; } /** * Create an instruction of the Prepare instruction format. * @param o the instruction's operator * @param Result the instruction's Result operand * @param Address the instruction's Address operand * @param Offset the instruction's Offset operand * @param Location the instruction's Location operand * @param Guard the instruction's Guard operand * @return the newly created Prepare instruction */ public static OPT_Instruction create(OPT_Operator o , OPT_RegisterOperand Result , OPT_Operand Address , OPT_Operand Offset , OPT_LocationOperand Location , OPT_Operand Guard ) { if (VM_Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Prepare"); OPT_Instruction i = new OPT_Instruction(o, 5); i.putOperand(0, Result); i.putOperand(1, Address); i.putOperand(2, Offset); i.putOperand(3, Location); i.putOperand(4, Guard); return i; } /** * Mutate the argument instruction into an instruction of the * Prepare instruction format having the specified * operator and operands. * @param i the instruction to mutate * @param o the instruction's operator * @param Result the instruction's Result operand * @param Address the instruction's Address operand * @param Offset the instruction's Offset operand * @param Location the instruction's Location operand * @param Guard the instruction's Guard operand * @return the mutated instruction */ public static OPT_Instruction mutate(OPT_Instruction i, OPT_Operator o , OPT_RegisterOperand Result , OPT_Operand Address , OPT_Operand Offset , OPT_LocationOperand Location , OPT_Operand Guard ) { if (VM_Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Prepare"); i.operator = o; i.putOperand(0, Result); i.putOperand(1, Address); i.putOperand(2, Offset); i.putOperand(3, Location); i.putOperand(4, Guard); return i; } /** * Create an instruction of the Prepare instruction format. * @param o the instruction's operator * @param Result the instruction's Result operand * @param Address the instruction's Address operand * @param Offset the instruction's Offset operand * @param Location the instruction's Location operand * @return the newly created Prepare instruction */ public static OPT_Instruction create(OPT_Operator o , OPT_RegisterOperand Result , OPT_Operand Address , OPT_Operand Offset , OPT_LocationOperand Location ) { if (VM_Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Prepare"); OPT_Instruction i = new OPT_Instruction(o, 5); i.putOperand(0, Result); i.putOperand(1, Address); i.putOperand(2, Offset); i.putOperand(3, Location); return i; } /** * Mutate the argument instruction into an instruction of the * Prepare instruction format having the specified * operator and operands. * @param i the instruction to mutate * @param o the instruction's operator * @param Result the instruction's Result operand * @param Address the instruction's Address operand * @param Offset the instruction's Offset operand * @param Location the instruction's Location operand * @return the mutated instruction */ public static OPT_Instruction mutate(OPT_Instruction i, OPT_Operator o , OPT_RegisterOperand Result , OPT_Operand Address , OPT_Operand Offset , OPT_LocationOperand Location ) { if (VM_Configuration.ExtremeAssertions && !conforms(o)) fail(o, "Prepare"); i.operator = o; i.putOperand(0, Result); i.putOperand(1, Address); i.putOperand(2, Offset); i.putOperand(3, Location); i.putOperand(4, null); return i; } }