x86: Change assembler from yasm to nasm
This is required to support AVX-512. Drop `-Worphan-labels` from ASFLAGS since it's enabled by default in nasm. Also change alignmode from `k8` to `p6` since it's more similar to `amdnop` in yasm, e.g. use long nops without excessive prefixes.
This commit is contained in:
+1
-14
@@ -836,7 +836,7 @@ BRANCH_INSTR jz, je, jnz, jne, jl, jle, jnl, jnle, jg, jge, jng, jnge, ja, jae,
|
||||
|
||||
%if ARCH_X86_64 || cpuflag(sse2)
|
||||
%ifdef __NASM_VER__
|
||||
ALIGNMODE k8
|
||||
ALIGNMODE p6
|
||||
%else
|
||||
CPU amdnop
|
||||
%endif
|
||||
@@ -1533,16 +1533,3 @@ FMA4_INSTR fmsub, pd, ps, sd, ss
|
||||
FMA4_INSTR fmsubadd, pd, ps
|
||||
FMA4_INSTR fnmadd, pd, ps, sd, ss
|
||||
FMA4_INSTR fnmsub, pd, ps, sd, ss
|
||||
|
||||
; workaround: vpbroadcastq is broken in x86_32 due to a yasm bug (fixed in 1.3.0)
|
||||
%ifdef __YASM_VER__
|
||||
%if __YASM_VERSION_ID__ < 0x01030000 && ARCH_X86_64 == 0
|
||||
%macro vpbroadcastq 2
|
||||
%if sizeof%1 == 16
|
||||
movddup %1, %2
|
||||
%else
|
||||
vbroadcastsd %1, %2
|
||||
%endif
|
||||
%endmacro
|
||||
%endif
|
||||
%endif
|
||||
|
||||
@@ -688,7 +688,7 @@ stack_alignment=4
|
||||
case $host_cpu in
|
||||
i*86)
|
||||
ARCH="X86"
|
||||
AS="${AS-yasm}"
|
||||
AS="${AS-nasm}"
|
||||
AS_EXT=".asm"
|
||||
ASFLAGS="$ASFLAGS -DARCH_X86_64=0 -I\$(SRCPATH)/common/x86/"
|
||||
if [ $compiler = GNU ]; then
|
||||
@@ -714,7 +714,7 @@ case $host_cpu in
|
||||
;;
|
||||
x86_64)
|
||||
ARCH="X86_64"
|
||||
AS="${AS-yasm}"
|
||||
AS="${AS-nasm}"
|
||||
AS_EXT=".asm"
|
||||
ASFLAGS="$ASFLAGS -DARCH_X86_64=1 -I\$(SRCPATH)/common/x86/"
|
||||
stack_alignment=16
|
||||
@@ -886,15 +886,14 @@ elif [ $compiler = ICC -a $ARCH = X86 ]; then
|
||||
fi
|
||||
|
||||
if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
|
||||
if ! as_check "vpmovzxwd ymm0, xmm0" ; then
|
||||
if ! as_check "vmovdqa32 [eax]{k1}{z}, zmm0" ; then
|
||||
VER=`($AS --version || echo no assembler) 2>/dev/null | head -n 1`
|
||||
echo "Found $VER"
|
||||
echo "Minimum version is yasm-1.2.0"
|
||||
echo "Minimum version is nasm-2.13"
|
||||
echo "If you really want to compile without asm, configure with --disable-asm."
|
||||
exit 1
|
||||
fi
|
||||
cc_check '' '' '__asm__("pabsw %xmm0, %xmm0");' && define HAVE_X86_INLINE_ASM
|
||||
ASFLAGS="$ASFLAGS -Worphan-labels"
|
||||
define HAVE_MMX
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user