Set the right instruction bits in asmout in order
to allow using MSR with DIT and an immediate
value. This allows us to avoid using an
intermediary register when we want to set DIT
(unsetting DIT already worked with the zero
register).
Ref: https://developer.arm.com/documentation/ddi0602/2024-06/Base-Instructions/MSR--immediate---Move-immediate-value-to-special-register-?lang=en
Change-Id: Id049a0b4e0feb534cea992553228f9b5e12ddcea
Reviewed-on: https://go-review.googlesource.com/c/go/+/597595
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
MSR R17, ZCR_EL1 // 111218d5
SYS $32768, R1 // 018008d5
SYS $32768 // 1f8008d5
+ MSR $1, DIT // 5f4103d5
// TLBI instruction
TLBI VMALLE1IS // 1f8308d5
// PSTATEfield can be special registers and special operands.
if p.To.Type == obj.TYPE_REG && p.To.Reg == REG_SPSel {
v = 0<<16 | 4<<12 | 5<<5
+ } else if p.To.Type == obj.TYPE_REG && p.To.Reg == REG_DIT {
+ // op1 = 011 (3) op2 = 010 (2)
+ v = 3<<16 | 2<<5
} else if p.To.Type == obj.TYPE_SPECIAL {
opd := SpecialOperand(p.To.Offset)
for _, pf := range pstatefield {