Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
c2b6454
[CLRINTRP] Port to ARM
clamp03 Jul 30, 2025
ad24b45
[CLRINTRP] Make dummy asssembly functions
clamp03 Sep 11, 2025
04b980f
Disable Float
clamp03 Sep 16, 2025
8cd71fa
[INTRP] Print HelloWorld Done
clamp03 Sep 18, 2025
55560c4
[INTRP] HelloWorld Done
clamp03 Sep 18, 2025
7df0312
[INTRP] Update X to R for arm register
clamp03 Sep 22, 2025
5b3ef8e
[INTRP] Call methods with 2 args and return value
clamp03 Sep 23, 2025
02320b0
[INTRP] Implement Args Load and Store Assemblies
clamp03 Sep 23, 2025
cb816e6
[INTRP] Add Load_Ref and Store_Ref
clamp03 Sep 23, 2025
0cc0032
[INTRP] Return I8
clamp03 Sep 23, 2025
a09723d
[INTRP] Update I8 to I4 for ARM32
clamp03 Sep 23, 2025
07d975a
[INTRP] Call to Method with LONG args
clamp03 Sep 24, 2025
9875d8b
[INTRP] Initial Support for Float and Double
clamp03 Sep 25, 2025
4d7d19f
[INTRP] Update for ARM SOFTFP
clamp03 Sep 25, 2025
ab7eca6
[INTRP] Update all assemblies for arm softp
clamp03 Sep 25, 2025
1cf65b7
[INTRP] Can Pass Arguments using Stack
clamp03 Sep 25, 2025
aabd45b
[INTRP] Remove Redundant Codes
clamp03 Sep 26, 2025
e6a79a0
[INTRP] Support Struct
clamp03 Sep 26, 2025
a5e1bd5
[INTRP] Support RetBuff
clamp03 Sep 26, 2025
b3ba6ec
[DO NOT MERGE] For Test
clamp03 Oct 13, 2025
30e25e0
[INTRP] Fix release build errors
clamp03 Oct 14, 2025
82769b4
Revert "[DO NOT MERGE] For Test"
clamp03 Oct 14, 2025
f402453
Workarounds for errors
clamp03 Oct 14, 2025
4d48c03
Revert INTERP_STACK_SLOT_SIZE
clamp03 Oct 14, 2025
1607eb2
Revert "Revert INTERP_STACK_SLOT_SIZE"
clamp03 Oct 15, 2025
8280ee2
Update StackVal for 32 bit target
clamp03 Oct 15, 2025
df468a6
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Oct 15, 2025
b93b7cd
Fix align for 8 bytes and value type
clamp03 Oct 20, 2025
a9c0d6e
8 bytes stack size for WASM
clamp03 Oct 20, 2025
705cf2e
Change interpreter stack size to 8 bytes
clamp03 Oct 22, 2025
fe42ce9
Update ProcessArgument
clamp03 Oct 22, 2025
c69cb0d
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Oct 23, 2025
4e3ac8d
Fix InterpreterStub
clamp03 Oct 23, 2025
f28a210
Fix errors in arm assembly code
clamp03 Oct 29, 2025
3819a3f
Fix stack value
clamp03 Oct 29, 2025
a59b9f0
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Oct 29, 2025
f2afae5
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Oct 30, 2025
290c759
Use TARGET_32BIT instead of TARGET_64BIT
clamp03 Nov 3, 2025
6917c7b
InterpreterTest
clamp03 Nov 3, 2025
05d8e5b
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Nov 3, 2025
ef0204b
Update OFFSETOF__Thread__m_pInterpThreadContext
clamp03 Nov 3, 2025
19aadcf
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Nov 5, 2025
dd7f72b
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Nov 7, 2025
2acec55
Update
clamp03 Nov 7, 2025
ea4ee16
Revert STACK_ALIGN_SIZE
clamp03 Nov 10, 2025
1aa5afd
Pass all arguments by a struct
clamp03 Nov 10, 2025
aad5f6e
Move target specific function to minipal
clamp03 Nov 10, 2025
5385d3e
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Nov 10, 2025
9e580fb
Fix errors
clamp03 Nov 10, 2025
48c8744
Fix: Apply review feedback
clamp03 Nov 10, 2025
acc84c3
Remove a header inclusion
clamp03 Nov 10, 2025
7e42431
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Nov 11, 2025
17e23bb
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Nov 18, 2025
146eba1
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Nov 27, 2025
d625e46
Updated based on reviews
clamp03 Nov 28, 2025
605008e
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Nov 28, 2025
3da428c
Updated based on reviews
clamp03 Dec 2, 2025
6fe4663
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Dec 2, 2025
1bb6d41
Update special handling for arm32
clamp03 Dec 2, 2025
f1a5b0d
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Dec 10, 2025
661e3a1
Fix errors after upstream merge
clamp03 Dec 10, 2025
66e32f6
Fix build error
clamp03 Dec 10, 2025
1095749
Fix a mistake
clamp03 Dec 11, 2025
ca8dfc1
Update ComputeCallStub
clamp03 Dec 11, 2025
463a0da
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Dec 11, 2025
d124c59
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Dec 24, 2025
f6ff06a
Fix offset
clamp03 Dec 24, 2025
6e542ec
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Dec 29, 2025
1b70453
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Jan 13, 2026
0103438
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Jan 19, 2026
7b6fcf8
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Jan 21, 2026
a4ad151
Merge remote-tracking branch 'origin/main' into intrp_arm
clamp03 Jan 23, 2026
978506f
Replace code comment by suggested change
clamp03 Jan 23, 2026
d530b0e
Add small int return value conversion to arm
clamp03 Jan 23, 2026
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
2 changes: 1 addition & 1 deletion src/coreclr/clr.featuredefines.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<FeatureInterpreter>true</FeatureInterpreter>
</PropertyGroup>

