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

i8/i16 values with limited operators #1049

Closed
AndrewScheidecker opened this issue Apr 28, 2017 · 5 comments
Closed

i8/i16 values with limited operators #1049

AndrewScheidecker opened this issue Apr 28, 2017 · 5 comments
Assignees

Comments

@AndrewScheidecker
Copy link

previous discussion: #85

Looking at the atomics proposal, there are a lot of operators that are only necessary because WASM doesn't have i8 and i16 value types. e.g. here are the operators for atomic adds:

  • i32.atomic.rmw8_s.add
  • i32.atomic.rmw8_u.add
  • i32.atomic.rmw16_s.add
  • i32.atomic.rmw16_u.add
  • i32.atomic.rmw.add
  • i64.atomic.rmw8_s.add
  • i64.atomic.rmw8_u.add
  • i64.atomic.rmw16_s.add
  • i64.atomic.rmw16_u.add
  • i64.atomic.rmw32_s.add
  • i64.atomic.rmw32_u.add
  • i64.atomic.rmw.add

If there were i8 and i16 value types, those could be simplified to:

  • i8.atomic.rmw.add
  • i16.atomic.rmw.add
  • i32.atomic.rmw.add
  • i64.atomic.rmw.add

The same applies to the atomic xchg, cmpxchg, load, sub, and, or, and xor operators.

Would folks consider adding i8 and i16 types that have a limited set of conversion operators meant for composition with the memory loads/stores? e.g. for i8:

  • i8.wrap/i32 / i8.wrap/i64
  • i32.extend_s/i8 / i64.extend_s/i8
  • i32.extend_u/i8 / i64.extend_u/i8
@jfbastien
Copy link
Member

I think this is worth discussing as part of the threads discussion in the upcoming performance meeting. @binji could you add it to the threads proposal and make sure it's one of the items discussed?

@binji
Copy link
Member

binji commented May 11, 2017

Sounds good.

@binji
Copy link
Member

binji commented Jun 21, 2017

We discussed this in the CG meeting and decided not to implement i8/i16 value types at this time.

On a related point, we decided to pursue new sign-extending operators along with the threading proposal:

  • i32.extend_s/i8
  • i32.extend_s/i16
  • i64.extend_s/i8
  • i64.extend_s/i16

See https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md#new-sign-extending-operators.

@binji binji closed this as completed Jun 21, 2017
@rossberg
Copy link
Member

rossberg commented Jun 22, 2017 via email

@binji
Copy link
Member

binji commented Jun 22, 2017

Good point; opened WebAssembly/threads#34 to discuss.

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

No branches or pull requests

4 participants