Stream: git-wasmtime

Topic: wasmtime / issue #5818 cranelift-interpreter: Implement t...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2023 at 15:06):

afonso360 opened issue #5818:

:wave: Hey,

Our interpreter implementation is missing the AtomicCAS instruction here.

AtomicCAS usually swaps the value at an address atomically, but we've decided that our interpreter is thread unsafe and should be able to do this non atomically.

This means that the implementation of this instruction is fairly straight forward.

  1. We do a load to an address p
  2. Compare the loaded p value to the expected e value passed in the instruction arguments.
  3. We store the new value x if p and e are equal
  4. Return the loaded p value, regardless if we actually stored or not x

(I'm using the same nomenclature that we have in the AtomicCAS instruction documents)

We already have a pre-existing testsuite for this functionality so, it should just be enabling those tests for the interpreter by adding a test interpret to the top of the file.

If someone wants to give this a go and has any questions let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2023 at 15:06):

afonso360 labeled issue #5818:

:wave: Hey,

Our interpreter implementation is missing the AtomicCAS instruction here.

AtomicCAS usually swaps the value at an address atomically, but we've decided that our interpreter is thread unsafe and should be able to do this non atomically.

This means that the implementation of this instruction is fairly straight forward.

  1. We do a load to an address p
  2. Compare the loaded p value to the expected e value passed in the instruction arguments.
  3. We store the new value x if p and e are equal
  4. Return the loaded p value, regardless if we actually stored or not x

(I'm using the same nomenclature that we have in the AtomicCAS instruction documents)

We already have a pre-existing testsuite for this functionality so, it should just be enabling those tests for the interpreter by adding a test interpret to the top of the file.

If someone wants to give this a go and has any questions let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2023 at 15:06):

afonso360 edited issue #5818:

:wave: Hey,

Our interpreter implementation is missing the AtomicCAS instruction here.

AtomicCAS usually swaps the value at an address atomically, but we've decided that our interpreter is thread unsafe and should be able to do this non atomically.

This means that the implementation of this instruction is fairly straight forward.

  1. We do a load to an address p
  2. Compare the loaded p value to the expected e value passed in the instruction arguments.
  3. We store the new value x if p and e are equal
  4. Return the loaded p value, regardless if we actually stored or not x

(I'm using the same nomenclature that we have in the AtomicCAS instruction documentation)

We already have a pre-existing testsuite for this functionality so, it should just be enabling those tests for the interpreter by adding a test interpret to the top of the file.

If someone wants to give this a go and has any questions let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 17 2023 at 20:02):

jameysharp labeled issue #5818:

:wave: Hey,

Our interpreter implementation is missing the AtomicCAS instruction here.

AtomicCAS usually swaps the value at an address atomically, but we've decided that our interpreter is thread unsafe and should be able to do this non atomically.

This means that the implementation of this instruction is fairly straight forward.

  1. We do a load to an address p
  2. Compare the loaded p value to the expected e value passed in the instruction arguments.
  3. We store the new value x if p and e are equal
  4. Return the loaded p value, regardless if we actually stored or not x

(I'm using the same nomenclature that we have in the AtomicCAS instruction documentation)

We already have a pre-existing testsuite for this functionality so, it should just be enabling those tests for the interpreter by adding a test interpret to the top of the file.

If someone wants to give this a go and has any questions let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Mar 02 2023 at 21:43):

afonso360 closed issue #5818:

:wave: Hey,

Our interpreter implementation is missing the AtomicCAS instruction here.

AtomicCAS usually swaps the value at an address atomically, but we've decided that our interpreter is thread unsafe and should be able to do this non atomically.

This means that the implementation of this instruction is fairly straight forward.

  1. We do a load to an address p
  2. Compare the loaded p value to the expected e value passed in the instruction arguments.
  3. We store the new value x if p and e are equal
  4. Return the loaded p value, regardless if we actually stored or not x

(I'm using the same nomenclature that we have in the AtomicCAS instruction documentation)

We already have a pre-existing testsuite for this functionality so, it should just be enabling those tests for the interpreter by adding a test interpret to the top of the file.

If someone wants to give this a go and has any questions let me know!


Last updated: Nov 22 2024 at 16:03 UTC