<PropertyGroup Condition="('$(Platform)' == 'x64' OR '$(Platform)' == 'arm64') AND ('$(Configuration)' == 'debug' OR '$(Configuration)' == 'checked') AND '$(TargetsAndroid)' != 'true'">
<PropertyGroup Condition="('$(Platform)' == 'x64' OR '$(Platform)' == 'arm64' OR '$(Platform)' == 'arm' OR '$(Platform)' == 'riscv64') AND ('$(Configuration)' == 'debug' OR '$(Configuration)' == 'checked') AND '$(TargetsAndroid)' != 'true'">
<FeatureInterpreter>true</FeatureInterpreter>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/clrfeatures.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ if(NOT DEFINED FEATURE_INTERPRETER)
elseif(CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS OR CLR_CMAKE_TARGET_MACCATALYST)
set(FEATURE_INTERPRETER 1)
else()
if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_RISCV64)
if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_RISCV64)
set(FEATURE_INTERPRETER $<IF:$<CONFIG:Debug,Checked>,1,0>)
else(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_RISCV64)
else(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_RISCV64)
set(FEATURE_INTERPRETER 0)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_RISCV64)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_RISCV64)
endif()
endif(NOT DEFINED FEATURE_INTERPRETER)

Expand Down
1 change: 1 addition & 0 deletions src/coreclr/minipal/Unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(SOURCES
doublemapping.cpp
dn-u16.cpp
dn-stdio.cpp
memory.cpp
)

