Skip to content

Conversation

sunfishcode
Copy link
Member

"Immediate" is the more common term to use in assembly languages.

Also, remove a broken link to the binary encoding page. The binary
encoding is not yet determined, but AstSemantics.md doesn't need to
reference it right now anyway.

"Immediate" is the more common term to use in assembly languages.

Also, remove a broken link to the binary encoding page. The binary
encoding is not yet determined, but AstSemantics.md doesn't need to
reference it right now anyway.
@rossberg
Copy link
Member

I don't think literals are the same as immediates. An immediate in assembly language is part of a given instruction. But the literal expressions in Wasm are not part of the surrounding opcode, they are (at least logically) their own, stand-alone instructions, "loading" constants. Moreover, they may or may not be implemented with CPU instructions having the constant as an immediate (for example, a float constant may need to be loaded from memory on some architectures, I believe; some constants can also be loaded from special registers, or be produced via specific opcodes).

So I disagree with this change; IMHO it is conflating abstraction levels.

@titzer
Copy link

titzer commented Sep 29, 2015

On Tue, Sep 29, 2015 at 12:55 PM, rossberg-chromium <
notifications@github.com> wrote:

I don't think literals are the same as immediates. An immediate in
assembly language is part of a given instruction. But the literal
expressions in Wasm are not part of the surrounding opcode, they are (at
least logically) their own, stand-alone instructions, "loading" constants.
Moreover, they may or may not be implemented with CPU instructions having
the constant as an immediate (for example, a float constant may need to be
loaded from memory on some architectures, I believe; some constants can
also be loaded from special registers, or be produced via specific opcodes).

So I disagree with this change; IMHO it is conflating abstraction levels.

  • 1


Reply to this email directly or view it on GitHub
#377 (comment).

@lukewagner
Copy link
Member

FWIW, I do think we have immediates, in the form of the integer operands to AST nodes (e.g., the index of get_local or the alignment of load).

@sunfishcode
Copy link
Member Author

That works for me. Immediates are things that are "part of the opcode", and we can call our "load immediate" instructions "literals" to avoid ambiguity. I submitted WebAssembly/spec#88 to implement this in the spec.

@sunfishcode sunfishcode deleted the immediate branch September 29, 2015 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants