Giter Club home page Giter Club logo

Comments (7)

lukewagner avatar lukewagner commented on August 12, 2024

The evaluator always ignores alignment. The intention is that None means "no hint" and therefore natural alignment. But I guess I can see confusion with None meaning "completely unaligned" (i.e., align=1), so it'd be just as well to remove the option and make align an int that parser.mly fills in when missing.

from spec.

jcbeyler avatar jcbeyler commented on August 12, 2024

Plus we should perhaps define this in the design no? I looked quickly and did not see much information about the lack of information on alignment and what it implied.

from spec.

lukewagner avatar lukewagner commented on August 12, 2024

If we keep alignment an option, then yes, it'd make sense for AstSemantics.md to say the hint is optional and, when not present, natural alignment should be assumed. If the alignment is changed to a non-optional int, then it's a syntactic sugar detail of the sexpr language that the align immediate is optional.

from spec.

jcbeyler avatar jcbeyler commented on August 12, 2024

Seems bizarre to me to say that we have to do align for a load but the immediate is optional.

(i32.load align (i32.const 0)) seems just overkill. I really think that the default should be that it is optional and if not there, it is defined in the AstSemantics.md as then meaning the load is of natural alignment.

from spec.

titzer avatar titzer commented on August 12, 2024

I think Luke was suggesting that the hint missing means that the access is
assumed to be aligned.

So:

(i32.load (i32.const 0))

and

(i32.load unaligned (i32.const 1))

?

On Tue, Nov 3, 2015 at 6:52 AM, jcbeyler [email protected] wrote:

Seems bizarre to me to say that we have to do align for a load but the
immediate is optional.

(i32.load align (i32.const 0)) seems just overkill. I really think that
the default should be that it is optional and if not there, it is defined
in the AstSemantics.md as then meaning the load is of natural alignment.


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

from spec.

lukewagner avatar lukewagner commented on August 12, 2024

The s-expr language offers a variety of syntactic sugar wherein you can omit things and the obvious default AST node is generated. Having a missing align attribute imply natural alignment seems to be no different. Thus, (i32.load (i32.const 0)) would imply align=4. From AstSemantics.md POV (as it is currently written), there is always an alignment immediate, so no need to say what the default is. However, as I said above, we could change AstSemantics.md to say "alignment is optional, when missing natural alignment is assumed". I think it's all just a matter of subjective preference until we get to the binary encoding.

from spec.

rossberg avatar rossberg commented on August 12, 2024

This has been resolved.

from spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.