106267eb2SPalmer Dabbelt.. SPDX-License-Identifier: GPL-2.0 206267eb2SPalmer Dabbelt 306267eb2SPalmer DabbeltRISC-V Linux User ABI 406267eb2SPalmer Dabbelt===================== 506267eb2SPalmer Dabbelt 6f07b2b3fSConor DooleyISA string ordering in /proc/cpuinfo 7f07b2b3fSConor Dooley------------------------------------ 8f07b2b3fSConor Dooley 9f07b2b3fSConor DooleyThe canonical order of ISA extension names in the ISA string is defined in 10f07b2b3fSConor Dooleychapter 27 of the unprivileged specification. 11f07b2b3fSConor DooleyThe specification uses vague wording, such as should, when it comes to ordering, 12f07b2b3fSConor Dooleyso for our purposes the following rules apply: 13f07b2b3fSConor Dooley 14f07b2b3fSConor Dooley#. Single-letter extensions come first, in canonical order. 15f07b2b3fSConor Dooley The canonical order is "IMAFDQLCBKJTPVH". 16f07b2b3fSConor Dooley 17f07b2b3fSConor Dooley#. All multi-letter extensions will be separated from other extensions by an 18f07b2b3fSConor Dooley underscore. 19f07b2b3fSConor Dooley 20f07b2b3fSConor Dooley#. Additional standard extensions (starting with 'Z') will be sorted after 21f07b2b3fSConor Dooley single-letter extensions and before any higher-privileged extensions. 22f07b2b3fSConor Dooley 23f07b2b3fSConor Dooley#. For additional standard extensions, the first letter following the 'Z' 24f07b2b3fSConor Dooley conventionally indicates the most closely related alphabetical 25*2a5303b4SConor Dooley extension category. If multiple 'Z' extensions are named, they will be 26*2a5303b4SConor Dooley ordered first by category, in canonical order, as listed above, then 27*2a5303b4SConor Dooley alphabetically within a category. 28f07b2b3fSConor Dooley 29f07b2b3fSConor Dooley#. Standard supervisor-level extensions (starting with 'S') will be listed 30f07b2b3fSConor Dooley after standard unprivileged extensions. If multiple supervisor-level 31f07b2b3fSConor Dooley extensions are listed, they will be ordered alphabetically. 32f07b2b3fSConor Dooley 33f07b2b3fSConor Dooley#. Standard machine-level extensions (starting with 'Zxm') will be listed 34f07b2b3fSConor Dooley after any lower-privileged, standard extensions. If multiple machine-level 35f07b2b3fSConor Dooley extensions are listed, they will be ordered alphabetically. 36f07b2b3fSConor Dooley 37f07b2b3fSConor Dooley#. Non-standard extensions (starting with 'X') will be listed after all standard 38f07b2b3fSConor Dooley extensions. If multiple non-standard extensions are listed, they will be 39f07b2b3fSConor Dooley ordered alphabetically. 40f07b2b3fSConor Dooley 41f07b2b3fSConor DooleyAn example string following the order is:: 42f07b2b3fSConor Dooley 43f07b2b3fSConor Dooley rv64imadc_zifoo_zigoo_zafoo_sbar_scar_zxmbaz_xqux_xrux 44f07b2b3fSConor Dooley 45f07b2b3fSConor DooleyMisaligned accesses 46f07b2b3fSConor Dooley------------------- 47f07b2b3fSConor Dooley 4806267eb2SPalmer DabbeltMisaligned accesses are supported in userspace, but they may perform poorly. 49