Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Conversation

@arunetm
Copy link
Collaborator

@arunetm arunetm commented Oct 8, 2018

Calling out the expected behavior while accessing SIMD types from JS though JS API.

Ref: #9

@arunetm
Copy link
Collaborator Author

arunetm commented Oct 8, 2018

@dtig @PeterJensen @binji please review.

subnormal result is rounded to 0. Note that this differs from WebAssembly
scalar floating-point semantics which require correct subnormal handling.

# JavaScript API and SIMD Values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you can go through the js-api/index.bs doc and search for 𝗂𝟨𝟦, that has pretty much all the places you'll need to do the same thing.

The ones I see missing here:

  • In Global constructor
  • In GetGlobalValue
  • In Global.value attribute

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed.


### ToJSValue

The algorithm toJSValue(w) should have an assertion ensuring w is not of the form v129.const v128.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: v128

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


### Exported Globals

If an exported global is of type v128, throw a WebAssembly.LinkError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


## WebAssembly Module Instatiation

Instantiating a WebAssembly Module from a Module moduleObject will throw a LinkError exception, when module_imports(moduleObject.[[Module]]) has an externtype of the form global mut valtype and valtype is v128.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is legal as long as the imported object's type is WebAssembly.Global and the global's valtype is v128.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good catch :)

@arunetm arunetm force-pushed the proposal-simdValuesInJSInterface branch from 374b648 to 947153b Compare October 29, 2018 23:38
Copy link
Member

@binji binji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm w/ one nit


### Global constructor

If Global(descriptor, v) constructior will throw a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror), when invoked with v of valuetype v128.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: constructor

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@arunetm arunetm force-pushed the proposal-simdValuesInJSInterface branch from f347060 to 5613a7d Compare November 8, 2018 23:24
@arunetm arunetm merged commit 449507a into WebAssembly:master Nov 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants