[XviD-devel] new .asm file (dev-api-3 only)

skal xvid-devel@xvid.org
30 Sep 2002 14:20:29 +0200


	Hi all,


	aaargh...

On Thu, 2002-09-26 at 11:22, skal wrote:
> %macro B_TO_Q 4   ; %1:SrcLeft, %2:Width, %3:mm#0, %4:mm#1
>     ; replicate left and right bytes into quardwords
>   movq %4, [%1+%2-8]    ; <= -8 offset: we align Right read (most common case)
>   movq %3, [%1]
>   punpckhbw %4,%4
>   punpcklbw %3,%3
>   pshufw %4,%4,0xff
>   pshufw %3,%3,0x00
> %endmacro

	I forgot that 'pshufw' is a a SSE-only instruction!
	Here's to replacement macro for MMX (~2% slower)

%macro B_TO_Q_MMX 4   ; %1:SrcLeft, %2:Width, %3:mm#0, %4:mm#1
    ; replicate left and right bytes into quadwords
  movq %3, [%1]
  punpcklbw %3,%3
  movq %4, [%1+%2-8]    ; <- -8 offset: we align Right read
  punpcklwd %3,%3
  punpckhbw %4,%4
  punpckldq %3,%3
  punpckhwd %4,%4
  punpckhdq %4,%4
%endmacro


	Btw, regarding the inlined ASM/NASM discussion: personally
	I prefer NASM than inlined ASM (either MVSC intrinsics or
	macroized a-la-ffmpeg). NASM may have some defects, but
	it has macros and does *not* make any smart things, which
	is a plus I think when ASM is at stake. You only get what
	you write. Period. Besides, I don't like inlined ASM for
	*developing* ASM code: you spend lot of time moving
	instructions around, changing them, renaming regs, etc...
	It's easier done with a plain ASM file.

	just my .02 you-know-what

	bye!
		Skal