001
002/*
003 * THIS FILE IS MACHINE_GENERATED. DO NOT EDIT.
004 * See InstructionFormats.template, InstructionFormatList.dat,
005 * OperatorList.dat, etc.
006 */
007
008package org.jikesrvm.compilers.opt.ir.ia32;
009
010import org.jikesrvm.Configuration;
011import org.jikesrvm.compilers.opt.ir.operand.ia32.IA32ConditionOperand;
012import org.jikesrvm.compilers.opt.ir.operand.*;
013import org.jikesrvm.compilers.opt.ir.Instruction;
014import org.jikesrvm.compilers.opt.ir.Operator;
015
016/**
017 * The MIR_CacheOp InstructionFormat class.
018 *
019 * The header comment for {@link Instruction} contains
020 * an explanation of the role of InstructionFormats in the
021 * opt compiler's IR.
022 */
023@SuppressWarnings("unused")  // Machine generated code is never 100% clean
024public final class MIR_CacheOp extends ArchInstructionFormat {
025  /**
026   * InstructionFormat identification method for MIR_CacheOp.
027   * @param i an instruction
028   * @return <code>true</code> if the InstructionFormat of the argument
029   *         instruction is MIR_CacheOp or <code>false</code>
030   *         if it is not.
031   */
032  public static boolean conforms(Instruction i) {
033    return conforms(i.operator());
034  }
035  /**
036   * InstructionFormat identification method for MIR_CacheOp.
037   * @param o an instruction
038   * @return <code>true</code> if the InstructionFormat of the argument
039   *         operator is MIR_CacheOp or <code>false</code>
040   *         if it is not.
041   */
042  public static boolean conforms(Operator o) {
043    return o.format == MIR_CacheOp_format;
044  }
045
046  /**
047   * Get the operand called Address from the
048   * argument instruction. Note that the returned operand
049   * will still point to its containing instruction.
050   * @param i the instruction to fetch the operand from
051   * @return the operand called Address
052   */
053  public static Operand getAddress(Instruction i) {
054    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_CacheOp");
055    return (Operand) i.getOperand(0);
056  }
057  /**
058   * Get the operand called Address from the argument
059   * instruction clearing its instruction pointer. The returned
060   * operand will not point to any containing instruction.
061   * @param i the instruction to fetch the operand from
062   * @return the operand called Address
063   */
064  public static Operand getClearAddress(Instruction i) {
065    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_CacheOp");
066    return (Operand) i.getClearOperand(0);
067  }
068  /**
069   * Set the operand called Address in the argument
070   * instruction to the argument operand. The operand will
071   * now point to the argument instruction as its containing
072   * instruction.
073   * @param i the instruction in which to store the operand
074   * @param Address the operand to store
075   */
076  public static void setAddress(Instruction i, Operand Address) {
077    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_CacheOp");
078    i.putOperand(0, Address);
079  }
080  /**
081   * Return the index of the operand called Address
082   * in the argument instruction.
083   * @param i the instruction to access.
084   * @return the index of the operand called Address
085   *         in the argument instruction
086   */
087  public static int indexOfAddress(Instruction i) {
088    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_CacheOp");
089    return 0;
090  }
091  /**
092   * Does the argument instruction have a non-null
093   * operand named Address?
094   * @param i the instruction to access.
095   * @return <code>true</code> if the instruction has an non-null
096   *         operand named Address or <code>false</code>
097   *         if it does not.
098   */
099  public static boolean hasAddress(Instruction i) {
100    if (Configuration.ExtremeAssertions && !conforms(i)) fail(i, "MIR_CacheOp");
101    return i.getOperand(0) != null;
102  }
103
104
105  /**
106   * Create an instruction of the MIR_CacheOp instruction format.
107   * @param o the instruction's operator
108   * @param Address the instruction's Address operand
109   * @return the newly created MIR_CacheOp instruction
110   */
111  public static Instruction create(Operator o
112                   , Operand Address
113                )
114  {
115    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_CacheOp");
116    Instruction i = Instruction.create(o, 5);
117    i.putOperand(0, Address);
118    return i;
119  }
120
121  /**
122   * Mutate the argument instruction into an instruction of the
123   * MIR_CacheOp instruction format having the specified
124   * operator and operands.
125   * @param i the instruction to mutate
126   * @param o the instruction's operator
127   * @param Address the instruction's Address operand
128   * @return the mutated instruction
129   */
130  public static Instruction mutate(Instruction i, Operator o
131                   , Operand Address
132                )
133  {
134    if (Configuration.ExtremeAssertions && !conforms(o)) fail(o, "MIR_CacheOp");
135    i.changeOperatorTo(o);
136    i.putOperand(0, Address);
137    return i;
138  }
139}
140
141
142