mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-26 09:18:56 +00:00
AMDGPU/SI: Add hsa code object directives
Reviewers: arsenm Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10757 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
37
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
Normal file
37
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
//===-- AMDGPUBaseInfo.cpp - AMDGPU Base encoding information--------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
#include "AMDGPUBaseInfo.h"
|
||||
#include "llvm/MC/SubtargetFeature.h"
|
||||
|
||||
#define GET_SUBTARGETINFO_ENUM
|
||||
#include "AMDGPUGenSubtargetInfo.inc"
|
||||
#undef GET_SUBTARGETINFO_ENUM
|
||||
|
||||
namespace llvm {
|
||||
namespace AMDGPU {
|
||||
|
||||
IsaVersion getIsaVersion(const FeatureBitset &Features) {
|
||||
|
||||
if (Features.test(FeatureISAVersion7_0_0))
|
||||
return {7, 0, 0};
|
||||
|
||||
if (Features.test(FeatureISAVersion7_0_1))
|
||||
return {7, 0, 1};
|
||||
|
||||
if (Features.test(FeatureISAVersion8_0_0))
|
||||
return {8, 0, 0};
|
||||
|
||||
if (Features.test(FeatureISAVersion8_0_1))
|
||||
return {8, 0, 1};
|
||||
|
||||
return {0, 0, 0};
|
||||
}
|
||||
|
||||
} // End namespace AMDGPU
|
||||
} // End namespace llvm
|
32
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
Normal file
32
lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
Normal file
@@ -0,0 +1,32 @@
|
||||
//===-- AMDGPUBaseInfo.h - Top level definitions for AMDGPU -----*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H
|
||||
#define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H
|
||||
|
||||
#include "AMDKernelCodeT.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class FeatureBitset;
|
||||
|
||||
namespace AMDGPU {
|
||||
|
||||
struct IsaVersion {
|
||||
unsigned Major;
|
||||
unsigned Minor;
|
||||
unsigned Stepping;
|
||||
};
|
||||
|
||||
IsaVersion getIsaVersion(const FeatureBitset &Features);
|
||||
|
||||
} // end namespace AMDGPU
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
3
lib/Target/AMDGPU/Utils/CMakeLists.txt
Normal file
3
lib/Target/AMDGPU/Utils/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
add_llvm_library(LLVMAMDGPUUtils
|
||||
AMDGPUBaseInfo.cpp
|
||||
)
|
23
lib/Target/AMDGPU/Utils/LLVMBuild.txt
Normal file
23
lib/Target/AMDGPU/Utils/LLVMBuild.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
;===- ./lib/Target/AMDGPU/Utils/LLVMBuild.txt ------------------*- Conf -*--===;
|
||||
;
|
||||
; The LLVM Compiler Infrastructure
|
||||
;
|
||||
; This file is distributed under the University of Illinois Open Source
|
||||
; License. See LICENSE.TXT for details.
|
||||
;
|
||||
;===------------------------------------------------------------------------===;
|
||||
;
|
||||
; This is an LLVMBuild description file for the components in this subdirectory.
|
||||
;
|
||||
; For more information on the LLVMBuild system, please see:
|
||||
;
|
||||
; http://llvm.org/docs/LLVMBuild.html
|
||||
;
|
||||
;===------------------------------------------------------------------------===;
|
||||
|
||||
[component_0]
|
||||
type = Library
|
||||
name = AMDGPUUtils
|
||||
parent = AMDGPU
|
||||
required_libraries = Support
|
||||
add_to_library_groups = AMDGPU
|
16
lib/Target/AMDGPU/Utils/Makefile
Normal file
16
lib/Target/AMDGPU/Utils/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
##===- lib/Target/AMDGPU/Utils/Makefile --------------------*- Makefile -*-===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
# License. See LICENSE.TXT for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
LEVEL = ../../../..
|
||||
LIBRARYNAME = LLVMAMDGPUUtils
|
||||
|
||||
# Hack: we need to include 'main' AMDGPU target directory to grab private
|
||||
# headers
|
||||
CPP.Flags += -I$(PROJ_OBJ_DIR)/.. -I$(PROJ_SRC_DIR)/..
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
Reference in New Issue
Block a user