Skip to content

Commit 46192e6

Browse files
committed
Updates for CDNA 4 support.
1 parent 1cf387d commit 46192e6

10 files changed

Lines changed: 125 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2021-2024 Advanced Micro Devices, Inc. All rights reserved.
2-
cmake_minimum_required(VERSION 3.0)
2+
cmake_minimum_required(VERSION 3.10)
33

44
# List of projects.
55
project(isa_spec_manager)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cd ./isa_spec_manager/build
2626
./prebuild_windows.bat
2727
```
2828

29-
The above script will create a `windows` subfolder and generate a Visual Studio solution within it.
29+
The above script will create a windows directory and generate a solution for Visual Studio.
3030

3131
By default, a solution is generated for VS 2022. To generate a solution for a different VS version or to use a different MSVC toolchain use the `--vs` argument.
3232
For example, to generate the solution for VS 2019 with the VS 2019 toolchain, run:

include/amdisa/isa_decoder.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ namespace amdisa
2222
kRdna4,
2323
kCdna1,
2424
kCdna2,
25-
kCdna3
25+
kCdna3,
26+
kCdna4
2627
};
2728

2829
// Constants.

source/examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
2-
cmake_minimum_required(VERSION 3.0)
2+
cmake_minimum_required(VERSION 3.10)
33

44
# Setting project directories.
55
set (SRC_DIR ../../source)

source/isa_decoder/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
2-
cmake_minimum_required(VERSION 3.0)
2+
cmake_minimum_required(VERSION 3.10)
33

44
# Setting project directories.
55
set (SRC_DIR ../../source)

source/isa_decoder/encoding_condition_handler.hpp

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,6 +1378,98 @@ namespace amdisa
13781378
return ((dword & 0x1ff)) == 249;
13791379
}
13801380

1381+
static bool IsArch3VopcDefault(uint64_t dword) {
1382+
return ((((dword & 0x1ff)) != 250) && (((dword & 0x1ff)) != 255)) && (((dword & 0x1ff)) != 249);
1383+
}
1384+
1385+
static bool IsArch3VopcInstLiteralHasLit(uint64_t dword) {
1386+
return ((dword & 0x1ff)) == 255;
1387+
}
1388+
1389+
static bool IsArch3VopcVopSdwaSdstEncHasSdwa(uint64_t dword) {
1390+
return ((dword & 0x1ff)) == 249;
1391+
}
1392+
1393+
static bool IsArch3Sop1Default(uint64_t dword) {
1394+
return ((dword & 0xff)) != 255;
1395+
}
1396+
1397+
static bool IsArch3Sop1InstLiteralHasLit0(uint64_t dword) {
1398+
return ((dword & 0xff)) == 255;
1399+
}
1400+
1401+
static bool IsArch3Sop2Default(uint64_t dword) {
1402+
return (((dword & 0xff)) != 255) && (((dword & 0xff00) >> 8) != 255);
1403+
}
1404+
1405+
static bool IsArch3Sop2InstLiteralHasLit0(uint64_t dword) {
1406+
return (((dword & 0xff)) == 255) && (((dword & 0xff00) >> 8) != 255);
1407+
}
1408+
1409+
static bool IsArch3Sop2InstLiteralHasLit1(uint64_t dword) {
1410+
return (((dword & 0xff)) != 255) && (((dword & 0xff00) >> 8) == 255);
1411+
}
1412+
1413+
static bool IsArch3Sop2InstLiteralHasLit0HasLit1(uint64_t dword) {
1414+
return (((dword & 0xff)) == 255) && (((dword & 0xff00) >> 8) == 255);
1415+
}
1416+
1417+
static bool IsArch3SopcDefault(uint64_t dword) {
1418+
return (((dword & 0xff)) != 255) && (((dword & 0xff00) >> 8) != 255);
1419+
}
1420+
1421+
static bool IsArch3SopcInstLiteralHasLit0(uint64_t dword) {
1422+
return (((dword & 0xff)) == 255) && (((dword & 0xff00) >> 8) != 255);
1423+
}
1424+
1425+
static bool IsArch3SopcInstLiteralHasLit1(uint64_t dword) {
1426+
return (((dword & 0xff)) != 255) && (((dword & 0xff00) >> 8) == 255);
1427+
}
1428+
1429+
static bool IsArch3SopcInstLiteralHasLit0HasLit1(uint64_t dword) {
1430+
return (((dword & 0xff)) == 255) && (((dword & 0xff00) >> 8) == 255);
1431+
}
1432+
1433+
static bool IsArch3Vop1Default(uint64_t dword) {
1434+
return ((((dword & 0x1ff)) != 250) && (((dword & 0x1ff)) != 255)) && (((dword & 0x1ff)) != 249);
1435+
}
1436+
1437+
static bool IsArch3Vop1InstLiteralHasLit(uint64_t dword) {
1438+
return ((dword & 0x1ff)) == 255;
1439+
}
1440+
1441+
static bool IsArch3Vop1VopDppHasDpp(uint64_t dword) {
1442+
return ((dword & 0x1ff)) == 250;
1443+
}
1444+
1445+
static bool IsArch3Vop1VopSdwaHasSdwa(uint64_t dword) {
1446+
return ((dword & 0x1ff)) == 249;
1447+
}
1448+
1449+
static bool IsArch3Vop2Default(uint64_t dword) {
1450+
return ((((dword & 0x1ff)) != 250) && (((dword & 0x1ff)) != 255)) && (((dword & 0x1ff)) != 249);
1451+
}
1452+
1453+
static bool IsArch3Vop2InstLiteralHasLit(uint64_t dword) {
1454+
return ((dword & 0x1ff)) == 255;
1455+
}
1456+
1457+
static bool IsArch3Vop2InstLiteralDefault(uint64_t dword) {
1458+
return ((((dword & 0x1ff)) != 250) && (((dword & 0x1ff)) != 255)) && (((dword & 0x1ff)) != 249);
1459+
}
1460+
1461+
static bool IsArch3Vop2VopDppHasDpp(uint64_t dword) {
1462+
return ((dword & 0x1ff)) == 250;
1463+
}
1464+
1465+
static bool IsArch3Vop2VopSdwaHasSdwa(uint64_t dword) {
1466+
return ((dword & 0x1ff)) == 249;
1467+
}
1468+
1469+
static bool IsArch3Vop2VopSdwaSdstEncHasSdwa(uint64_t dword) {
1470+
return ((dword & 0x1ff)) == 249;
1471+
}
1472+
13811473
struct EncodingConditionHandler
13821474
{
13831475
EncodingConditionHandler()
@@ -1725,6 +1817,29 @@ namespace amdisa
17251817
arch_conditions_[2]["VOP2_VOP_DPP_has_dpp"] = IsArch2Vop2VopDppHasDpp;
17261818
arch_conditions_[2]["VOP2_VOP_SDWA_has_sdwa"] = IsArch2Vop2VopSdwaHasSdwa;
17271819
arch_conditions_[2]["VOP2_VOP_SDWA_SDST_ENC_has_sdwa"] = IsArch2Vop2VopSdwaSdstEncHasSdwa;
1820+
arch_conditions_[3]["VOPC_default"] = IsArch3VopcDefault;
1821+
arch_conditions_[3]["VOPC_INST_LITERAL_has_lit"] = IsArch3VopcInstLiteralHasLit;
1822+
arch_conditions_[3]["VOPC_VOP_SDWA_SDST_ENC_has_sdwa"] = IsArch3VopcVopSdwaSdstEncHasSdwa;
1823+
arch_conditions_[3]["SOP1_default"] = IsArch3Sop1Default;
1824+
arch_conditions_[3]["SOP1_INST_LITERAL_has_lit_0"] = IsArch3Sop1InstLiteralHasLit0;
1825+
arch_conditions_[3]["SOP2_default"] = IsArch3Sop2Default;
1826+
arch_conditions_[3]["SOP2_INST_LITERAL_has_lit_0"] = IsArch3Sop2InstLiteralHasLit0;
1827+
arch_conditions_[3]["SOP2_INST_LITERAL_has_lit_1"] = IsArch3Sop2InstLiteralHasLit1;
1828+
arch_conditions_[3]["SOP2_INST_LITERAL_has_lit_0_has_lit_1"] = IsArch3Sop2InstLiteralHasLit0HasLit1;
1829+
arch_conditions_[3]["SOPC_default"] = IsArch3SopcDefault;
1830+
arch_conditions_[3]["SOPC_INST_LITERAL_has_lit_0"] = IsArch3SopcInstLiteralHasLit0;
1831+
arch_conditions_[3]["SOPC_INST_LITERAL_has_lit_1"] = IsArch3SopcInstLiteralHasLit1;
1832+
arch_conditions_[3]["SOPC_INST_LITERAL_has_lit_0_has_lit_1"] = IsArch3SopcInstLiteralHasLit0HasLit1;
1833+
arch_conditions_[3]["VOP1_default"] = IsArch3Vop1Default;
1834+
arch_conditions_[3]["VOP1_INST_LITERAL_has_lit"] = IsArch3Vop1InstLiteralHasLit;
1835+
arch_conditions_[3]["VOP1_VOP_DPP_has_dpp"] = IsArch3Vop1VopDppHasDpp;
1836+
arch_conditions_[3]["VOP1_VOP_SDWA_has_sdwa"] = IsArch3Vop1VopSdwaHasSdwa;
1837+
arch_conditions_[3]["VOP2_default"] = IsArch3Vop2Default;
1838+
arch_conditions_[3]["VOP2_INST_LITERAL_has_lit"] = IsArch3Vop2InstLiteralHasLit;
1839+
arch_conditions_[3]["VOP2_INST_LITERAL_default"] = IsArch3Vop2InstLiteralDefault;
1840+
arch_conditions_[3]["VOP2_VOP_DPP_has_dpp"] = IsArch3Vop2VopDppHasDpp;
1841+
arch_conditions_[3]["VOP2_VOP_SDWA_has_sdwa"] = IsArch3Vop2VopSdwaHasSdwa;
1842+
arch_conditions_[3]["VOP2_VOP_SDWA_SDST_ENC_has_sdwa"] = IsArch3Vop2VopSdwaSdstEncHasSdwa;
17281843
}
17291844

17301845
using EncodingsToConditionFunctions = std::map<std::string, std::function<bool(uint64_t)>>;

source/isa_decoder/isa_decoder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ namespace amdisa
8686
static const std::map<uint32_t, GpuArchitecture> kArchitectureIdToEnum = {{0, GpuArchitecture::kCdna1},
8787
{1, GpuArchitecture::kCdna2},
8888
{2, GpuArchitecture::kCdna3},
89+
{3, GpuArchitecture::kCdna4},
8990
{5, GpuArchitecture::kRdna1},
9091
{6, GpuArchitecture::kRdna2},
9192
{8, GpuArchitecture::kRdna3},

source/isa_explorer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
2-
cmake_minimum_required(VERSION 3.0)
2+
cmake_minimum_required(VERSION 3.10)
33

44
# Setting project directories.
55
set (SRC_DIR ../../source)

source/isa_spec_cli/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
2-
cmake_minimum_required(VERSION 3.0)
2+
cmake_minimum_required(VERSION 3.10)
33

44
# Setting project directories.
55
set (SRC_DIR ../../source)

test/source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved.
2-
cmake_minimum_required(VERSION 3.0)
2+
cmake_minimum_required(VERSION 3.10)
33

44
# Setting project directories.
55
set (SRC_DIR ../source)

0 commit comments

Comments
 (0)