brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1019 B · 3a3c12c Raw
32 lines · c
1//===- LoongArchMatInt.h - Immediate materialisation -  --------*- 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#ifndef LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_MATINT_H10#define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_MATINT_H11 12#include "llvm/ADT/SmallVector.h"13#include <cstdint>14 15namespace llvm {16namespace LoongArchMatInt {17struct Inst {18  unsigned Opc;19  // Imm: Opc's imm operand, if Opc == BSTRINS_D, Imm = MSB << 32 | LSB.20  int64_t Imm;21  Inst(unsigned Opc, int64_t Imm) : Opc(Opc), Imm(Imm) {}22};23using InstSeq = SmallVector<Inst, 4>;24 25// Helper to generate an instruction sequence that will materialise the given26// immediate value into a register.27InstSeq generateInstSeq(int64_t Val);28} // end namespace LoongArchMatInt29} // end namespace llvm30 31#endif32