Added llvmgcc version to allow tests to be xfailed by frontend version.
[llvm-complete.git] / lib / Target / PowerPC / PPCInstrBuilder.h
blobb97178f52cb78e2b87e05deaa87245fb48c4ab15
1 //===-- PPCInstrBuilder.h - Aides for building PPC insts --------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file exposes functions that may be used with BuildMI from the
11 // MachineInstrBuilder.h file to simplify generating frame and constant pool
12 // references.
14 // For reference, the order of operands for memory references is:
15 // (Operand), Dest Reg, Base Reg, and either Reg Index or Immediate
16 // Displacement.
18 //===----------------------------------------------------------------------===//
20 #ifndef POWERPC_INSTRBUILDER_H
21 #define POWERPC_INSTRBUILDER_H
23 #include "llvm/CodeGen/MachineInstrBuilder.h"
25 namespace llvm {
27 /// addFrameReference - This function is used to add a reference to the base of
28 /// an abstract object on the stack frame of the current function. This
29 /// reference has base register as the FrameIndex offset until it is resolved.
30 /// This allows a constant offset to be specified as well...
31 ///
32 inline const MachineInstrBuilder&
33 addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0,
34 bool mem = true) {
35 if (mem)
36 return MIB.addSImm(Offset).addFrameIndex(FI);
37 else
38 return MIB.addFrameIndex(FI).addSImm(Offset);
41 /// addConstantPoolReference - This function is used to add a reference to the
42 /// base of a constant value spilled to the per-function constant pool. The
43 /// reference has base register ConstantPoolIndex offset which is retained until
44 /// either machine code emission or assembly output. This allows an optional
45 /// offset to be added as well.
46 ///
47 inline const MachineInstrBuilder&
48 addConstantPoolReference(const MachineInstrBuilder &MIB, unsigned CPI,
49 int Offset = 0) {
50 return MIB.addSImm(Offset).addConstantPoolIndex(CPI);
53 } // End llvm namespace
55 #endif