xref: /freebsd/contrib/llvm-project/llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.h (revision 972a253a57b6f144b0e4a3e2080a2a0076ec55a0)
181ad6265SDimitry Andric //===- LoongArchMatInt.h - Immediate materialisation -  --------*- C++ -*--===//
281ad6265SDimitry Andric //
381ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
481ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
581ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
681ad6265SDimitry Andric //
781ad6265SDimitry Andric //===----------------------------------------------------------------------===//
881ad6265SDimitry Andric 
981ad6265SDimitry Andric #ifndef LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_MATINT_H
1081ad6265SDimitry Andric #define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_MATINT_H
1181ad6265SDimitry Andric 
1281ad6265SDimitry Andric #include "llvm/ADT/SmallVector.h"
1381ad6265SDimitry Andric #include <cstdint>
1481ad6265SDimitry Andric 
1581ad6265SDimitry Andric namespace llvm {
1681ad6265SDimitry Andric namespace LoongArchMatInt {
1781ad6265SDimitry Andric struct Inst {
1881ad6265SDimitry Andric   unsigned Opc;
1981ad6265SDimitry Andric   int64_t Imm;
InstInst2081ad6265SDimitry Andric   Inst(unsigned Opc, int64_t Imm) : Opc(Opc), Imm(Imm) {}
2181ad6265SDimitry Andric };
2281ad6265SDimitry Andric using InstSeq = SmallVector<Inst, 4>;
2381ad6265SDimitry Andric 
2481ad6265SDimitry Andric // Helper to generate an instruction sequence that will materialise the given
2581ad6265SDimitry Andric // immediate value into a register.
2681ad6265SDimitry Andric InstSeq generateInstSeq(int64_t Val);
27*972a253aSDimitry Andric } // end namespace LoongArchMatInt
28*972a253aSDimitry Andric } // end namespace llvm
2981ad6265SDimitry Andric 
3081ad6265SDimitry Andric #endif
31