Skip to content

Conversation

@tomeksowi
Copy link
Member

@tomeksowi tomeksowi commented Aug 22, 2025

Bring back ProbeRiscV64Quirks disabled in #117408, see #117408 (comment) for context.

I reimplemented it to avoid iterating the instruction stream backwards, which is impossible with compressed instructions without keeping a backlog of seen instruction sizes.

The new implementation recognizes only canonical auipc + jalr/ld/addi patterns. On one hand it introduces a temporary inconvenience of putting the cell name next to unnecessary addi instead of ld/jalr for patterns like this:

18ef20: 17 bf 44 01    auipc   t5, 5195
18ef24: 13 0f 8f 45    addi    t5, t5, 1112 // void Interop.ThrowExceptionForIoErrno(Interop+ErrorInfo, string, bool) (METHOD_ENTRY_DEF_TOKEN)
18ef28: 83 36 0f 00    ld      a3, 0(t5)  // <----- addi's immediate should go here instead
18ef2c: e7 80 06 00    jalr    a3

On the other hand, it is much simpler (one third of the original code size) and comments on all handles (e.g. strings), the hitherto implementation limited itself to only to calls.

Compressed jalr/ld/addi are not recognized yet, they will be implemented as we teach JIT to emit these encodings.

Part of #84834, cc @dotnet/samsung

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 22, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Aug 22, 2025
@am11 am11 added area-crossgen2-coreclr arch-riscv Related to the RISC-V architecture and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 22, 2025
@tomeksowi
Copy link
Member Author

@risc-vv /run

@risc-vv
Copy link

risc-vv commented Aug 22, 2025

RISC-V pull_request-CLR-QEMU: 9106 / 9136 (99.67%)
=======================
      passed: 9106
      failed: 2
     skipped: 586
      killed: 28
------------------------
 TOTAL tests: 9722
VIRTUAL time: 80h 21min 16s 6ms
   REAL time: 1h 19min 45s 645ms
=======================

report.xml, report.md, failures.xml, testclr_details.tar.zst

RISC-V pull_request-CLR-VF2: 9107 / 9137 (99.67%)
=======================
      passed: 9107
      failed: 2
     skipped: 586
      killed: 28
------------------------
 TOTAL tests: 9723
VIRTUAL time: 32h 29min 53s 724ms
   REAL time: 2h 9min 2s 711ms
=======================

report.xml, report.md, failures.xml, testclr_details.tar.zst

RISC-V pull_request-FX-QEMU: 0 / 1 (0.00%)
=======================
      passed: 0
      failed: 0
     skipped: 14
      killed: 1
------------------------
 TOTAL tests: 15
VIRTUAL time: 15s 616ms
   REAL time: 4h 30min 0s 520ms
=======================

report.xml, report.md, failures.xml, testclr_details.tar.zst

RISC-V pull_request-FX-VF2: 0 / 67 (0.00%)
=======================
      passed: 0
      failed: 0
     skipped: 14
      killed: 67
------------------------
 TOTAL tests: 81
VIRTUAL time: 1min 29s 737ms
   REAL time: 12h 30min 8s 431ms
=======================

report.xml, report.md, failures.xml, testclr_details.tar.zst

Build information and commands

GIT: dd1c556bac2ac5505f2300b147e25cad11c30e69
CI: d023c7d591ab286aa343d644f00b5daa59d8d6b0
REPO: dotnet/runtime
BRANCH: main
CONFIG: Checked
LIB_CONFIG: Release

@JulieLeeMSFT
Copy link
Member

We will review .NET 11 PRs when we are done with .NET 10 last minute works and less busy. Please give us a few more weeks.
CC @jakobbotsch.

@steveisok steveisok added this to the 11.0.0 milestone Oct 6, 2025
Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

LGTM. Anyone else from @dotnet/crossgen-contrib want to take a look?

@jakobbotsch
Copy link
Member

/azp run runtime

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JulieLeeMSFT
Copy link
Member

@tomeksowi please check test failures.

@JulieLeeMSFT JulieLeeMSFT added the needs-author-action An issue or pull request that requires more info or actions from the author. label Nov 3, 2025
@tomeksowi
Copy link
Member Author

@tomeksowi please check test failures.

Failing on Send to Helix, looks unrelated.

@dotnet-policy-service dotnet-policy-service bot removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Nov 3, 2025
@jakobbotsch
Copy link
Member

/ba-g Android timeout and known issue #114924

@jakobbotsch jakobbotsch merged commit c084ef3 into dotnet:main Nov 4, 2025
94 of 99 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-riscv Related to the RISC-V architecture area-crossgen2-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants