-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
stop hiding the concept of sub-architecture #1526
Comments
What is the goal for exposing it? There are normally a couple of different dimensions when describing a platform, especially with as much variance as ARM/AArch64: |
To avoid this: zig/std/special/compiler_rt/index.zig Lines 152 to 230 in a69695a
and this: zig/src-self-hosted/target.zig Lines 93 to 141 in a69695a
|
pub const Arch = union(enum) {
arm: Arm32,
armeb: Arm32,
aarch64: Arm64,
aarch64_be: Arm64,
arc,
avr,
bpfel,
bpfeb,
hexagon,
mips,
mipsel,
mips64,
mips64el,
msp430,
nios2,
powerpc,
powerpc64,
powerpc64le,
r600,
amdgcn,
riscv32,
riscv64,
sparc,
sparcv9,
sparcel,
s390x,
tce,
tcele,
thumb: Arm32,
thumbeb: Arm32,
i386,
x86_64,
xcore,
nvptx,
nvptx64,
le32,
le64,
amdil,
amdil64,
hsail,
hsail64,
spir,
spir64,
kalimba: Kalimba,
shave,
lanai,
wasm32,
wasm64,
renderscript32,
renderscript64,
pub const Arm32 = enum {
v8_4a,
v8_3a,
v8_2a,
v8_1a,
v8,
v8r,
v8m_baseline,
v8m_mainline,
v7,
v7em,
v7m,
v7s,
v7k,
v7ve,
v6,
v6m,
v6k,
v6t2,
v5,
v5te,
v4t,
};
pub const Arm64 = enum {
v8_4a,
v8_3a,
v8_2a,
v8_1a,
v8,
v8r,
v8m_baseline,
v8m_mainline,
};
pub const Kalimba = enum {
v5,
v4,
v3,
};
}; |
Right now, LLVM has the concept of architecture and sub-architecture, and the stag1 Zig compiler has this concept as well. However we hide the concept from Zig programmers, pretending there is only architecture:
These should all be the
arm
architecture with a bunch of different sub-architectures.Arguably even the
thumb
stuff should be sub-architecture of arm.in
@import("buitlin")
this needs to change:we should make it a tagged union.
The text was updated successfully, but these errors were encountered: