aboutsummaryrefslogtreecommitdiff
path: root/src/codegen
diff options
context:
space:
mode:
authorFelix Queißner <git@mq32.de>2024-10-04 22:53:28 +0200
committerGitHub <noreply@github.com>2024-10-04 13:53:28 -0700
commit7c74edec8d7d97677033d8a688e02ee32d82ab43 (patch)
tree8704f54815734e78861274fe8734b263082d07c5 /src/codegen
parent3e62cb5c90608580558fff1af24af68735778392 (diff)
downloadzig-7c74edec8d7d97677033d8a688e02ee32d82ab43.tar.gz
zig-7c74edec8d7d97677033d8a688e02ee32d82ab43.zip
Adds new cpu architectures propeller1 and propeller2. (#21563)
* Adds new cpu architectures propeller1 and propeller2. These cpu architectures allow targeting the Parallax Propeller 1 and Propeller 2, which are both very special microcontrollers with 512 registers and 8 cpu cores. Resolves #21559 * Adds std.elf.EM.PROPELLER and std.elf.EM.PROPELLER2 * Fixes missing switch prongs in src/codegen/llvm.zig * Fixes order in std.Target.Arch --------- Co-authored-by: Felix "xq" Queißner <git@random-projects.net>
Diffstat (limited to 'src/codegen')
-rw-r--r--src/codegen/llvm.zig7
-rw-r--r--src/codegen/spirv.zig3
2 files changed, 9 insertions, 1 deletions
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
index 9520f17a4b..21685a5ff8 100644
--- a/src/codegen/llvm.zig
+++ b/src/codegen/llvm.zig
@@ -88,7 +88,10 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
.kalimba,
.spu_2,
+ .propeller1,
+ .propeller2,
=> unreachable, // Gated by hasLlvmSupport().
+
};
try llvm_triple.appendSlice(llvm_arch);
@@ -281,7 +284,7 @@ pub fn targetArch(arch_tag: std.Target.Cpu.Arch) llvm.ArchType {
.wasm32 => .wasm32,
.wasm64 => .wasm64,
.ve => .ve,
- .spu_2 => .UnknownArch,
+ .propeller1, .propeller2, .spu_2 => .UnknownArch,
};
}
@@ -12714,6 +12717,8 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
// LLVM does does not have a backend for these.
.kalimba,
.spu_2,
+ .propeller1,
+ .propeller2,
=> unreachable,
}
}
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
index dc45b26931..164367207a 100644
--- a/src/codegen/spirv.zig
+++ b/src/codegen/spirv.zig
@@ -1856,6 +1856,9 @@ const NavGen = struct {
.flash3,
.flash4,
.flash5,
+ .cog,
+ .lut,
+ .hub,
=> unreachable,
};
}