Skip to content

Commit fa253c4

Browse files
barracuda156Jarod42
andcommitted
Support powerpc
Co-authored-by: Joris Dauphin <[email protected]>
1 parent 903b3aa commit fa253c4

File tree

7 files changed

+23
-0
lines changed

7 files changed

+23
-0
lines changed

premake5.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@
172172
{ "ARM64", "ARM64" },
173173
{ "x86", "x86 (On macOS, same as x86_64.)" },
174174
{ "x86_64", "x86_64" },
175+
{ "ppc", "PowerPC 32-bit" },
176+
{ "ppc64", "PowerPC 64-bit" },
175177
{ "Universal", "Universal Binary (macOS only)" },
176178
--
177179
{ "Win32", "Same as x86" },
@@ -243,6 +245,14 @@
243245
buildoptions { "-arch arm64", "-arch x86_64" }
244246
linkoptions { "-arch arm64", "-arch x86_64" }
245247

248+
filter { "system:macosx", "options:arch=ppc" }
249+
buildoptions { "-arch ppc" }
250+
linkoptions { "-arch ppc" }
251+
252+
filter { "system:macosx", "options:arch=ppc64" }
253+
buildoptions { "-arch ppc64" }
254+
linkoptions { "-arch ppc64" }
255+
246256
filter { "system:windows", "options:arch=ARM" }
247257
platforms { "ARM" }
248258

src/_premake_init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
p.ARM64,
3131
p.RISCV64,
3232
p.LOONGARCH64,
33+
p.PPC,
34+
p.PPC64,
3335
p.WASM32,
3436
p.WASM64,
3537
p.E2K
@@ -968,6 +970,7 @@
968970
"SSSE3",
969971
"SSE4.1",
970972
"SSE4.2",
973+
"ALTIVEC",
971974
}
972975
}
973976

src/base/_foundation.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
premake.ARM64 = "ARM64"
6666
premake.RISCV64 = "RISCV64"
6767
premake.LOONGARCH64 = "loongarch64"
68+
premake.PPC = "ppc"
69+
premake.PPC64 = "ppc64"
6870
premake.WASM32 = "wasm32"
6971
premake.WASM64 = "wasm64"
7072
premake.E2K = "e2k"

src/host/premake.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575
#define PLATFORM_ARCHITECTURE "loongarch64"
7676
#elif defined(__e2k__)
7777
#define PLATFORM_ARCHITECTURE "e2k"
78+
#elif defined(__ppc64__) || defined(__powerpc64__)
79+
#define PLATFORM_ARCHITECTURE "ppc64"
80+
#elif defined(__ppc__) || defined(__powerpc__)
81+
#define PLATFORM_ARCHITECTURE "ppc"
7882
#elif !defined(RC_INVOKED)
7983
#error Unknown architecture detected
8084
#endif

src/tools/gcc.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
SSSE3 = "-mssse3",
101101
["SSE4.1"] = "-msse4.1",
102102
["SSE4.2"] = "-msse4.2",
103+
ALTIVEC = "-maltivec",
103104
},
104105
isaextensions = {
105106
MOVBE = "-mmovbe",

website/docs/architecture.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ architecture ("value")
1515
* `ARM64`
1616
* `RISCV64`
1717
* `loongarch64`
18+
* `ppc`
19+
* `ppc64`
1820
* `wasm32`,
1921
* `wasm64`,
2022
* `e2k`,

website/docs/vectorextensions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ If no value is set for a configuration, the toolset's default vector extension s
2222
| SSSE3 | Use the SSSE3 instruction set. |
2323
| SSE4.1 | Use the SSE4.1 instruction set. |
2424
| SSE4.2 | Use the SSE4.2 instruction set. |
25+
| ALTIVEC | Use Altivec (ISA 2.02) instruction set. |
2526
| NEON | Use the NEON instruction set (Android only) |
2627
| MXU | Use the XBurst SIMD instructions (Android only) |
2728

0 commit comments

Comments
 (0)