Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use the same predicated compare as on Unix when checking ephemeral lo…
…w/high
  • Loading branch information
VSadov committed Apr 10, 2023
commit da811d6121b60f45f3c211df626ed12af34df9a4
9 changes: 7 additions & 2 deletions src/coreclr/vm/arm64/asmhelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,15 @@ CheckCardTable
ldr x12, wbs_ephemeral_low
cbz x12, SkipEphemeralCheck
cmp x15, x12
blo Exit

ldr x12, wbs_ephemeral_high
cmp x15, x12

; Compare against the upper bound if the previous comparison indicated
; that the destination address is greater than or equal to the lower
; bound. Otherwise, set the C flag (specified by the 0x2) so that the
; branch to exit is taken.
ccmp x15, x12, #0x2, hs

bhs Exit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .S version is using ccmp here. I think we should use the same pattern in both cases.

I wonder which would be better though. In theory the ephemeral check should more often fail than pass, statistically. In a large heap most objects are tenured. Ephemeral set is supposed to be small.

On the other hand both patterns probably work the same on a speculative CPU, but the predicated pattern is shorter by one instruction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And on server GC ephemeral check will always pass. I think, since we are touching this, it should be switched to the predicated form like in .S


SkipEphemeralCheck
Expand Down