Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X86 unix fixes #97089

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
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
4 changes: 2 additions & 2 deletions src/coreclr/jit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ function(create_standalone_jit)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_NO_HOST)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE SELF_NO_HOST)

if ((TARGETDETAILS_ARCH STREQUAL "x64") OR (TARGETDETAILS_ARCH STREQUAL "arm64") OR ((TARGETDETAILS_ARCH STREQUAL "x86") AND NOT (TARGETDETAILS_OS STREQUAL "unix")))
if ((TARGETDETAILS_ARCH STREQUAL "x64") OR (TARGETDETAILS_ARCH STREQUAL "arm64") OR (TARGETDETAILS_ARCH STREQUAL "x86"))
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_SIMD)
target_compile_definitions(${TARGETDETAILS_TARGET} PRIVATE FEATURE_HW_INTRINSICS)
endif ()
endfunction()

if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR (CLR_CMAKE_TARGET_ARCH_I386 AND NOT CLR_CMAKE_HOST_UNIX))
if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_I386)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:FEATURE_SIMD>)
add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:IGNORE_DEFAULT_TARGET_ARCH>>>:FEATURE_HW_INTRINSICS>)
endif ()
Expand Down
20 changes: 8 additions & 12 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4467,22 +4467,18 @@ void CodeGen::genCheckUseBlockInit()
// to be modified.
CLANG_FORMAT_COMMENT_ANCHOR;

#ifdef TARGET_64BIT
#if defined(TARGET_AMD64)

// We can clear using aligned SIMD so the threshold is lower,
#if defined(TARGET_XARCH) && defined(FEATURE_SIMD)
// For AMD64 we can clear using aligned SIMD so the threshold is lower,
// and clears in order which is better for auto-prefetching
genUseBlockInit = (genInitStkLclCnt > 4);

#else // !defined(TARGET_AMD64)

#elif defined(TARGET_XARCH) && !defined(FEATURE_SIMD)
// Block init algorithm needs SIMD instructions
genUseBlockInit = 0;
#elif defined(TARGET_64BIT)
genUseBlockInit = (genInitStkLclCnt > 8);
#endif
#else

#else // !TARGET_64BIT && !TARGET_XARCH
genUseBlockInit = (genInitStkLclCnt > 4);

#endif // TARGET_64BIT
#endif // !defined(TARGET_64BIT)

if (genUseBlockInit)
{
Expand Down
3 changes: 2 additions & 1 deletion src/coreclr/vm/i386/stublinkerx86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,8 @@ VOID StubLinkerCPU::X86EmitPopRegs(unsigned regSet)
{
STANDARD_VM_CONTRACT;

for (X86Reg r = NumX86Regs; r >= kEAX; r = (X86Reg)(r-1))
/* Cmp with regs num cause r is UCHAR */
for (X86Reg r = NumX86Regs; r <= NumX86Regs; r = (X86Reg)(r-1))
t-mustafin marked this conversation as resolved.
Show resolved Hide resolved
if (regSet & (1U<<r))
X86EmitPopReg(r);
}
Expand Down
Loading