Skip to content

Commit

Permalink
Zero-extend comparand parameter of RhpLockCmpXchg16 to match the mana…
Browse files Browse the repository at this point in the history
…ged (#97743)

prototype which uses signed type argument and is thus sign extended.
Conversely, sign extend the return value.
  • Loading branch information
filipnavara authored Jan 31, 2024
1 parent d2e51ee commit 32db100
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/coreclr/nativeaot/Runtime/arm/Interlocked.S
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ LEAF_END RhpLockCmpXchg8, _TEXT
// r1 = value
// r2 = comparand
LEAF_ENTRY RhpLockCmpXchg16, _TEXT
uxth r2, r2
dmb
ALTERNATE_ENTRY RhpLockCmpXchg16AVLocation
LOCAL_LABEL(CmpXchg16Retry):
Expand All @@ -46,7 +47,7 @@ LOCAL_LABEL(CmpXchg16Retry):
cmp r12, #0
bne LOCAL_LABEL(CmpXchg16Retry)
LOCAL_LABEL(CmpXchg16Exit):
mov r0, r3
sxth r0, r3
dmb
bx lr
LEAF_END RhpLockCmpXchg16, _TEXT
Expand Down

0 comments on commit 32db100

Please sign in to comment.