fix(test): add arm64 encoding tests for Go 1.26 coverage compatibility

Assisted-by: MiMo V2.5 Pro
This commit is contained in:
2026-08-20 15:44:23 +02:00
parent 5d66343488
commit 459f4a2b6e
2 changed files with 199 additions and 0 deletions
+6
View File
@@ -214,7 +214,13 @@ func encodeARM64Instr(instr *ast.Instr, pc int, offsets map[string]int, fi arm64
}
// Register-register data processing.
// ASR/LSL/LSR/ROR with immediate operands use bitfield encoding (SBFM/UBFM).
if enc, ok := a64InstrTable[mnem]; ok && enc.format == a64FDPSR {
isShift := mnem == "ASR" || mnem == "ASRW" || mnem == "LSL" || mnem == "LSLW" ||
mnem == "LSR" || mnem == "LSRW" || mnem == "ROR" || mnem == "RORW"
if isShift && len(ops) >= 2 && isImmOperand(ops[0]) {
return encodeARM64Bitfield(mnem, enc.op, ops)
}
return encodeARM64DPSR(mnem, enc.op, ops)
}