feat(asm): the operand forms and defines GOROOT writes
Assisted-by: GLM 5.3 Flash
This commit is contained in:
@@ -489,6 +489,17 @@ func parseImmediate(g []token.Token) ast.Immediate {
|
||||
} else if g[i].Kind == token.Plus {
|
||||
i++
|
||||
}
|
||||
// A constant expression after the sign: $-(R - 8), $+(32-shift). The
|
||||
// toolchain folds the negated value in place (the cgo ABI macros write
|
||||
// ADJSP $-(REGS_HOST_TO_ABI0_STACK - 8)), so the sign applies to the
|
||||
// folded value exactly as it does to a bare literal.
|
||||
if i < len(g) && (g[i].Kind == token.LParen || g[i].Kind == token.Tilde) {
|
||||
if v, rest, ok := foldExpr(g[i:]); ok && len(rest) == 0 {
|
||||
imm.Val = v
|
||||
imm.HasVal = true
|
||||
return imm
|
||||
}
|
||||
}
|
||||
if i < len(g) && g[i].Kind == token.Number {
|
||||
text := g[i].Text
|
||||
if v, ok := tryInt(text); ok {
|
||||
|
||||
Reference in New Issue
Block a user