add_library(coreclrminipal_objects
Expand Down
23 changes: 23 additions & 0 deletions src/coreclr/minipal/Unix/memory.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
//

#include <inttypes.h>
#include <stdlib.h>
#include "minipal.h"

void* VMToOSInterface::AlignedAllocate(size_t alignment, size_t size)
{
void* memptr;
if (posix_memalign(&memptr, alignment, size) == 0)
{
return memptr;
}
return NULL;
}

void VMToOSInterface::AlignedFree(void* memblock)
{
free(memblock);
}
1 change: 1 addition & 0 deletions src/coreclr/minipal/Windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(SOURCES
doublemapping.cpp
dn-u16.cpp
dn-stdio.cpp
memory.cpp
)
add_library(coreclrminipal
STATIC
Expand Down
19 changes: 19 additions & 0 deletions src/coreclr/minipal/Windows/memory.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//

#include <windows.h>
#include <inttypes.h>
#include <assert.h>
#include <malloc.h>
#include "minipal.h"

void* VMToOSInterface::AlignedAllocate(size_t alignment, size_t size)
{
return _aligned_malloc(size, alignment);
}

void VMToOSInterface::AlignedFree(void *memblock)
{
_aligned_free(memblock);
}
16 changes: 15 additions & 1 deletion src/coreclr/minipal/minipal.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ class VMToOSInterface
// Return:
// true if it succeeded, false if it failed
static bool FreeThunksFromTemplate(void* thunks, size_t templateSize);

// Allocate aligned memory block
// Parameters:
// alignment - The desired alignment for the memory block.
// size - The total number of bytes to allocate
// Return:
// NULL if allocation fails
// Non-Null, a pointer to the allocated region
static void* AlignedAllocate(size_t alignment, size_t size);

// Free aligned memory block
// Parameters:
// memblock - Memory block previously returned by AlignedAllocate
static void AlignedFree(void* memblock);
};

#if defined(HOST_64BIT) && defined(FEATURE_CACHED_INTERFACE_DISPATCH)
Expand All @@ -124,4 +138,4 @@ FORCEINLINE uint8_t PalInterlockedCompareExchange128(_Inout_ int64_t volatile *p
{
return _InterlockedCompareExchange128(pDst, iValueHigh, iValueLow, pComparandAndResult);
}
#endif // defined(HOST_64BIT) && defined(FEATURE_CACHED_INTERFACE_DISPATCH)
#endif // defined(HOST_64BIT) && defined(FEATURE_CACHED_INTERFACE_DISPATCH)
22 changes: 22 additions & 0 deletions src/coreclr/pal/inc/unixasmmacrosarm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ C_FUNC(\Name):
.endif

__PWTB_StackAlloc = __PWTB_TransitionBlock
__PWTB_ArgumentRegisters = __PWTB_StackAlloc + 36

.ifnc \pushArgRegs, DoNotPushArgRegs
PUSH_ARGUMENT_REGISTERS
Expand Down Expand Up @@ -355,3 +356,24 @@ C_FUNC(\Name):
movw \DestReg, #((\Constant) & 0xFFFF)
movt \DestReg, #((\Constant) >> 16)
.endm


// thumb with PIC version
.macro INLINE_GET_TLS_VAR var
ldr r0, 2f
1:
add r0, pc, r0
bl __tls_get_addr
b 3f

// Inline data
// LLVM assembler has no concept of subsections and this is not expressible as
// cross-section relocation.
.p2align 2
2:
.extern \var
.type \var, tls_object
.long \var(TLSGD) + (2b - 1b - 4)
3:
.endm

31 changes: 31 additions & 0 deletions src/coreclr/vm/arm/asmconstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ ASMCONSTANTS_C_ASSERT(ASM_MIN_OBJECT_SIZE == MIN_OBJECT_SIZE);
#define MethodTable__enum_flag_ContainsGCPointers 0x01000000
ASMCONSTANTS_C_ASSERT(MethodTable__enum_flag_ContainsGCPointers == MethodTable::enum_flag_ContainsGCPointers);

#define METHODDESC_REGISTER r12

#define SIZEOF__MethodTable DBG_FRE(0x2c, 0x28)
ASMCONSTANTS_C_ASSERT(SIZEOF__MethodTable == sizeof(MethodTable));

Expand Down Expand Up @@ -198,6 +200,35 @@ ASMCONSTANTS_C_ASSERT(CallCountingStubData__TargetForMethod == offsetof(CallCoun
ASMCONSTANTS_C_ASSERT(CallCountingStubData__TargetForThresholdReached == offsetof(CallCountingStubData, TargetForThresholdReached))
#endif // FEATURE_TIERED_COMPILATION

#define OFFSETOF__ThreadLocalInfo__m_pThread 0
ASMCONSTANTS_C_ASSERT(OFFSETOF__ThreadLocalInfo__m_pThread == offsetof(ThreadLocalInfo, m_pThread))

#ifdef FEATURE_INTERPRETER
#ifdef _DEBUG
#define OFFSETOF__InterpMethod__pCallStub 0x14
#else
#define OFFSETOF__InterpMethod__pCallStub 0x10
#endif
ASMCONSTANTS_C_ASSERT(OFFSETOF__InterpMethod__pCallStub == offsetof(InterpMethod, pCallStub))

#ifdef TARGET_UNIX
#define OFFSETOF__Thread__m_pInterpThreadContext 0x634
#else // TARGET_UNIX
#define OFFSETOF__Thread__m_pInterpThreadContext 0x0
#endif // TARGET_UNIX
ASMCONSTANTS_C_ASSERT(OFFSETOF__Thread__m_pInterpThreadContext == offsetof(Thread, m_pInterpThreadContext))

#define OFFSETOF__InterpThreadContext__pStackPointer 0x8
ASMCONSTANTS_C_ASSERT(OFFSETOF__InterpThreadContext__pStackPointer == offsetof(InterpThreadContext, pStackPointer))

#define OFFSETOF__CallStubHeader__Routines 0x10
ASMCONSTANTS_C_ASSERT(OFFSETOF__CallStubHeader__Routines == offsetof(CallStubHeader, Routines))

#define SIZEOF__TransitionBlock 0x34
ASMCONSTANTS_C_ASSERT(SIZEOF__TransitionBlock == sizeof(TransitionBlock))

#endif // FEATURE_INTERPRETER

#ifdef PROFILING_SUPPORTED
#define PROFILE_ENTER 0x1
#define PROFILE_LEAVE 0x2
Expand Down
Loading