-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[BinaryFormat][ELF] Rename machine type INTEL205 to INTELGT #159791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
Planning to add to the list in #159791, so format it. Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
@llvm/pr-subscribers-objectyaml @llvm/pr-subscribers-llvm-binary-utilities Author: Nick Sarnie (sarnex) Changes
We will be using this type for offloading to Intel GPUs. Full diff: https://github.com/llvm/llvm-project/pull/159791.diff 5 Files Affected:
diff --git a/llvm/include/llvm/BinaryFormat/ELF.h b/llvm/include/llvm/BinaryFormat/ELF.h
index 7e880fdec3478..e619b186dfe3d 100644
--- a/llvm/include/llvm/BinaryFormat/ELF.h
+++ b/llvm/include/llvm/BinaryFormat/ELF.h
@@ -303,7 +303,7 @@ enum {
EM_BA2 = 202, // Beyond BA2 CPU architecture
EM_XCORE = 203, // XMOS xCORE processor family
EM_MCHP_PIC = 204, // Microchip 8-bit PIC(r) family
- EM_INTEL205 = 205, // Reserved by Intel
+ EM_INTELGT = 205, // Intel Graphics Technology
EM_INTEL206 = 206, // Reserved by Intel
EM_INTEL207 = 207, // Reserved by Intel
EM_INTEL208 = 208, // Reserved by Intel
diff --git a/llvm/lib/BinaryFormat/ELF.cpp b/llvm/lib/BinaryFormat/ELF.cpp
index 0ad1a09429e7c..4b430bc287ff9 100644
--- a/llvm/lib/BinaryFormat/ELF.cpp
+++ b/llvm/lib/BinaryFormat/ELF.cpp
@@ -175,7 +175,7 @@ uint16_t ELF::convertArchNameToEMachine(StringRef Arch) {
.Case("ba2", EM_BA2)
.Case("xcore", EM_XCORE)
.Case("mchp_pic", EM_MCHP_PIC)
- .Case("intel205", EM_INTEL205)
+ .Case("intelgt", EM_INTELGT)
.Case("intel206", EM_INTEL206)
.Case("intel207", EM_INTEL207)
.Case("intel208", EM_INTEL208)
@@ -584,8 +584,8 @@ StringRef ELF::convertEMachineToArchName(uint16_t EMachine) {
return "xcore";
case EM_MCHP_PIC:
return "mchp_pic";
- case EM_INTEL205:
- return "intel205";
+ case EM_INTELGT:
+ return "intelgt";
case EM_INTEL206:
return "intel206";
case EM_INTEL207:
diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp
index 0228dedb3fbfa..d9cce1eb7641d 100644
--- a/llvm/lib/ObjectYAML/ELFYAML.cpp
+++ b/llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -359,6 +359,7 @@ void ScalarEnumerationTraits<ELFYAML::ELF_EM>::enumeration(
ECase(EM_VE);
ECase(EM_CSKY);
ECase(EM_LOONGARCH);
+ ECase(EM_INTELGT);
#undef ECase
IO.enumFallback<Hex16>(Value);
}
diff --git a/llvm/test/tools/yaml2obj/ELF/intelgt.yaml b/llvm/test/tools/yaml2obj/ELF/intelgt.yaml
new file mode 100644
index 0000000000000..07281347c1331
--- /dev/null
+++ b/llvm/test/tools/yaml2obj/ELF/intelgt.yaml
@@ -0,0 +1,13 @@
+# RUN: yaml2obj %s -o %t1
+# RUN: llvm-readelf %t1 --file-headers | FileCheck %s
+
+# Test that the recently-renamed INTELGT machine type works
+
+# CHECK: Machine: Intel Graphics Technology
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2MSB
+ Type: ET_REL
+ Machine: EM_INTELGT
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index b7e48cfec5885..3092bfd42e25e 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -1305,6 +1305,7 @@ const EnumEntry<unsigned> ElfMachineType[] = {
ENUM_ENT(EM_BPF, "EM_BPF"),
ENUM_ENT(EM_VE, "NEC SX-Aurora Vector Engine"),
ENUM_ENT(EM_LOONGARCH, "LoongArch"),
+ ENUM_ENT(EM_INTELGT, "Intel Graphics Technology"),
};
const EnumEntry<unsigned> ElfSymbolBindings[] = {
|
… (#159793) Planning to add to the list in llvm/llvm-project#159791, so format it. Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
@@ -0,0 +1,13 @@ | |||
# RUN: yaml2obj %s -o %t1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this test in favor of llvm-readobj/ELF/file-header-machine-types.test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in latest commit, thanks for the review!
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
# RUN: yaml2obj %s -o %t.ve.o -D MACHINE=EM_VE | ||
# RUN: llvm-readelf --file-headers %t.ve.o | FileCheck %s -DMACHINE="NEC SX-Aurora Vector Engine" | ||
|
||
# RUN: yaml2obj %s -o %t.ve.o -D MACHINE=EM_INTELGT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use a different output name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the review! will fix this and then merge
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
EM_INTEL205
was renamed toEM_INTELGT
(ref here) and is used for Intel GPU images.We will be using this type for offloading to Intel GPUs.