fix(asm): carry the riscv64 scalar pseudos and the swapped branches

Assisted-by: GLM 5.3 Flash
This commit is contained in:
petrbalvin committed 2026-10-07 00:47:27 +02:00
1 parent 82e8919208
commit 955bc6643e
2 files changed
+124 -46

No files matched your search

+33
View File
@@ -810,3 +810,36 @@ TEXT ·vecarith(SB), NOSPLIT, $0
}
assertRISCVDifferential(t, path, src, "vecarith")
}
// TestRISCVScalarPseudos_Differential proves the scalar pseudo tail against
// the toolchain: the NEG/NEGW and SEQZ/SNEZ one- and two-operand forms, the
// sign-injection pseudos and the two-word not-equal expansions, exactly as
// the toolchain's own testdata spells them.
func TestRISCVScalarPseudos_Differential(t *testing.T) {
src := `#include "textflag.h"
TEXT ·pseudos(SB), NOSPLIT, $0-8
NEG X5
NEG X5, X6
NEGW X5
NEGW X5, X6
SEQZ X14, X15
SNEZ X14, X15
FABSS F0, F1
FNEGS F0, F1
FNES F0, F1, X7
FABSD F0, F1
FNEGD F0, F1
FNED F0, F1, X5
FLTD F0, F1, X5
FLED F0, F1, X5
FEQD F0, F1, X5
RET
`
dir := t.TempDir()
path := filepath.Join(dir, "pseudos_riscv64.s")
if err := os.WriteFile(path, []byte(src), 0o644); err != nil {
t.Fatal(err)
}
assertRISCVDifferential(t, path, src, "pseudos")
}