There was an issue with encoding wide (>64 bit) instructions on BigEndian hosts, which is fixed in D127195. Therefore reland this. gfx11 adds the ability to use dpp modifiers on vop3 instructions. This patch adds machine code layer support for that. The MCCodeEmitter is changed to use APInt instead of uint64_t to support these wider instructions. Patch 16/N for upstreaming of AMDGPU gfx11 architecture Differential Revision: https://reviews.llvm.org/D126483
77 lines
2.8 KiB
C++
77 lines
2.8 KiB
C++
//===-- AMDGPUCodeEmitter.h - AMDGPU Code Emitter interface -----*- 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
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
/// \file
|
|
/// CodeEmitter interface for SI codegen.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
|
|
#define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
|
|
|
|
#include "llvm/ADT/APInt.h"
|
|
#include "llvm/MC/MCCodeEmitter.h"
|
|
#include <cstdint>
|
|
|
|
namespace llvm {
|
|
|
|
class MCInst;
|
|
class MCInstrInfo;
|
|
class MCOperand;
|
|
class MCSubtargetInfo;
|
|
class FeatureBitset;
|
|
|
|
class AMDGPUMCCodeEmitter : public MCCodeEmitter {
|
|
virtual void anchor();
|
|
|
|
protected:
|
|
const MCInstrInfo &MCII;
|
|
|
|
AMDGPUMCCodeEmitter(const MCInstrInfo &mcii) : MCII(mcii) {}
|
|
|
|
public:
|
|
void getBinaryCodeForInstr(const MCInst &MI, SmallVectorImpl<MCFixup> &Fixups,
|
|
APInt &Inst, APInt &Scratch,
|
|
const MCSubtargetInfo &STI) const;
|
|
|
|
virtual void getMachineOpValue(const MCInst &MI, const MCOperand &MO,
|
|
APInt &Op, SmallVectorImpl<MCFixup> &Fixups,
|
|
const MCSubtargetInfo &STI) const = 0;
|
|
|
|
virtual void getSOPPBrEncoding(const MCInst &MI, unsigned OpNo, APInt &Op,
|
|
SmallVectorImpl<MCFixup> &Fixups,
|
|
const MCSubtargetInfo &STI) const = 0;
|
|
|
|
virtual void getSMEMOffsetEncoding(const MCInst &MI, unsigned OpNo, APInt &Op,
|
|
SmallVectorImpl<MCFixup> &Fixups,
|
|
const MCSubtargetInfo &STI) const = 0;
|
|
|
|
virtual void getSDWASrcEncoding(const MCInst &MI, unsigned OpNo, APInt &Op,
|
|
SmallVectorImpl<MCFixup> &Fixups,
|
|
const MCSubtargetInfo &STI) const = 0;
|
|
|
|
virtual void getSDWAVopcDstEncoding(const MCInst &MI, unsigned OpNo,
|
|
APInt &Op,
|
|
SmallVectorImpl<MCFixup> &Fixups,
|
|
const MCSubtargetInfo &STI) const = 0;
|
|
|
|
virtual void getAVOperandEncoding(const MCInst &MI, unsigned OpNo, APInt &Op,
|
|
SmallVectorImpl<MCFixup> &Fixups,
|
|
const MCSubtargetInfo &STI) const = 0;
|
|
|
|
protected:
|
|
FeatureBitset computeAvailableFeatures(const FeatureBitset &FB) const;
|
|
void
|
|
verifyInstructionPredicates(const MCInst &MI,
|
|
const FeatureBitset &AvailableFeatures) const;
|
|
};
|
|
|
|
} // End namespace llvm
|
|
|
|
#endif
|