afonso360 opened issue #5818:
:wave: Hey,
Our interpreter implementation is missing the
AtomicCASinstruction 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.
- We do a load to an address
p- Compare the loaded
pvalue to the expectedevalue passed in the instruction arguments.- We store the new value
xifpandeare equal- Return the loaded
pvalue, regardless if we actually stored or notx(I'm using the same nomenclature that we have in the
AtomicCASinstruction 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 interpretto the top of the file.If someone wants to give this a go and has any questions let me know!
afonso360 labeled issue #5818:
:wave: Hey,
Our interpreter implementation is missing the
AtomicCASinstruction 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.
- We do a load to an address
p- Compare the loaded
pvalue to the expectedevalue passed in the instruction arguments.- We store the new value
xifpandeare equal- Return the loaded
pvalue, regardless if we actually stored or notx(I'm using the same nomenclature that we have in the
AtomicCASinstruction 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 interpretto the top of the file.If someone wants to give this a go and has any questions let me know!
afonso360 edited issue #5818:
:wave: Hey,
Our interpreter implementation is missing the
AtomicCASinstruction 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.
- We do a load to an address
p- Compare the loaded
pvalue to the expectedevalue passed in the instruction arguments.- We store the new value
xifpandeare equal- Return the loaded
pvalue, regardless if we actually stored or notx(I'm using the same nomenclature that we have in the
AtomicCASinstruction 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 interpretto the top of the file.If someone wants to give this a go and has any questions let me know!
jameysharp labeled issue #5818:
:wave: Hey,
Our interpreter implementation is missing the
AtomicCASinstruction 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.
- We do a load to an address
p- Compare the loaded
pvalue to the expectedevalue passed in the instruction arguments.- We store the new value
xifpandeare equal- Return the loaded
pvalue, regardless if we actually stored or notx(I'm using the same nomenclature that we have in the
AtomicCASinstruction 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 interpretto the top of the file.If someone wants to give this a go and has any questions let me know!
afonso360 closed issue #5818:
:wave: Hey,
Our interpreter implementation is missing the
AtomicCASinstruction 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.
- We do a load to an address
p- Compare the loaded
pvalue to the expectedevalue passed in the instruction arguments.- We store the new value
xifpandeare equal- Return the loaded
pvalue, regardless if we actually stored or notx(I'm using the same nomenclature that we have in the
AtomicCASinstruction 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 interpretto the top of the file.If someone wants to give this a go and has any questions let me know!
Last updated: Dec 06 2025 at 06:05 UTC