Skip to content

Pad RISC-V RVC instructions like Thumb2 - #421

Merged
AndyAyersMS merged 1 commit into
dotnet:mainfrom
fuad1502:rvc
Sep 3, 2025
Merged

Pad RISC-V RVC instructions like Thumb2#421
AndyAyersMS merged 1 commit into
dotnet:mainfrom
fuad1502:rvc

Conversation

@fuad1502

Copy link
Copy Markdown
Contributor

We're introducing RVC instructions to RISC-V JIT in dotnet/runtime: dotnet/runtime#117408

With that PR and this PR, output of R2RDump tool for the following C# method:

publicstaticlongFunAdd(longa,longb){returna+b;}

is as follows:

long Program.FunAdd(long, long)Handle: 0x06000002Rid: 2EntryPointRuntimeFunctionId: 1Number of RuntimeFunctions: 1long Program.FunAdd(long, long)Id: 1StartAddress: 0x00010BD0Size: 34 bytesUnwindRVA: 0x0001091CDebug Info Bounds: Native Offset: 0x0, Prolog, Source Types: StackEmpty Native Offset: 0x10, IL Offset: 0x0000, Source Types: StackEmpty Native Offset: 0x12, Epilog, Source Types: StackEmpty Variable Locations: Variable Number: 0 Start Offset: 0x0 End Offset: 0x10 Loc Type: VLT_REG Register: A0 Variable Number: 1 Start Offset: 0x0 End Offset: 0x10 Loc Type: VLT_REG Register: A110bd0: 130101 ff addi sp,sp,-1610bd4: 23308100 sd s0,0(sp)10bd8: 23341100 sd ra,8(sp)10bdc: 13040100 mv s0,sp10be0: 2e 95add a0, a0, a1 ;; RVC instruction10be2: 83308100 ld ra,8(sp)10be6: 03340100 ld s0,0(sp)10bea: 13010101 addi sp,sp,1610bee: 67800000ret

@fuad1502

Copy link
Copy Markdown
ContributorAuthor

Hi @am11 can you help me review this PR or assign an appropriate reviewer with write access for this PR? 🙏 The related PR in dotnet/runtime (dotnet/runtime#117408) is already merged in 👍

@am11

am11 commented Aug 21, 2025

Copy link
Copy Markdown
Member

@jakobbotsch, @EgorBo, PTAL. LGTM! :)

@AndyAyersMS
AndyAyersMS merged commit 0ed8759 into dotnet:mainSep 3, 2025
19 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@fuad1502@am11@tomeksowi@AndyAyersMS