diff --git a/docs/AMDGPUUsage.rst b/docs/AMDGPUUsage.rst index 58791b8fa8f..9d8dc1d3286 100644 --- a/docs/AMDGPUUsage.rst +++ b/docs/AMDGPUUsage.rst @@ -321,7 +321,13 @@ names from both the *Processor* and *Alternative Processor* can be used. - cumode [off] .. TODO:: - + Add product + names. + ``gfx1033`` ``amdgcn`` APU - wavefrontsize64 *TBA* + [off] + - cumode + [off] + .. TODO:: Add product names. @@ -871,7 +877,7 @@ The AMDGPU backend uses the following ELF header: ``EF_AMDGPU_MACH_AMDGCN_GFX1030`` 0x036 ``gfx1030`` ``EF_AMDGPU_MACH_AMDGCN_GFX1031`` 0x037 ``gfx1031`` ``EF_AMDGPU_MACH_AMDGCN_GFX1032`` 0x038 ``gfx1032`` - *reserved* 0x039 Reserved. + ``EF_AMDGPU_MACH_AMDGCN_GFX1033`` 0x039 ``gfx1033`` ``EF_AMDGPU_MACH_AMDGCN_GFX602`` 0x03a ``gfx602`` ``EF_AMDGPU_MACH_AMDGCN_GFX705`` 0x03b ``gfx705`` ``EF_AMDGPU_MACH_AMDGCN_GFX805`` 0x03c ``gfx805`` diff --git a/include/llvm/BinaryFormat/ELF.h b/include/llvm/BinaryFormat/ELF.h index 8045aa0b2f4..d49760c5d4c 100644 --- a/include/llvm/BinaryFormat/ELF.h +++ b/include/llvm/BinaryFormat/ELF.h @@ -720,7 +720,7 @@ enum : unsigned { EF_AMDGPU_MACH_AMDGCN_GFX1030 = 0x036, EF_AMDGPU_MACH_AMDGCN_GFX1031 = 0x037, EF_AMDGPU_MACH_AMDGCN_GFX1032 = 0x038, - EF_AMDGPU_MACH_AMDGCN_RESERVED_0X39 = 0x039, + EF_AMDGPU_MACH_AMDGCN_GFX1033 = 0x039, EF_AMDGPU_MACH_AMDGCN_GFX602 = 0x03a, EF_AMDGPU_MACH_AMDGCN_GFX705 = 0x03b, EF_AMDGPU_MACH_AMDGCN_GFX805 = 0x03c, diff --git a/include/llvm/Support/TargetParser.h b/include/llvm/Support/TargetParser.h index d5e0a4bbf1c..1d82dd80df0 100644 --- a/include/llvm/Support/TargetParser.h +++ b/include/llvm/Support/TargetParser.h @@ -91,9 +91,10 @@ enum GPUKind : uint32_t { GK_GFX1030 = 75, GK_GFX1031 = 76, GK_GFX1032 = 77, + GK_GFX1033 = 78, GK_AMDGCN_FIRST = GK_GFX600, - GK_AMDGCN_LAST = GK_GFX1032, + GK_AMDGCN_LAST = GK_GFX1033, }; /// Instruction set architecture version. diff --git a/lib/Object/ELFObjectFile.cpp b/lib/Object/ELFObjectFile.cpp index bf94993524b..6dee3ab81b6 100644 --- a/lib/Object/ELFObjectFile.cpp +++ b/lib/Object/ELFObjectFile.cpp @@ -472,6 +472,8 @@ StringRef ELFObjectFileBase::getAMDGPUCPUName() const { return "gfx1031"; case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1032: return "gfx1032"; + case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1033: + return "gfx1033"; default: llvm_unreachable("Unknown EF_AMDGPU_MACH value"); } diff --git a/lib/ObjectYAML/ELFYAML.cpp b/lib/ObjectYAML/ELFYAML.cpp index f798c22e17e..211a6abe51e 100644 --- a/lib/ObjectYAML/ELFYAML.cpp +++ b/lib/ObjectYAML/ELFYAML.cpp @@ -446,6 +446,7 @@ void ScalarBitSetTraits::bitset(IO &IO, BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1030, EF_AMDGPU_MACH); BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1031, EF_AMDGPU_MACH); BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1032, EF_AMDGPU_MACH); + BCaseMask(EF_AMDGPU_MACH_AMDGCN_GFX1033, EF_AMDGPU_MACH); BCase(EF_AMDGPU_XNACK); BCase(EF_AMDGPU_SRAM_ECC); break; diff --git a/lib/Support/TargetParser.cpp b/lib/Support/TargetParser.cpp index 4fa64bd7545..b58fadfc765 100644 --- a/lib/Support/TargetParser.cpp +++ b/lib/Support/TargetParser.cpp @@ -111,6 +111,7 @@ constexpr GPUInfo AMDGCNGPUs[] = { {{"gfx1030"}, {"gfx1030"}, GK_GFX1030, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_WAVE32}, {{"gfx1031"}, {"gfx1031"}, GK_GFX1031, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_WAVE32}, {{"gfx1032"}, {"gfx1032"}, GK_GFX1032, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_WAVE32}, + {{"gfx1033"}, {"gfx1033"}, GK_GFX1033, FEATURE_FAST_FMA_F32|FEATURE_FAST_DENORMAL_F32|FEATURE_WAVE32}, }; const GPUInfo *getArchEntry(AMDGPU::GPUKind AK, ArrayRef Table) { @@ -219,6 +220,7 @@ AMDGPU::IsaVersion AMDGPU::getIsaVersion(StringRef GPU) { case GK_GFX1030: return {10, 3, 0}; case GK_GFX1031: return {10, 3, 1}; case GK_GFX1032: return {10, 3, 2}; + case GK_GFX1033: return {10, 3, 3}; default: return {0, 0, 0}; } } diff --git a/lib/Target/AMDGPU/GCNProcessors.td b/lib/Target/AMDGPU/GCNProcessors.td index 24cf5e349a3..7447ec2db18 100644 --- a/lib/Target/AMDGPU/GCNProcessors.td +++ b/lib/Target/AMDGPU/GCNProcessors.td @@ -215,3 +215,7 @@ def : ProcessorModel<"gfx1031", GFX10SpeedModel, def : ProcessorModel<"gfx1032", GFX10SpeedModel, FeatureISAVersion10_3_0.Features >; + +def : ProcessorModel<"gfx1033", GFX10SpeedModel, + FeatureISAVersion10_3_0.Features +>; diff --git a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp index 83842940e8c..ead88a0c8f8 100644 --- a/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp +++ b/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp @@ -104,6 +104,7 @@ StringRef AMDGPUTargetStreamer::getArchNameFromElfMach(unsigned ElfMach) { case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1030: AK = GK_GFX1030; break; case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1031: AK = GK_GFX1031; break; case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1032: AK = GK_GFX1032; break; + case ELF::EF_AMDGPU_MACH_AMDGCN_GFX1033: AK = GK_GFX1033; break; case ELF::EF_AMDGPU_MACH_NONE: AK = GK_NONE; break; } @@ -162,6 +163,7 @@ unsigned AMDGPUTargetStreamer::getElfMach(StringRef GPU) { case GK_GFX1030: return ELF::EF_AMDGPU_MACH_AMDGCN_GFX1030; case GK_GFX1031: return ELF::EF_AMDGPU_MACH_AMDGCN_GFX1031; case GK_GFX1032: return ELF::EF_AMDGPU_MACH_AMDGCN_GFX1032; + case GK_GFX1033: return ELF::EF_AMDGPU_MACH_AMDGCN_GFX1033; case GK_NONE: return ELF::EF_AMDGPU_MACH_NONE; } diff --git a/test/CodeGen/AMDGPU/elf-header-flags-mach.ll b/test/CodeGen/AMDGPU/elf-header-flags-mach.ll index 4a05c10de87..3750e6bc4c9 100644 --- a/test/CodeGen/AMDGPU/elf-header-flags-mach.ll +++ b/test/CodeGen/AMDGPU/elf-header-flags-mach.ll @@ -59,6 +59,7 @@ ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx1030 < %s | llvm-readobj -file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX1030 %s ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx1031 < %s | llvm-readobj -file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX1031 %s ; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx1032 < %s | llvm-readobj -file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX1032 %s +; RUN: llc -filetype=obj -march=amdgcn -mcpu=gfx1033 < %s | llvm-readobj -file-headers - | FileCheck --check-prefixes=ALL,ARCH-GCN,GFX1033 %s ; ARCH-R600: Format: elf32-amdgpu ; ARCH-R600: Arch: r600 @@ -116,6 +117,7 @@ ; GFX1030: EF_AMDGPU_MACH_AMDGCN_GFX1030 (0x36) ; GFX1031: EF_AMDGPU_MACH_AMDGCN_GFX1031 (0x37) ; GFX1032: EF_AMDGPU_MACH_AMDGCN_GFX1032 (0x38) +; GFX1033: EF_AMDGPU_MACH_AMDGCN_GFX1033 (0x39) ; ALL: ] define amdgpu_kernel void @elf_header() { diff --git a/test/CodeGen/AMDGPU/hsa-note-no-func.ll b/test/CodeGen/AMDGPU/hsa-note-no-func.ll index c1f6ac52d91..fac19dc52b6 100644 --- a/test/CodeGen/AMDGPU/hsa-note-no-func.ll +++ b/test/CodeGen/AMDGPU/hsa-note-no-func.ll @@ -31,6 +31,7 @@ ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx1030 --amdhsa-code-object-version=2 | FileCheck --check-prefix=HSA --check-prefix=HSA-GFX1030 %s ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx1031 --amdhsa-code-object-version=2 | FileCheck --check-prefix=HSA --check-prefix=HSA-GFX1031 %s ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx1032 --amdhsa-code-object-version=2 | FileCheck --check-prefix=HSA --check-prefix=HSA-GFX1032 %s +; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=gfx1033 --amdhsa-code-object-version=2 | FileCheck --check-prefix=HSA --check-prefix=HSA-GFX1033 %s ; HSA: .hsa_code_object_version 2,1 ; HSA-SI600: .hsa_code_object_isa 6,0,0,"AMD","AMDGPU" @@ -56,3 +57,4 @@ ; HSA-GFX1030: .hsa_code_object_isa 10,3,0,"AMD","AMDGPU" ; HSA-GFX1031: .hsa_code_object_isa 10,3,1,"AMD","AMDGPU" ; HSA-GFX1032: .hsa_code_object_isa 10,3,2,"AMD","AMDGPU" +; HSA-GFX1033: .hsa_code_object_isa 10,3,3,"AMD","AMDGPU" diff --git a/test/MC/AMDGPU/gfx1011_dlops.s b/test/MC/AMDGPU/gfx1011_dlops.s index d945d81f61b..71804695f58 100644 --- a/test/MC/AMDGPU/gfx1011_dlops.s +++ b/test/MC/AMDGPU/gfx1011_dlops.s @@ -1,5 +1,9 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1011 -show-encoding %s | FileCheck --check-prefix=GFX10 %s // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1012 -show-encoding %s | FileCheck --check-prefix=GFX10 %s +// RUN: llvm-mc -arch=amdgcn -mcpu=gfx1030 -show-encoding %s | FileCheck --check-prefix=GFX10 %s +// RUN: llvm-mc -arch=amdgcn -mcpu=gfx1031 -show-encoding %s | FileCheck --check-prefix=GFX10 %s +// RUN: llvm-mc -arch=amdgcn -mcpu=gfx1032 -show-encoding %s | FileCheck --check-prefix=GFX10 %s +// RUN: llvm-mc -arch=amdgcn -mcpu=gfx1033 -show-encoding %s | FileCheck --check-prefix=GFX10 %s v_dot2_f32_f16 v0, v1, v2, v3 // GFX10: encoding: [0x00,0x40,0x13,0xcc,0x01,0x05,0x0e,0x1c] diff --git a/test/MC/AMDGPU/gfx1030_err.s b/test/MC/AMDGPU/gfx1030_err.s index 5ba0283fde2..5a57d3b3048 100644 --- a/test/MC/AMDGPU/gfx1030_err.s +++ b/test/MC/AMDGPU/gfx1030_err.s @@ -1,6 +1,7 @@ // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1030 %s 2>&1 | FileCheck --check-prefix=GFX10 --implicit-check-not=error: %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1031 %s 2>&1 | FileCheck --check-prefix=GFX10 --implicit-check-not=error: %s // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1032 %s 2>&1 | FileCheck --check-prefix=GFX10 --implicit-check-not=error: %s +// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1033 %s 2>&1 | FileCheck --check-prefix=GFX10 --implicit-check-not=error: %s v_dot8c_i32_i4 v5, v1, v2 // GFX10: :[[@LINE-1]]:{{[0-9]+}}: error: instruction not supported on this GPU diff --git a/test/MC/AMDGPU/gfx1030_new.s b/test/MC/AMDGPU/gfx1030_new.s index 5a5e5537da5..9234b916a71 100644 --- a/test/MC/AMDGPU/gfx1030_new.s +++ b/test/MC/AMDGPU/gfx1030_new.s @@ -1,6 +1,7 @@ // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1030 -show-encoding %s | FileCheck --check-prefix=GFX10 %s // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1031 -show-encoding %s | FileCheck --check-prefix=GFX10 %s // RUN: llvm-mc -arch=amdgcn -mcpu=gfx1032 -show-encoding %s | FileCheck --check-prefix=GFX10 %s +// RUN: llvm-mc -arch=amdgcn -mcpu=gfx1033 -show-encoding %s | FileCheck --check-prefix=GFX10 %s global_load_dword_addtid v1, s[2:3] offset:16 // GFX10: encoding: [0x10,0x80,0x58,0xdc,0x00,0x00,0x02,0x01] diff --git a/test/MC/Disassembler/AMDGPU/gfx1011_dasm_dlops.txt b/test/MC/Disassembler/AMDGPU/gfx1011_dasm_dlops.txt index a9addc04508..cbb7abe8541 100644 --- a/test/MC/Disassembler/AMDGPU/gfx1011_dasm_dlops.txt +++ b/test/MC/Disassembler/AMDGPU/gfx1011_dasm_dlops.txt @@ -1,5 +1,9 @@ # RUN: llvm-mc -arch=amdgcn -mcpu=gfx1011 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s # RUN: llvm-mc -arch=amdgcn -mcpu=gfx1012 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s +# RUN: llvm-mc -arch=amdgcn -mcpu=gfx1030 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s +# RUN: llvm-mc -arch=amdgcn -mcpu=gfx1031 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s +# RUN: llvm-mc -arch=amdgcn -mcpu=gfx1032 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s +# RUN: llvm-mc -arch=amdgcn -mcpu=gfx1033 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s # GFX10: v_dot2_f32_f16 v0, v1, v2, v3 ; encoding: [0x00,0x40,0x13,0xcc,0x01,0x05,0x0e,0x1c] 0x00,0x40,0x13,0xcc,0x01,0x05,0x0e,0x1c diff --git a/test/MC/Disassembler/AMDGPU/gfx1030_dasm_new.txt b/test/MC/Disassembler/AMDGPU/gfx1030_dasm_new.txt index 4f7a6b62c00..0d7a3f032ea 100644 --- a/test/MC/Disassembler/AMDGPU/gfx1030_dasm_new.txt +++ b/test/MC/Disassembler/AMDGPU/gfx1030_dasm_new.txt @@ -1,6 +1,7 @@ # RUN: llvm-mc -arch=amdgcn -mcpu=gfx1030 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s # RUN: llvm-mc -arch=amdgcn -mcpu=gfx1031 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s # RUN: llvm-mc -arch=amdgcn -mcpu=gfx1032 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s +# RUN: llvm-mc -arch=amdgcn -mcpu=gfx1033 -disassemble -show-encoding < %s | FileCheck -check-prefix=GFX10 %s # GFX10: global_load_dword_addtid v1, s[2:3] offset:16 0x10,0x80,0x58,0xdc,0x00,0x00,0x02,0x01 diff --git a/test/Object/AMDGPU/elf-header-flags-mach.yaml b/test/Object/AMDGPU/elf-header-flags-mach.yaml index 42aeccc4a98..6b0e4612efc 100644 --- a/test/Object/AMDGPU/elf-header-flags-mach.yaml +++ b/test/Object/AMDGPU/elf-header-flags-mach.yaml @@ -170,6 +170,10 @@ # RUN: llvm-readobj -S --file-headers %t.o.AMDGCN_GFX1032 | FileCheck --check-prefixes=ELF-AMDGCN-ALL,ELF-AMDGCN-GFX1032 %s # RUN: obj2yaml %t.o.AMDGCN_GFX1032 | FileCheck --check-prefixes=YAML-AMDGCN-ALL,YAML-AMDGCN-GFX1032 %s +# RUN: sed -e 's//64/' -e 's//AMDGCN_GFX1033/' %s | yaml2obj -o %t.o.AMDGCN_GFX1033 +# RUN: llvm-readobj -S --file-headers %t.o.AMDGCN_GFX1033 | FileCheck --check-prefixes=ELF-AMDGCN-ALL,ELF-AMDGCN-GFX1033 %s +# RUN: obj2yaml %t.o.AMDGCN_GFX1033 | FileCheck --check-prefixes=YAML-AMDGCN-ALL,YAML-AMDGCN-GFX1033 %s + # ELF-R600-ALL: Format: elf32-amdgpu # ELF-R600-ALL: Arch: r600 @@ -317,6 +321,9 @@ # ELF-AMDGCN-GFX1032: EF_AMDGPU_MACH_AMDGCN_GFX1032 (0x38) # YAML-AMDGCN-GFX1032: Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1032 ] +# ELF-AMDGCN-GFX1033: EF_AMDGPU_MACH_AMDGCN_GFX1033 (0x39) +# YAML-AMDGCN-GFX1033: Flags: [ EF_AMDGPU_MACH_AMDGCN_GFX1033 ] + # ELF-AMDGCN-ALL: ] diff --git a/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test b/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test index 26ba944fc04..1fe9a3a99ec 100644 --- a/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test +++ b/test/tools/llvm-readobj/ELF/amdgpu-elf-headers.test @@ -79,6 +79,9 @@ # RUN: yaml2obj %s -o %t -DCPU=GFX1032 # RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t -DCPU=GFX1032 -DFLAGS=0x38 +# RUN: yaml2obj %s -o %t -DCPU=GFX1033 +# RUN: llvm-readobj -h %t | FileCheck %s --match-full-lines -DFILE=%t -DCPU=GFX1033 -DFLAGS=0x39 + --- !ELF FileHeader: Class: ELFCLASS64 diff --git a/tools/llvm-readobj/ELFDumper.cpp b/tools/llvm-readobj/ELFDumper.cpp index 15ec3cf856b..1214f0b14e7 100644 --- a/tools/llvm-readobj/ELFDumper.cpp +++ b/tools/llvm-readobj/ELFDumper.cpp @@ -1786,6 +1786,7 @@ static const EnumEntry ElfHeaderAMDGPUFlags[] = { LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX1030), LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX1031), LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX1032), + LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_MACH_AMDGCN_GFX1033), LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_XNACK), LLVM_READOBJ_ENUM_ENT(ELF, EF_AMDGPU_SRAM_ECC) };