[macstl-dev] Just a sidenote
Glen Low
glen.low at pixelglow.com
Wed Jun 8 08:10:06 WST 2005
On 08/06/2005, at 5:10 AM, Ilya Lipovsky wrote:
> Since SSE extensions are included in the project, the name "MacSTL"
> for it makes much more sense now, after the recent announcement by
> Apple. Originally, I thought, "simdSTL" would be more appropriate.
> But now, with Mac OS going Intel, I guess the name was prophetic in
> a way ;). Nevertheless, I still would argue that the name "simdSTL"
> makes more sense, especially since the project is envisioned to be
> OS-independent, ultimately.
And macstl is going to be the prophet that leads the Altivec exodus
into the promised land of OSX x86 :-)
A little bit of macstl trivia/history:
It started in the late 90's or so as a simple port of SGI STL. I
didn't like STLPort's multiple macros to get comptability with 345
different compilers, I just wanted a simple clean port from SGI STL,
before most C++ compilers had STL inbuilt. I got it to work but then
compilers eventually caught up and shipped STL as part of their
standard library e.g. gcc. At the same time I thought of extending
STL to provide support for low-level Mac-specific constructs, which
is how macstl got it's name.
One year (I can't remember which now) I was reading about Altivec and
expression templates separately and suddenly it hit me -- what an
ideal fit, between Altivec and valarray -- absolutely made for each
other!! Surprised no-one thought of this before. Only a core set of
people were using Altivec, which was such cool technology, and it
deserved to have wider use. And valarray's also fell by the wayside
because of STL vector, and it's very simplicity meant vectorizing it
would be relatively straightforward and easy for developers to adopt.
So I sat down and churned out a first attempt at an Altivec-enhanced
valarray. I think it did well in MPW C++ on OS 9 but gcc 2.95/3.1
were simply awful when optimizing structs containing Altivec.
So it lay on the shelf for a couple of months. Or year or so.
Then came gcc 3.3, I think it was OS X 10.1 or 10.2? I tried
compiling my valarrays again and viola! all the extra loads and
stores in the old compilers were optimized away and I was staring at
a clean, minimal, superfast Altivec loop. Now to fill in all the
gaps. I well remember huddling in the old study, which we were
renovating so a wall was missing, in the middle of winter, whacking
out code to fill in all the other valarray objects like gslice and
such. Along the way I had moved a continent, gotten married, had a
kid, moved two houses...
macstl 0.2 is likely the first version to come close to my original
vision for macstl -- it has support for CFArray's which are low-level
array objects. So macstl has somewhat a dual focus nowadays -- the
cross-platform vector portion, and the Mac OS X low level constructs
portion. I'm tempted to split macstl into two -- a vecstl or simdstl
for the cross-platform vector portion, and macstl for the rest. It
might make the licensing fees easier to swallow. But I'm busy enough
as it is supporting three products -- macstl, graphviz and shellac --
and a day job paying the bills.
As for x86, I may be a Mac zealot but I'm not blind. My day job is
working with Windows machines and .NET. So it was just a matter of
getting some solid time to sit down and nut out a platform-
independent vec class, one that worked equivalently on Altivec and
SSE, move macstl 0.1.5 to 0.2, and then valarray will follow being
100% built on the vec foundation. I suppose Someone up there was
smiling on me because I somehow found the time last last year/earlier
this year, got some sponsorship for the complex numbers too, and did
weeks of tweaking Mathematica to get the transcendentals going, all
which helped tremendously with the 0.2 version.
As for the future -- even as Apple prepares to abandon Altivec, I'm
not abandoning Altivec. As long as there are Altivec users and
machines, macstl on Altivec will be there for you. More so since this
is an open source project and simultaneously depends on your
contributions and sponsorship. I know good, elegant tech when I see
it, and there's still YDL, the Cell and Xbox360 to focus our energies
on.
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
aim: pixglen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pixelglow.com/lists/archive/macstl-dev/attachments/20050608/0a6e6c5d/attachment.html
More information about the macstl-dev
mailing list