Index: llvm/trunk/lib/Target/AMDGPU/AMDGPU.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/AMDGPU.td +++ llvm/trunk/lib/Target/AMDGPU/AMDGPU.td @@ -116,21 +116,6 @@ def FeatureLDSBankCount16 : SubtargetFeatureLDSBankCount<16>; def FeatureLDSBankCount32 : SubtargetFeatureLDSBankCount<32>; -class SubtargetFeatureISAVersion - : SubtargetFeature < - "isaver"#Major#"."#Minor#"."#Stepping, - "IsaVersion", - "ISAVersion"#Major#"_"#Minor#"_"#Stepping, - "Instruction set version number" ->; - -def FeatureISAVersion7_0_0 : SubtargetFeatureISAVersion <7,0,0>; -def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1>; -def FeatureISAVersion8_0_0 : SubtargetFeatureISAVersion <8,0,0>; -def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1>; -def FeatureISAVersion8_0_2 : SubtargetFeatureISAVersion <8,0,2>; -def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3>; - class SubtargetFeatureLocalMemorySize : SubtargetFeature< "localmemorysize"#Value, "LocalMemorySize", @@ -330,6 +315,59 @@ ] >; +class SubtargetFeatureISAVersion Implies> + : SubtargetFeature < + "isaver"#Major#"."#Minor#"."#Stepping, + "IsaVersion", + "ISAVersion"#Major#"_"#Minor#"_"#Stepping, + "Instruction set version number", + Implies +>; + +def FeatureISAVersion7_0_0 : SubtargetFeatureISAVersion <7,0,0, + [FeatureSeaIslands, + FeatureLDSBankCount32]>; + +def FeatureISAVersion7_0_1 : SubtargetFeatureISAVersion <7,0,1, + [FeatureSeaIslands, + HalfRate64Ops, + FeatureLDSBankCount32, + FeatureFastFMAF32]>; + +def FeatureISAVersion7_0_2 : SubtargetFeatureISAVersion <7,0,2, + [FeatureSeaIslands, + FeatureLDSBankCount16, + FeatureXNACK]>; + +def FeatureISAVersion8_0_0 : SubtargetFeatureISAVersion <8,0,0, + [FeatureVolcanicIslands, + FeatureLDSBankCount32, + FeatureSGPRInitBug]>; + +def FeatureISAVersion8_0_1 : SubtargetFeatureISAVersion <8,0,1, + [FeatureVolcanicIslands, + FeatureLDSBankCount32, + FeatureXNACK]>; + +def FeatureISAVersion8_0_2 : SubtargetFeatureISAVersion <8,0,2, + [FeatureVolcanicIslands, + FeatureLDSBankCount32, + FeatureSGPRInitBug]>; + +def FeatureISAVersion8_0_3 : SubtargetFeatureISAVersion <8,0,3, + [FeatureVolcanicIslands, + FeatureLDSBankCount32]>; + +def FeatureISAVersion8_0_4 : SubtargetFeatureISAVersion <8,0,4, + [FeatureVolcanicIslands, + FeatureLDSBankCount32]>; + +def FeatureISAVersion8_1_0 : SubtargetFeatureISAVersion <8,1,0, + [FeatureVolcanicIslands, + FeatureLDSBankCount16, + FeatureXNACK]>; + //===----------------------------------------------------------------------===// // Debugger related subtarget features. //===----------------------------------------------------------------------===// Index: llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h =================================================================== --- llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h +++ llvm/trunk/lib/Target/AMDGPU/AMDGPUSubtarget.h @@ -51,10 +51,13 @@ ISAVersion0_0_0, ISAVersion7_0_0, ISAVersion7_0_1, + ISAVersion7_0_2, ISAVersion8_0_0, ISAVersion8_0_1, ISAVersion8_0_2, - ISAVersion8_0_3 + ISAVersion8_0_3, + ISAVersion8_0_4, + ISAVersion8_1_0, }; protected: Index: llvm/trunk/lib/Target/AMDGPU/Processors.td =================================================================== --- llvm/trunk/lib/Target/AMDGPU/Processors.td +++ llvm/trunk/lib/Target/AMDGPU/Processors.td @@ -101,55 +101,89 @@ //===----------------------------------------------------------------------===// def : ProcessorModel<"bonaire", SIQuarterSpeedModel, - [FeatureSeaIslands, FeatureLDSBankCount32, FeatureISAVersion7_0_0] + [FeatureISAVersion7_0_0] >; def : ProcessorModel<"kabini", SIQuarterSpeedModel, - [FeatureSeaIslands, FeatureLDSBankCount16] + [FeatureISAVersion7_0_2] >; def : ProcessorModel<"kaveri", SIQuarterSpeedModel, - [FeatureSeaIslands, FeatureLDSBankCount32, FeatureISAVersion7_0_0] + [FeatureISAVersion7_0_0] >; -def : ProcessorModel<"hawaii", SIFullSpeedModel, - [FeatureSeaIslands, FeatureFastFMAF32, HalfRate64Ops, - FeatureLDSBankCount32, FeatureISAVersion7_0_1] +def : ProcessorModel<"hawaii", SIFullSpeedModel, + [FeatureISAVersion7_0_1] >; def : ProcessorModel<"mullins", SIQuarterSpeedModel, - [FeatureSeaIslands, FeatureLDSBankCount16]>; + [FeatureISAVersion7_0_2]>; + +def : ProcessorModel<"gfx700", SIQuarterSpeedModel, + [FeatureISAVersion7_0_0] +>; + +def : ProcessorModel<"gfx701", SIFullSpeedModel, + [FeatureISAVersion7_0_1] +>; + +def : ProcessorModel<"gfx702", SIQuarterSpeedModel, + [FeatureISAVersion7_0_2] +>; //===----------------------------------------------------------------------===// // Volcanic Islands //===----------------------------------------------------------------------===// def : ProcessorModel<"tonga", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_2, - FeatureLDSBankCount32] + [FeatureISAVersion8_0_2] >; def : ProcessorModel<"iceland", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureSGPRInitBug, FeatureISAVersion8_0_0, - FeatureLDSBankCount32] + [FeatureISAVersion8_0_0] >; def : ProcessorModel<"carrizo", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_1, FeatureLDSBankCount32, FeatureXNACK] + [FeatureISAVersion8_0_1] >; -def : ProcessorModel<"fiji", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_3, FeatureLDSBankCount32] +def : ProcessorModel<"fiji", SIQuarterSpeedModel, + [FeatureISAVersion8_0_3] >; -def : ProcessorModel<"stoney", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_1, FeatureLDSBankCount16, FeatureXNACK] +def : ProcessorModel<"stoney", SIQuarterSpeedModel, + [FeatureISAVersion8_1_0] >; def : ProcessorModel<"polaris10", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_3, FeatureLDSBankCount32] + [FeatureISAVersion8_0_3] >; def : ProcessorModel<"polaris11", SIQuarterSpeedModel, - [FeatureVolcanicIslands, FeatureISAVersion8_0_3, FeatureLDSBankCount32] + [FeatureISAVersion8_0_3] +>; + +def : ProcessorModel<"gfx800", SIQuarterSpeedModel, + [FeatureISAVersion8_0_0] +>; + +def : ProcessorModel<"gfx801", SIQuarterSpeedModel, + [FeatureISAVersion8_0_1] >; + +def : ProcessorModel<"gfx802", SIQuarterSpeedModel, + [FeatureISAVersion8_0_2] +>; + +def : ProcessorModel<"gfx803", SIQuarterSpeedModel, + [FeatureISAVersion8_0_3] +>; + +def : ProcessorModel<"gfx804", SIQuarterSpeedModel, + [FeatureISAVersion8_0_4] +>; + +def : ProcessorModel<"gfx810", SIQuarterSpeedModel, + [FeatureISAVersion8_1_0] +>; + Index: llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp =================================================================== --- llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp +++ llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp @@ -87,6 +87,9 @@ if (Features.test(FeatureISAVersion7_0_1)) return {7, 0, 1}; + if (Features.test(FeatureISAVersion7_0_2)) + return {7, 0, 2}; + if (Features.test(FeatureISAVersion8_0_0)) return {8, 0, 0}; @@ -99,6 +102,12 @@ if (Features.test(FeatureISAVersion8_0_3)) return {8, 0, 3}; + if (Features.test(FeatureISAVersion8_0_4)) + return {8, 0, 4}; + + if (Features.test(FeatureISAVersion8_1_0)) + return {8, 1, 0}; + return {0, 0, 0}; } Index: llvm/trunk/test/CodeGen/AMDGPU/hsa-note-no-func.ll =================================================================== --- llvm/trunk/test/CodeGen/AMDGPU/hsa-note-no-func.ll +++ llvm/trunk/test/CodeGen/AMDGPU/hsa-note-no-func.ll @@ -1,12 +1,26 @@ -; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA --check-prefix=HSA-CI %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx700 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI700 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx701 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI701 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx702 | FileCheck --check-prefix=HSA --check-prefix=HSA-CI702 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=HSA --check-prefix=HSA-CI700 %s ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo | FileCheck --check-prefix=HSA --check-prefix=HSA-VI801 %s ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=tonga | FileCheck --check-prefix=HSA --check-prefix=HSA-VI802 %s ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=fiji | FileCheck --check-prefix=HSA --check-prefix=HSA-VI803 %s ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=polaris10 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI803 %s ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=polaris11 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI803 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx800 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI800 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx801 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI801 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx802 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI802 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx803 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI803 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx804 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI804 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx810 | FileCheck --check-prefix=HSA --check-prefix=HSA-VI810 %s ; HSA: .hsa_code_object_version 2,1 -; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" +; HSA-CI700: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" +; HSA-CI701: .hsa_code_object_isa 7,0,1,"AMD","AMDGPU" +; HSA-CI702: .hsa_code_object_isa 7,0,2,"AMD","AMDGPU" +; HSA-VI800: .hsa_code_object_isa 8,0,0,"AMD","AMDGPU" ; HSA-VI801: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU" ; HSA-VI802: .hsa_code_object_isa 8,0,2,"AMD","AMDGPU" ; HSA-VI803: .hsa_code_object_isa 8,0,3,"AMD","AMDGPU" +; HSA-VI804: .hsa_code_object_isa 8,0,4,"AMD","AMDGPU" +; HSA-VI810: .hsa_code_object_isa 8,1,0,"AMD","AMDGPU"