Skip to content

Commit

Permalink
include HW implementations from Intel & Arm for both CRC32C & CRC64-E…
Browse files Browse the repository at this point in the history
…CMA.
  • Loading branch information
lihuiba committed Jan 7, 2025
1 parent 83a6ffb commit 7000c87
Show file tree
Hide file tree
Showing 9 changed files with 2,044 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.linux.arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
debug-build-from-source:
runs-on: ubuntu-latest
container:
image: almalinux:8
image: ghcr.io/alibaba/photon-ut-base:latest
steps:
- uses: actions/checkout@v4
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.macos.x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
brew install cmake openssl gflags googletest gsasl
brew install cmake openssl gflags googletest gsasl nasm
- name: Build
run: |
Expand Down
17 changes: 12 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ if (NOT (${ARCH} STREQUAL x86_64) AND NOT (${ARCH} STREQUAL aarch64) AND NOT (${
endif ()

# Global compile options, only effective within this project
set(global_compile_options -Wall -Wno-error=pragmas)
set(global_compile_options "-Wall -Wno-error=pragmas")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
# Hint: -faligned-new is enabled by default after -std=c++17
list(APPEND global_compile_options -Werror -faligned-new)
set(global_compile_options "${global_compile_options} -Werror -faligned-new")
endif ()
add_compile_options(${global_compile_options})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${global_compile_options}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${global_compile_options}")

if (PHOTON_BUILD_WITH_ASAN)
if ((NOT CMAKE_BUILD_TYPE STREQUAL "Debug") OR (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux"))
Expand Down Expand Up @@ -202,9 +203,15 @@ file(GLOB PHOTON_SRC RELATIVE "${PROJECT_SOURCE_DIR}"
rpc/*.cpp
thread/*.cpp
)
if ((${ARCH} STREQUAL aarch64) OR (${ARCH} STREQUAL arm64))
list(APPEND PHOTON_SRC common/checksum/crc64_ecma_refl_pmull.S)
if (${ARCH} STREQUAL x86_64)
enable_language(ASM_NASM)
list(APPEND PHOTON_SRC ${PROJECT_SOURCE_DIR}/common/checksum/crc64_ecma_refl_by8.asm
${PROJECT_SOURCE_DIR}/common/checksum/crc32_iscsi_00.asm)
else ()
list(APPEND PHOTON_SRC ${PROJECT_SOURCE_DIR}/common/checksum/crc64_ecma_refl_pmull.S
${PROJECT_SOURCE_DIR}/common/checksum/crc32_iscsi_crc_ext.S)
endif ()

if (APPLE)
list(APPEND PHOTON_SRC io/kqueue.cpp)
else ()
Expand Down
Loading

0 comments on commit 7000c87

Please sign in to comment.