From b9acfb4ecfbbdac123fed170f5b2806fe4e846d0 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 19 Mar 2018 22:41:06 -0400 Subject: treewide: isArm -> isAarch32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following legacy packing conventions, `isArm` was defined just for 32-bit ARM instruction set. This is confusing to non packagers though, because Aarch64 is an ARM instruction set. The official ARM overview for ARMv8[1] is surprisingly not confusing, given the overall state of affairs for ARM naming conventions, and offers us a solution. It divides the nomenclature into three levels: ``` ISA: ARMv8 {-A, -R, -M} / \ Mode: Aarch32 Aarch64 | / \ Encoding: A64 A32 T32 ``` At the top is the overall v8 instruction set archicture. Second are the two modes, defined by bitwidth but differing in other semantics too, and buttom are the encodings, (hopefully?) isomorphic if they encode the same mode. The 32 bit encodings are mostly backwards compatible with previous non-Thumb and Thumb encodings, and if so we can pun the mode names to instead mean "sets of compatable or isomorphic encodings", and then voilĂ  we have nice names for 32-bit and 64-bit arm instruction sets which do not use the word ARM so as to not confused either laymen or experienced ARM packages. [1]: https://developer.arm.com/products/architecture/a-profile (cherry picked from commit ba52ae50488de85a9cf60a3a04f1c9ca7122ec74) --- lib/systems/doubles.nix | 2 +- lib/systems/for-meta.nix | 2 +- lib/systems/inspect.nix | 7 +++++-- lib/systems/parse.nix | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/systems/doubles.nix b/lib/systems/doubles.nix index 012a1786a3cc..c6618083ce72 100644 --- a/lib/systems/doubles.nix +++ b/lib/systems/doubles.nix @@ -26,7 +26,7 @@ in rec { none = []; - arm = filterDoubles predicates.isArm; + arm = filterDoubles predicates.isAarch32; aarch64 = filterDoubles predicates.isAarch64; x86 = filterDoubles predicates.isx86; i686 = filterDoubles predicates.isi686; diff --git a/lib/systems/for-meta.nix b/lib/systems/for-meta.nix index fa713b1e6136..68c68c2cd369 100644 --- a/lib/systems/for-meta.nix +++ b/lib/systems/for-meta.nix @@ -7,7 +7,7 @@ in rec { inherit (lib.systems.doubles) all mesaPlatforms; none = []; - arm = [ patterns.isArm ]; + arm = [ patterns.isAarch32 ]; aarch64 = [ patterns.isAarch64 ]; x86 = [ patterns.isx86 ]; i686 = [ patterns.isi686 ]; diff --git a/lib/systems/inspect.nix b/lib/systems/inspect.nix index a7bd17f68a45..91ae2cd2557e 100644 --- a/lib/systems/inspect.nix +++ b/lib/systems/inspect.nix @@ -9,8 +9,8 @@ rec { isx86_64 = { cpu = cpuTypes.x86_64; }; isPowerPC = { cpu = cpuTypes.powerpc; }; isx86 = { cpu = { family = "x86"; }; }; - isArm = { cpu = { family = "arm"; }; }; - isAarch64 = { cpu = { family = "aarch64"; }; }; + isAarch32 = { cpu = { family = "arm"; bits = 32; }; }; + isAarch64 = { cpu = { family = "arm"; bits = 64; }; }; isMips = { cpu = { family = "mips"; }; }; isRiscV = { cpu = { family = "riscv"; }; }; isWasm = { cpu = { family = "wasm"; }; }; @@ -43,6 +43,9 @@ rec { [ "x86" "arm" "aarch64" ]; isSeccomputable = map (family: { kernel = kernels.linux; cpu.family = family; }) [ "x86" "arm" "aarch64" "mips" ]; + + # Deprecated after 18.03 + isArm = isAarch32; }; matchAnyAttrs = patterns: diff --git a/lib/systems/parse.nix b/lib/systems/parse.nix index 03d052f5f192..8a6c951d5e5e 100644 --- a/lib/systems/parse.nix +++ b/lib/systems/parse.nix @@ -72,7 +72,7 @@ rec { armv6l = { bits = 32; significantByte = littleEndian; family = "arm"; }; armv7a = { bits = 32; significantByte = littleEndian; family = "arm"; }; armv7l = { bits = 32; significantByte = littleEndian; family = "arm"; }; - aarch64 = { bits = 64; significantByte = littleEndian; family = "aarch64"; }; + aarch64 = { bits = 64; significantByte = littleEndian; family = "arm"; }; i686 = { bits = 32; significantByte = littleEndian; family = "x86"; }; x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; }; mips = { bits = 32; significantByte = bigEndian; family = "mips"; }; -- cgit v1.2.3