Commit f6ea0d6
committed
AArch64: SYSL writes its Rt operand, it does not read it
SYSL was generated with CS_AC_READ on Rt, but Rt is the destination.
"SYSL <Xt>, #<op1>, <Cn>, <Cm>{, #<op2>}" is the system instruction
WITH RESULT, and the Arm ARM names Xt "the 64-bit name of the
general-purpose destination register", encoded in the Rt field.
Before:
sysl x0, #0, c0, c0, #0
operands[0].type: REG = x0
operands[0].access: READ
Registers read: x0
After:
sysl x0, #0, c0, c0, #0
operands[0].type: REG = x0
operands[0].access: WRITE
Registers modified: x0
A consumer tracking register liveness saw a use where there is a
definition, which is the unsafe direction: a value written into Xt
looked like it was still needed.
SYS (without the L) is the opposite direction -- its Xt is a source,
and it takes it as the last operand -- and is already CS_AC_READ; it is
untouched.
Adds the correction to suite/auto-sync/inc_patches so it survives
regeneration, plus a regression case. That case asserts regs_write
rather than the operand list because two of SYSL's five operands are
AARCH64_OP_CIMM, which cstest's operand comparison does not handle
(it would take the default branch and report "op type not handled").
regs_write is a field of the `details` mapping, alongside `aarch64`
rather than inside it, and cstest compares it through cs_regs_access()
-- the exact view this change corrects.1 parent 64edab7 commit f6ea0d6
3 files changed
Lines changed: 39 additions & 1 deletion
File tree
- arch/AArch64
- suite/auto-sync/inc_patches/AArch64
- tests/details
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46762 | 46762 | | |
46763 | 46763 | | |
46764 | 46764 | | |
46765 | | - | |
| 46765 | + | |
46766 | 46766 | | |
46767 | 46767 | | |
46768 | 46768 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1685 | 1685 | | |
1686 | 1686 | | |
1687 | 1687 | | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
0 commit comments