Skip to content

Conversation

@fuad1502
Copy link
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:

public static long FunAdd(long a, long b)
{
        return a + b;
}

is as follows:

long Program.FunAdd(long, long)
Handle: 0x06000002
Rid: 2
EntryPointRuntimeFunctionId: 1
Number of RuntimeFunctions: 1

long Program.FunAdd(long, long)
Id: 1
StartAddress: 0x00010BD0
Size: 34 bytes
UnwindRVA: 0x0001091C

Debug 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: A1

10bd0: 13 01 01 ff     addi    sp, sp, -16
10bd4: 23 30 81 00     sd      s0, 0(sp)
10bd8: 23 34 11 00     sd      ra, 8(sp)
10bdc: 13 04 01 00     mv      s0, sp
10be0: 2e 95           add     a0, a0, a1 ;; RVC instruction
10be2: 83 30 81 00     ld      ra, 8(sp)
10be6: 03 34 01 00     ld      s0, 0(sp)
10bea: 13 01 01 01     addi    sp, sp, 16
10bee: 67 80 00 00     ret

@fuad1502
Copy link
Contributor Author

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
Copy link
Member

am11 commented Aug 21, 2025

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

@AndyAyersMS AndyAyersMS merged commit 0ed8759 into dotnet:main Sep 3, 2025
19 checks passed
Sign up for free to 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