1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-08 16:33:32 -05:00

Compare commits

...

2 Commits

Author SHA1 Message Date
XMRig
faa3d55123 Remove deprecated -Ofast for Clang. 2025-06-13 21:53:03 +07:00
XMRig
9e7cf69ac3 Detect CPU name and AES instructions on Windows ARM64. 2025-06-13 21:02:10 +07:00
3 changed files with 13 additions and 11 deletions

View File

@@ -63,10 +63,10 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -funroll-loops -fmerge-all-constants")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti -Wno-missing-braces") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -fmerge-all-constants")
if (ARM_TARGET EQUAL 8) if (ARM_TARGET EQUAL 8)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM8_CXX_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARM8_CXX_FLAGS}")
@@ -87,7 +87,6 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
if (BUILD_STATIC OR WIN32) if (BUILD_STATIC OR WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
endif() endif()
endif() endif()
if (NOT WIN32) if (NOT WIN32)

View File

@@ -18,10 +18,15 @@
#include "backend/cpu/platform/BasicCpuInfo.h" #include "backend/cpu/platform/BasicCpuInfo.h"
#include <Windows.h>
void xmrig::BasicCpuInfo::init_arm() void xmrig::BasicCpuInfo::init_arm()
{ {
# if __ARM_FEATURE_CRYPTO DWORD size = sizeof(m_brand) - 1;
m_flags.set(FLAG_AES, true); // FIXME const char *subkey = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0";
# endif
RegGetValueA(HKEY_LOCAL_MACHINE, subkey, "ProcessorNameString", RRF_RT_REG_SZ, nullptr, m_brand, &size);
m_flags.set(FLAG_AES, IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE));
} }

View File

@@ -1,8 +1,8 @@
/* XMRig /* XMRig
* Copyright (c) 2000-2002 Alan Cox <alan@redhat.com> * Copyright (c) 2000-2002 Alan Cox <alan@redhat.com>
* Copyright (c) 2005-2020 Jean Delvare <jdelvare@suse.de> * Copyright (c) 2005-2020 Jean Delvare <jdelvare@suse.de>
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> * Copyright (c) 2018-2025 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com> * Copyright (c) 2016-2025 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -88,7 +88,6 @@ bool xmrig::DmiReader::decode(uint8_t *buf)
} }
uint8_t *data = buf; uint8_t *data = buf;
int i = 0;
while (data + 4 <= buf + m_size) { while (data + 4 <= buf + m_size) {
dmi_header h{}; dmi_header h{};
@@ -97,7 +96,6 @@ bool xmrig::DmiReader::decode(uint8_t *buf)
if (h.length < 4 || h.type == 127) { if (h.length < 4 || h.type == 127) {
break; break;
} }
i++;
uint8_t *next = data + h.length; uint8_t *next = data + h.length;
while (static_cast<uint32_t>(next - buf + 1) < m_size && (next[0] != 0 || next[1] != 0)) { while (static_cast<uint32_t>(next - buf + 1) < m_size && (next[0] != 0 || next[1] != 0)) {