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.
- We do a load to an address
p
- Compare the loaded
p
value to the expectede
value passed in the instruction arguments.- We store the new value
x
ifp
ande
are equal- Return the loaded
p
value, regardless if we actually stored or notx
(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!
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.
- We do a load to an address
p
- Compare the loaded
p
value to the expectede
value passed in the instruction arguments.- We store the new value
x
ifp
ande
are equal- Return the loaded
p
value, regardless if we actually stored or notx
(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!
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.
- We do a load to an address
p
- Compare the loaded
p
value to the expectede
value passed in the instruction arguments.- We store the new value
x
ifp
ande
are equal- Return the loaded
p
value, regardless if we actually stored or notx
(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!
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.
- We do a load to an address
p
- Compare the loaded
p
value to the expectede
value passed in the instruction arguments.- We store the new value
x
ifp
ande
are equal- Return the loaded
p
value, regardless if we actually stored or notx
(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!
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.
- We do a load to an address
p
- Compare the loaded
p
value to the expectede
value passed in the instruction arguments.- We store the new value
x
ifp
ande
are equal- Return the loaded
p
value, regardless if we actually stored or notx
(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: Dec 23 2024 at 13:07 UTC