Skip to content

Commit f0dbe83

Browse files
committed
stdarch-test: [us]shll[tb] have no aliases
SVE's `[us]shll[tb]` intructions have no aliases unlike Neon's `[us]hll{2}` so this logic needs adjusted to not accidentally rewrite the instruction.
1 parent 98405ca commit f0dbe83

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

crates/stdarch-test/src/disassembly.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,26 @@ fn parse(output: &str) -> HashSet<Function> {
158158
};
159159

160160
if cfg!(any(target_arch = "aarch64", target_arch = "arm64ec")) {
161-
// Normalize [us]shll.* ..., #0 instructions to the preferred form: [us]xtl.* ...
162-
// as neither LLVM objdump nor dumpbin does that.
163-
// See https://developer.arm.com/documentation/ddi0602/latest/SIMD-FP-Instructions/UXTL--UXTL2--Unsigned-extend-Long--an-alias-of-USHLL--USHLL2-
164-
// and https://developer.arm.com/documentation/ddi0602/latest/SIMD-FP-Instructions/SXTL--SXTL2--Signed-extend-Long--an-alias-of-SSHLL--SSHLL2-
165-
// for details.
161+
// Normalize `[us]shll{2}.* ..., #0` instructions to the preferred
162+
// form: `[us]xtl{2}.* ...` as neither LLVM objdump nor dumpbin does that.
163+
//
164+
// SVE has `[us]shll[tb]` instructions that don't have an equivalent alias.
165+
//
166+
// See Arm documentation for details:
167+
//
168+
// - https://developer.arm.com/documentation/ddi0602/2026-03/SIMD-FP-Instructions/UXTL--UXTL2--Unsigned-extend-long--an-alias-of-USHLL--USHLL2-?lang=en
169+
// - https://developer.arm.com/documentation/ddi0602/2026-03/SIMD-FP-Instructions/SXTL--SXTL2--Signed-extend-long--an-alias-of-SSHLL--SSHLL2-?lang=en
166170
fn is_shll(instr: &str) -> bool {
167171
if cfg!(target_env = "msvc") {
168-
instr.starts_with("ushll") || instr.starts_with("sshll")
172+
instr == "ushll"
173+
|| instr == "ushll2"
174+
|| instr == "sshll"
175+
|| instr == "sshll2"
169176
} else {
170-
instr.starts_with("ushll.") || instr.starts_with("sshll.")
177+
instr == "ushll."
178+
|| instr == "ushll2."
179+
|| instr == "sshll."
180+
|| instr == "sshll2."
171181
}
172182
}
173183
match (parts.first(), parts.last()) {

0 commit comments

Comments
 (0)