Skip to content

Extending FP loads, truncating FP stores #316

Closed

Description

@jfbastien

AstSemantics details sext/zext loads and stores for integer types.

Should WebAssembly also support f32→f64 extending loads, and f64→f32 truncating stores?

I'm currently teaching LLVM about load/store, and for now I can tell it to just expand these out to the appropriate instruction pair (what we call promote and demote).

Activity

  1. added this to the MVP milestone on Aug 27, 2015
  2. rossberg commented on Aug 29, 2015

    @rossberg
    Member

    Hm, I don't understand why loads/stores need to duplicate the semantics of half the conversion operators. Instead of adding more of those, wouldn't it be better to only have the minimum set of conversions built in there (i.e., only those to memory types that don't exist outside stores)?

  3. jfbastien commented on Aug 29, 2015

    @jfbastien
    MemberAuthor

    @rossberg-chromium a most wonderful idea which I wholeheartedly agreed with in #82 :-)

  4. sunfishcode commented on Aug 30, 2015

    @sunfishcode
    Member

    I don't think these are important. The current truncating store and extending loads are present because we don't want fully general i8 and i16 types. But for floating point, we do have f32 and f64, so the justification doesn't apply.

    There's also the simple-compiler argument, but on x86 where this would matter most, the unary load-operate instructions don't write a full register, so a second instruction is desirable anyway.

    There is a real possibility that we'll want load-float16-and-promote-to-float32 and so on in the future though.

  5. jfbastien commented on Aug 31, 2015

    @jfbastien
    MemberAuthor

    In any case, we do have the basic load/store and ext/trunc operations, so it can be added if/when convenient. I propose that we leave this open for now, and revisit as we get closer to MVP.

  6. sunfishcode commented on Aug 31, 2015

    @sunfishcode
    Member

    What's the motivation here? If this is about syntax sugar or encoding density, there are much more pressing concerns elsewhere.

  7. jfbastien commented on Aug 31, 2015

    @jfbastien
    MemberAuthor

    No rush, this is about consistency. The outcome could be, as @rossberg-chromium suggests, that we remove the redundant built-in conversions, or that we add the FP ones, or leave things as is. Let's leave this bug open until we're in polish mode.

  8. rossberg commented on Sep 2, 2015

    @rossberg
    Member

    I opened #326 for the broader issue.

  9. sunfishcode commented on Oct 22, 2015

    @sunfishcode
    Member

    These don't have a strong motivation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions