Skip to content

Conversation

sarnex
Copy link
Member

@sarnex sarnex commented Sep 19, 2025

EM_INTEL205 was renamed to EM_INTELGT (ref here) and is used for Intel GPU images.

We will be using this type for offloading to Intel GPUs.

Copy link

github-actions bot commented Sep 19, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

sarnex added a commit that referenced this pull request Sep 19, 2025
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>
@llvmbot
Copy link
Member

llvmbot commented Sep 19, 2025

@llvm/pr-subscribers-objectyaml

@llvm/pr-subscribers-llvm-binary-utilities

Author: Nick Sarnie (sarnex)

Changes

EM_INTEL205 was renamed to EM_INTELGT (ref here) and is used for Intel GPU images.

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:

  • (modified) llvm/include/llvm/BinaryFormat/ELF.h (+1-1)
  • (modified) llvm/lib/BinaryFormat/ELF.cpp (+3-3)
  • (modified) llvm/lib/ObjectYAML/ELFYAML.cpp (+1)
  • (added) llvm/test/tools/yaml2obj/ELF/intelgt.yaml (+13)
  • (modified) llvm/tools/llvm-readobj/ELFDumper.cpp (+1)
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[] = {

@sarnex sarnex requested a review from jhuber6 September 19, 2025 16:11
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Sep 19, 2025
… (#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
Copy link
Member

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

Copy link
Member Author

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>
@sarnex sarnex requested a review from MaskRay September 19, 2025 17:55
# 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
Copy link
Member

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

Copy link
Member Author

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>
@sarnex sarnex merged commit 56b6624 into llvm:main Sep 22, 2025
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants