Rename Arm to Aarch32, fix some of its code gen

As far as I can tell, Aarch32 only supports 32-bit
registers, so its pointers should be 4 bytes and
its F64 alignment should be 4 bytes as well
(because it's emulated in software).
This commit is contained in:
Richard Feldman 2022-05-24 10:54:45 -04:00
parent 777625be21
commit fb5f30e5ed
No known key found for this signature in database
GPG Key ID: 7E4127D1E4241798
3 changed files with 8 additions and 11 deletions

View File

@ -1134,7 +1134,7 @@ fn arch_to_str(architecture: &Architecture) -> &'static str {
Architecture::X86_64 => "x86_64",
Architecture::X86_32 => "x86",
Architecture::Aarch64 => "aarch64",
Architecture::Arm => "arm",
Architecture::Aarch32 => "arm",
Architecture::Wasm32 => "wasm32",
}
}

View File

@ -60,11 +60,8 @@ impl FloatWidth {
match self {
F32 => 4,
F64 | F128 => match target_info.architecture {
Architecture::X86_64
| Architecture::Aarch64
| Architecture::Arm
| Architecture::Wasm32 => 8,
Architecture::X86_32 => 4,
Architecture::X86_64 | Architecture::Aarch64 | Architecture::Wasm32 => 8,
Architecture::X86_32 | Architecture::Aarch32 => 4,
},
}
}
@ -129,7 +126,7 @@ impl IntWidth {
U64 | I64 => match target_info.architecture {
Architecture::X86_64
| Architecture::Aarch64
| Architecture::Arm
| Architecture::Aarch32
| Architecture::Wasm32 => 8,
Architecture::X86_32 => 4,
},

View File

@ -70,7 +70,7 @@ pub enum Architecture {
X86_64,
X86_32,
Aarch64,
Arm,
Aarch32,
Wasm32,
}
@ -79,8 +79,8 @@ impl Architecture {
use Architecture::*;
match self {
X86_64 | Aarch64 | Arm => PtrWidth::Bytes8,
X86_32 | Wasm32 => PtrWidth::Bytes4,
X86_64 | Aarch64 => PtrWidth::Bytes8,
X86_32 | Aarch32 | Wasm32 => PtrWidth::Bytes4,
}
}
@ -95,7 +95,7 @@ impl From<target_lexicon::Architecture> for Architecture {
target_lexicon::Architecture::X86_64 => Architecture::X86_64,
target_lexicon::Architecture::X86_32(_) => Architecture::X86_32,
target_lexicon::Architecture::Aarch64(_) => Architecture::Aarch64,
target_lexicon::Architecture::Arm(_) => Architecture::Arm,
target_lexicon::Architecture::Arm(_) => Architecture::Aarch32,
target_lexicon::Architecture::Wasm32 => Architecture::Wasm32,
_ => unreachable!("unsupported architecture"),
}