brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 1b0e075 Raw
42 lines · c
1//===-- VEInstrBuilder.h - Aides for building VE insts ----------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// This file exposes functions that may be used with BuildMI from the10// MachineInstrBuilder.h file to simplify generating frame and constant pool11// references.12//13// For reference, the order of operands for memory references is:14// (Operand), Dest Reg, Base Reg, and either Reg Index or Immediate15// Displacement.16//17//===----------------------------------------------------------------------===//18 19#ifndef LLVM_LIB_TARGET_VE_VEINSTRBUILDER_H20#define LLVM_LIB_TARGET_VE_VEINSTRBUILDER_H21 22#include "llvm/CodeGen/MachineInstrBuilder.h"23 24namespace llvm {25 26/// addFrameReference - This function is used to add a reference to the base of27/// an abstract object on the stack frame of the current function.  This28/// reference has base register as the FrameIndex offset until it is resolved.29/// This allows a constant offset to be specified as well...30///31static inline const MachineInstrBuilder &32addFrameReference(const MachineInstrBuilder &MIB, int FI, int Offset = 0,33                  bool ThreeOp = true) {34  if (ThreeOp)35    return MIB.addFrameIndex(FI).addImm(0).addImm(Offset);36  return MIB.addFrameIndex(FI).addImm(Offset);37}38 39} // namespace llvm40 41#endif42