Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

operand: I32 not accepted as imm32 argument #181

Closed
mmcloughlin opened this issue Apr 13, 2021 · 0 comments
Closed

operand: I32 not accepted as imm32 argument #181

mmcloughlin opened this issue Apr 13, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@mmcloughlin
Copy link
Owner

From @vsivsi in https://gophers.slack.com/archives/C6WDZJ70S/p1618277888005900:

Quick Avo question. Why does this not work? Bug or feature?

tmp := GP32()
MOVL(I32(-1), tmp)   // MOVL: bad operands

What’s the point of I32() if it can’t be used to put a signed value into an imm32 ?

This is a bug, likely due to:

avo/operand/checks.go

Lines 48 to 52 in 3622eb0

// IsIMM32 returns true is op is a 32-bit immediate.
func IsIMM32(op Op) bool {
_, ok := op.(U32)
return ok
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant