aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/llvm16/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.h
blob: be1b425894de1a70d0c977fb37ba8840387d27e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//===- LoongArchMatInt.h - Immediate materialisation -  --------*- C++ -*--===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_MATINT_H
#define LLVM_LIB_TARGET_LOONGARCH_MCTARGETDESC_MATINT_H

#include "llvm/ADT/SmallVector.h"
#include <cstdint>

namespace llvm {
namespace LoongArchMatInt {
struct Inst {
  unsigned Opc;
  int64_t Imm;
  Inst(unsigned Opc, int64_t Imm) : Opc(Opc), Imm(Imm) {}
};
using InstSeq = SmallVector<Inst, 4>;

// Helper to generate an instruction sequence that will materialise the given
// immediate value into a register.
InstSeq generateInstSeq(int64_t Val);
} // end namespace LoongArchMatInt
} // end namespace llvm

#endif