Skip to content

Commit

Permalink
Support new ABI check with ICC/MIC
Browse files Browse the repository at this point in the history
Refs: gh-191

Signed-off-by: Matthias Kretz <kretz@kde.org>
  • Loading branch information
mattkretz committed Apr 16, 2018
1 parent 71a8171 commit 25505f4
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/abi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ macro(extract_asm marker)
execute_process(
COMMAND grep -A100 ${marker}_start ${ASM}
COMMAND grep -B100 ${marker}_end
COMMAND grep -v -e ${marker}_ -e "#"
COMMAND sed -e "s/ *#.*$//"
COMMAND grep -v -e ${marker}_ -e "^\\." -e "^ *$"
OUTPUT_VARIABLE asm)
string(STRIP "${asm}" asm)
string(REPLACE "(%rip)" "" asm "${asm}")
Expand All @@ -17,11 +18,11 @@ endmacro()
extract_asm(vector_abi)

if("${IMPL}" STREQUAL SSE)
set(reference "v?movaps a_v, %xmm0.*call .* v?movaps %xmm0, b_v")
set(reference "v?movaps a_v, %xmm0.*call.* v?movaps %xmm0, b_v")
elseif("${IMPL}" STREQUAL AVX OR "${IMPL}" STREQUAL AVX2)
set(reference "vmovaps a_v, %ymm0.*call .* vmovaps %ymm0, b_v")
set(reference "vmovaps a_v, %ymm0.*call.* vmovaps %ymm0, b_v")
elseif("${IMPL}" STREQUAL MIC)
set(reference "^vaddps %zmm(0,%zmm1|1,%zmm0),%zmm0 retq")
set(reference "vmovaps a_v, %zmm0.*call.* vmovaps %zmm0, b_v")
else()
message(FATAL_ERROR "Unknown IMPL '${IMPL}'")
endif()
Expand All @@ -36,11 +37,12 @@ endif()
# test Mask<T> ABI
#######################################################################
if("${IMPL}" STREQUAL MIC)
set(reference "%di,.*%si,") # needs to read from %di and %si
set(reference "movzwl a_m, %edi.*call.*movw %ax, b_m")
else()
string(REPLACE "_v" "_m" reference "${reference}")
endif()

extract_asm(mask_abi)
string(REPLACE "_v" "_m" reference "${reference}")
if("${asm}" MATCHES "${reference}")
message("PASS: Mask<T> ABI")
else()
Expand Down

0 comments on commit 25505f4

Please sign in to comment.