Re: improve strlen
- From: "hutch--" <spamtrap@xxxxxxxxxx>
- Date: Thu, 27 Oct 2005 17:55:31 +0000 (UTC)
jukka,
While I am certainly impressed with the capacity to write portable code
that comes near the performance of hand written assembler, on the major
Windows platform, portable code is of little value when so much code is
specific to the actual OS.
I have seen people write portable ansi C style code while running
directX or Windows specific mutimedia functionality which is simply a
waste of time. I lost my taste for portablity when Microsoft dropped
OS2 support and the time I wasted learning some of this stuff was never
recovered.
If I was writing code for the never-ending flavours of Linux or
something solid like FreeBSD, it would be in portable ANSI C (not++)
but as I write primarily for current 32 bit Windows, such portability
is a waste of time.
Something that makes me laugh is the assumption that assembler is
written only for immediate code problems where historicaly it has
regularly been used for reusable libraries which generally justifies
the extra time spent writing it. Instead of cobbling together someting
on the spur of the moment, a reusable library of commonly used
procedures works fine and assembler is an excellent tool in this area.
Something that also makes me chuckle is the assumption that if you wait
long enough, someone one day will create a C compiler that can output
code in the same class as hand written assembler but after years of
hearing this nonsense, people who make the effort still outclass a
compiler because there is more to code design that robot software
output.
With Windows still controlling somthing like 90% of the desktop market,
considerations of what runs on a PPC or MIPS or SPARC or SOLARIS fits
into the category of "who cares" in most instances.
> pxor mm0,mm0
> xloop:
> pcmpeqb mm0,[esi]
> pmovmskb eax,mm0
> pxor mm0,mm0
> add esi,8
> // ...
The basic idea is a good one but as about 5% of computers around the
world could run it, its a mute point where the two algos I have posted
will run on a 486 running OEM win95. I would certainly like the luxury
of being able to write PIV code with SSE3 but with the sheer volume of
older computers still running, it will not be any time soon that this
will happen.
One of the good things when 64 bit x86 gets going in the next few years
is that there will be a far more modern instruction set where 10 year
old compatibility is not an anchor around your neck.
Regards,
hutch at movsd dot com
.
- Follow-Ups:
- Re: improve strlen
- From: jukka@xxxxxxxxxxxx
- Re: improve strlen
- References:
- improve strlen
- From: Claudio Daffra
- Re: improve strlen
- From: spamtrap
- Re: improve strlen
- From: hutch--
- Re: improve strlen
- From: spamtrap
- Re: improve strlen
- From: jukka@xxxxxxxxxxxx
- Re: improve strlen
- From: jukka@xxxxxxxxxxxx
- Re: improve strlen
- From: jukka@xxxxxxxxxxxx
- Re: improve strlen
- From: hutch--
- Re: improve strlen
- From: jukka@xxxxxxxxxxxx
- Re: improve strlen
- From: randyhyde@xxxxxxxxxxxxx
- Re: improve strlen
- From: hutch--
- Re: improve strlen
- From: jukka@xxxxxxxxxxxx
- improve strlen
- Prev by Date: Re: Combining two MMX registers into one SSE register?
- Next by Date: Re: improve strlen
- Previous by thread: Re: improve strlen
- Next by thread: Re: improve strlen
- Index(es):