Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Sep 1998 21:17:58 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        mark@grondar.za (Mark Murray)
Cc:        dag-erli@ifi.uio.no, ormonde@aker.com.br, hackers@FreeBSD.ORG
Subject:   Re: Assembler with FreeBSD
Message-ID:  <199809031917.VAA12329@labinfo.iet.unipi.it>
In-Reply-To: <199809031927.VAA10889@gratis.grondar.za> from "Mark Murray" at Sep 3, 98 09:26:55 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > Why do you want to do that? FreeBSD isn't DOS. Your assembler routine
> > is unlikely to be significantly faster than the corresponding C code
> > compiled with 'gcc -O3'.
> 
> Disagree.
> 
> Anyone who has seen Phil Karn's(?) DES-in-N-clock-cycles will
> recognise that a talented assembler programmer can beat the crap
> out of a C compiler if he recodes his algorithm specifically for
> _*1*_ processor type.

It is very CPU and algorithm-dependent, and not always true.

I did something similar with an FEC code (see my web page for
more) and while i could almost double performance by recoding the core
loop in assembler _on an old Pentium_, things were completely different
on a PentiumII/PentiumPro, were the C code were actually much faster
than my Pentium-optimized assembler, and the obvious asm optimizations
did not gain anything over the C code.

For processors with multiple execution units and hw scheduling,
sometimes there is more parallelism in the CPU than in your algorithm,
and it is not obvious that optimizing the assembler will run faster
than an apparently worse compiler-generated output.

	cheers
	luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809031917.VAA12329>