2012-12-12 05:25:42 +08:00
|
|
|
//===-- AMDGPUInstrInfo.h - AMDGPU Instruction Information ------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
/// \file
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Contains the definition of a TargetInstrInfo class that is common
|
2012-12-12 05:25:42 +08:00
|
|
|
/// to all AMD GPUs.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-03-11 16:00:27 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
|
|
|
|
#define LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2017-03-27 22:04:01 +08:00
|
|
|
#include "AMDGPU.h"
|
2016-10-07 22:46:06 +08:00
|
|
|
#include "Utils/AMDGPUBaseInfo.h"
|
2017-11-08 09:01:31 +08:00
|
|
|
#include "llvm/CodeGen/TargetInstrInfo.h"
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
#define GET_INSTRINFO_HEADER
|
|
|
|
#include "AMDGPUGenInstrInfo.inc"
|
2017-12-14 05:07:51 +08:00
|
|
|
#undef GET_INSTRINFO_HEADER
|
2012-12-12 05:25:42 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2014-06-13 09:32:00 +08:00
|
|
|
class AMDGPUSubtarget;
|
2012-12-12 05:25:42 +08:00
|
|
|
class MachineFunction;
|
|
|
|
class MachineInstr;
|
|
|
|
class MachineInstrBuilder;
|
|
|
|
|
|
|
|
class AMDGPUInstrInfo : public AMDGPUGenInstrInfo {
|
|
|
|
private:
|
2014-06-13 09:32:00 +08:00
|
|
|
const AMDGPUSubtarget &ST;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2016-06-24 14:30:11 +08:00
|
|
|
virtual void anchor();
|
2017-03-27 22:04:01 +08:00
|
|
|
protected:
|
|
|
|
AMDGPUAS AMDGPUASI;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2014-09-15 23:41:53 +08:00
|
|
|
public:
|
2016-06-24 14:30:11 +08:00
|
|
|
explicit AMDGPUInstrInfo(const AMDGPUSubtarget &st);
|
|
|
|
|
2012-12-12 05:25:42 +08:00
|
|
|
bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2,
|
|
|
|
int64_t Offset1, int64_t Offset2,
|
2014-04-29 15:57:24 +08:00
|
|
|
unsigned NumLoads) const override;
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2018-05-01 23:54:18 +08:00
|
|
|
/// Return a target-specific opcode if Opcode is a pseudo instruction.
|
2015-01-16 02:42:51 +08:00
|
|
|
/// Return -1 if the target-specific opcode for the pseudo instruction does
|
|
|
|
/// not exist. If Opcode is not a pseudo instruction, this is identity.
|
|
|
|
int pseudoToMCOpcode(int Opcode) const;
|
2018-02-10 00:57:48 +08:00
|
|
|
|
|
|
|
static bool isUniformMMO(const MachineMemOperand *MMO);
|
2012-12-12 05:25:42 +08:00
|
|
|
};
|
AMDGPU: Make getTgtMemIntrinsic table-driven for resource-based intrinsics
Summary:
Avoids having to list all intrinsics manually.
This is in preparation for the new dimension-aware image intrinsics,
which I'd rather not have to list here by hand.
Change-Id: If7ced04998397ef68c4cb8f7de66b5050fb767e5
Reviewers: arsenm, rampitec, b-sumner
Subscribers: kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D44937
llvm-svn: 328938
2018-04-02 01:09:07 +08:00
|
|
|
|
|
|
|
namespace AMDGPU {
|
|
|
|
|
|
|
|
struct RsrcIntrinsic {
|
|
|
|
unsigned Intr;
|
|
|
|
uint8_t RsrcArg;
|
|
|
|
bool IsImage;
|
|
|
|
};
|
|
|
|
const RsrcIntrinsic *lookupRsrcIntrinsicByIntr(unsigned Intr);
|
|
|
|
|
AMDGPU: Dimension-aware image intrinsics
Summary:
These new image intrinsics contain the texture type as part of
their name and have each component of the address/coordinate as
individual parameters.
This is a preparatory step for implementing the A16 feature, where
coordinates are passed as half-floats or -ints, but the Z compare
value and texel offsets are still full dwords, making it difficult
or impossible to distinguish between A16 on or off in the old-style
intrinsics.
Additionally, these intrinsics pass the 'texfailpolicy' and
'cachectrl' as i32 bit fields to reduce operand clutter and allow
for future extensibility.
v2:
- gather4 supports 2darray images
- fix a bug with 1D images on SI
Change-Id: I099f309e0a394082a5901ea196c3967afb867f04
Reviewers: arsenm, rampitec, b-sumner
Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D44939
llvm-svn: 329166
2018-04-04 18:58:54 +08:00
|
|
|
struct D16ImageDimIntrinsic {
|
|
|
|
unsigned Intr;
|
|
|
|
unsigned D16HelperIntr;
|
|
|
|
};
|
|
|
|
const D16ImageDimIntrinsic *lookupD16ImageDimIntrinsicByIntr(unsigned Intr);
|
|
|
|
|
AMDGPU: Make getTgtMemIntrinsic table-driven for resource-based intrinsics
Summary:
Avoids having to list all intrinsics manually.
This is in preparation for the new dimension-aware image intrinsics,
which I'd rather not have to list here by hand.
Change-Id: If7ced04998397ef68c4cb8f7de66b5050fb767e5
Reviewers: arsenm, rampitec, b-sumner
Subscribers: kzhuravl, wdng, mgorny, yaxunl, dstuttard, tpr, llvm-commits, t-tye
Differential Revision: https://reviews.llvm.org/D44937
llvm-svn: 328938
2018-04-02 01:09:07 +08:00
|
|
|
} // end AMDGPU namespace
|
2015-06-23 17:49:53 +08:00
|
|
|
} // End llvm namespace
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#endif
|