Makes it possible to use them in arithmetic expressions.
lea r8, [r1*3]
lea r6, [r0-4]
lea r5, [r0-4+r8]
-%if WIN64
- %define pix_tmp rsp+0x30 ; shadow space + r4
-%else
- %define pix_tmp rsp
-%endif
+ %xdefine pix_tmp rsp+0x30*WIN64 ; shadow space + r4
; transpose 6x16 -> tmp space
TRANSPOSE6x8_MEM PASS8ROWS(r6, r5, r1, r8), pix_tmp
%macro MC_CHROMA_SSSE3 0
cglobal mc_chroma
-%if cpuflag(avx2)
- MC_CHROMA_START 9
-%else
- MC_CHROMA_START 10
-%endif
+ MC_CHROMA_START 10-cpuflag(avx2)
and r5d, 7
and t2d, 7
mov t0d, r5d
%endmacro
; FIXME: align loads to 16 bytes
-%macro MBTREE_AVX 1
-cglobal mbtree_propagate_cost, 6,6,%1
+%macro MBTREE_AVX 0
+cglobal mbtree_propagate_cost, 6,6,8-cpuflag(avx2)
vbroadcastss m6, [r5]
mov r5d, r6m
lea r0, [r0+r5*2]
%endmacro
INIT_YMM avx
-MBTREE_AVX 8
+MBTREE_AVX
INIT_YMM avx2
-MBTREE_AVX 7
+MBTREE_AVX
%macro MBTREE_PROPAGATE_LIST 0
;-----------------------------------------------------------------------------
;-----------------------------------------------------------------------------
%macro OPTIMIZE_CHROMA_2x2_DC 0
-%assign %%regs 5
-%if cpuflag(sse4)
- %assign %%regs %%regs-1
-%endif
-%if ARCH_X86_64 == 0
- %assign %%regs %%regs+1 ; t0-t4 are volatile on x86-64
-%endif
-cglobal optimize_chroma_2x2_dc, 0,%%regs,7
+cglobal optimize_chroma_2x2_dc, 0,6-cpuflag(sse4),7
movifnidn t0, r0mp
movd m2, r1m
movq m1, [t0]
%assign cpuflags_bmi1 (1<<22)|cpuflags_lzcnt
%assign cpuflags_bmi2 (1<<23)|cpuflags_bmi1
-%define cpuflag(x) ((cpuflags & (cpuflags_ %+ x)) == (cpuflags_ %+ x))
-%define notcpuflag(x) ((cpuflags & (cpuflags_ %+ x)) != (cpuflags_ %+ x))
+; Returns a boolean value expressing whether or not the specified cpuflag is enabled.
+%define cpuflag(x) (((((cpuflags & (cpuflags_ %+ x)) ^ (cpuflags_ %+ x)) - 1) >> 31) & 1)
+%define notcpuflag(x) (cpuflag(x) ^ 1)
; Takes an arbitrary number of cpuflags from the above list.
; All subsequent functions (up to the next INIT_CPUFLAGS) is built for the specified cpu.