1//===- AArch64ExpandImm.h - AArch64 Immediate Expansion ---------*- 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-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file contains the AArch64 immediate expansion stuff.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_AARCH64_MCTARGETDESC_AARCH64EXPANDIMM_H
14#define LLVM_LIB_TARGET_AARCH64_MCTARGETDESC_AARCH64EXPANDIMM_H
15
16#include "llvm/ADT/APInt.h"
17#include "llvm/ADT/SmallVector.h"
18
19namespace llvm {
20
21class AArch64Subtarget;
22
23namespace AArch64_IMM {
24
25struct ImmInsnModel {
26 unsigned Opcode;
27 std::optional<uint32_t> Op1;
28 std::optional<uint32_t> Op2;
29};
30
31struct AddrInsnModel {
32 unsigned Opcode;
33};
34
35void expandMOVImm(uint64_t Imm, unsigned BitSize,
36 SmallVectorImpl<ImmInsnModel> &Insn);
37
38void expandMOVAddr(unsigned Opcode, unsigned TargetFlags, bool IsTargetMachO,
39 SmallVectorImpl<AddrInsnModel> &Insn);
40
41bool expandVectorMOVImm(APInt Imm, SmallVectorImpl<ImmInsnModel> &Insn,
42 const AArch64Subtarget &ST);
43
44} // end namespace AArch64_IMM
45
46} // end namespace llvm
47
48#endif
49