//===- comgr-isa-metadata.def - ISA metadata ------------------------------===//
//
// Part of Comgr, under the Apache License v2.0 with LLVM Exceptions. See
// amd/comgr/LICENSE.TXT in this repository for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines the HANDLE_ISA macro, which is effectively a table
// with information on ISA features and properties for different AMDGPU
// architectures.
//
//===----------------------------------------------------------------------===//

#if !(defined HANDLE_ISA)
#error "Missing macro definition of HANDLE_ISA"
#endif

/*
#define HANDLE_ISA(TARGET_TRIPLE, PROCESSOR,                                   \
        SRAMECC_SUPPORTED, XNACK_SUPPORTED,                                    \
        ELF_MACHINE, TRAP_HANDLER_ENABLED, IMAGE_SUPPORT,                      \
        LDS_BANK_COUNT, LDS_SIZE,                                              \
        EUS_PER_CU, MAX_WAVES_PER_CU, MAX_FLAT_WORK_GROUP_SIZE,                \
        SGPR_ALLOC_GRANULE, TOTAL_NUM_SGPRS, ADDRESSABLE_NUM_SGPRS,            \
        VGPR_ALLOC_GRANULE, TOTAL_NUM_VGPRS, ADDRESSABLE_NUM_VGPRS)            \

                                                                                                                        ---LDS--- ----CU---    WG ------SGPR----- ------VGPR-----
           TARGET_TRIPLE         PROCESSOR         SRAMECC  XNACK  ELF_MACHINE                            TRAP  IMAGE   Size Bnks EUs Waves   Max Alloc  Max Addr Alloc  Max Addr */
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx600",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX600,          true,  true, 65536,  32,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx601",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX601,          true,  true, 65536,  32,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx602",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX602,          true,  true, 65536,  32,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx700",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX700,          true,  true, 65536,  32,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx701",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX701,          true,  true, 65536,  32,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx702",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX702,          true,  true, 65536,  16,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx703",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX703,          true,  true, 65536,  16,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx704",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX704,          true,  true, 65536,  16,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx705",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX705,          true,  true, 65536,  16,  4,   40, 1024,    8, 512, 104,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx801",           false,  true, EF_AMDGPU_MACH_AMDGCN_GFX801,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx802",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX802,          true,  true, 65536,  32,  4,   40, 1024,   16, 800,  96,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx803",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX803,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx805",           false, false, EF_AMDGPU_MACH_AMDGCN_GFX805,          true,  true, 65536,  32,  4,   40, 1024,   16, 800,  96,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx810",           false,  true, EF_AMDGPU_MACH_AMDGCN_GFX810,          true,  true, 65536,  16,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx900",           false,  true, EF_AMDGPU_MACH_AMDGCN_GFX900,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx902",           false,  true, EF_AMDGPU_MACH_AMDGCN_GFX902,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx904",           false,  true, EF_AMDGPU_MACH_AMDGCN_GFX904,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx906",            true,  true, EF_AMDGPU_MACH_AMDGCN_GFX906,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx908",            true,  true, EF_AMDGPU_MACH_AMDGCN_GFX908,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx909",           false,  true, EF_AMDGPU_MACH_AMDGCN_GFX909,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx90a",            true,  true, EF_AMDGPU_MACH_AMDGCN_GFX90A,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    8, 512, 512)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx90c",           false,  true, EF_AMDGPU_MACH_AMDGCN_GFX90C,          true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx942",            true,  true, EF_AMDGPU_MACH_AMDGCN_GFX942,          true, false, 65536,  32,  4,   40, 1024,   16, 800, 102,    8, 512, 512)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx950",            true,  true, EF_AMDGPU_MACH_AMDGCN_GFX950,          true, false, 65536,  32,  4,   40, 1024,   16, 800, 102,    8, 512, 512)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1010",          false,  true, EF_AMDGPU_MACH_AMDGCN_GFX1010,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1011",          false,  true, EF_AMDGPU_MACH_AMDGCN_GFX1011,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1012",          false,  true, EF_AMDGPU_MACH_AMDGCN_GFX1012,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1013",          false,  true, EF_AMDGPU_MACH_AMDGCN_GFX1013,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1030",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1030,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1031",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1031,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1032",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1032,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1033",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1033,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1034",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1034,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1035",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1035,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1036",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1036,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1100",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1100,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   24, 1536, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1101",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1101,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   24, 1536, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1102",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1102,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1103",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1103,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1150",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1150,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1151",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1151,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   24, 1536, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1152",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1152,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1153",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1153,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1170",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1170,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1171",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1171,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1172",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1172,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1200",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1200,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   24, 1536, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1201",          false, false, EF_AMDGPU_MACH_AMDGCN_GFX1201,         true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   24, 1536, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1250",          true,  true,  EF_AMDGPU_MACH_AMDGCN_GFX1250,         true, false, 327680, 64,  4,   40, 1024,  106, 800, 106,   16, 1024, 1024)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1251",          true,  true,  EF_AMDGPU_MACH_AMDGCN_GFX1251,         true, false, 327680, 64,  4,   40, 1024,  106, 800, 106,   16, 1024, 1024)

HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx9-generic",     false,  true, EF_AMDGPU_MACH_AMDGCN_GFX9_GENERIC,    true,  true, 65536,  32,  4,   40, 1024,   16, 800, 102,    4, 256, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx9-4-generic",   true,   true, EF_AMDGPU_MACH_AMDGCN_GFX9_4_GENERIC,  true, false, 65536,  32,  4,   40, 1024,   16, 800, 102,    8, 512, 512)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx10-1-generic",  false,  true, EF_AMDGPU_MACH_AMDGCN_GFX10_1_GENERIC, true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx10-3-generic",  false, false, EF_AMDGPU_MACH_AMDGCN_GFX10_3_GENERIC, true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,    8, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx11-generic",    false, false, EF_AMDGPU_MACH_AMDGCN_GFX11_GENERIC,   true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   16, 1024, 256)
HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx12-generic",    false, false, EF_AMDGPU_MACH_AMDGCN_GFX12_GENERIC,   true,  true, 65536,  32,  4,   40, 1024,  106, 800, 106,   24, 1536, 256)

#undef HANDLE_ISA
