Changes and a problematic problem.

2007-06-07

Changes and a problematic problem.

Permalink 12:11:49, Categories: Optimisation Framework  

It's been a while since my last entry, so I'll quickly update on what I've done.

Right now, basic runtime detection for Windows, x86 linux and PPC are done. I've changed quite significantly the original plan for that, now I have a base class with the inline bool HasMMX() type functions and the bool hasMMX; type vars. I've used a template on that, so I can pass the correct platform specific class to it when creating an object instance of it, then I use another class as an access point for the outside world which has it's own Has*() functions (which call the specific equivalent in the base class).

When a check for one instruction set is done, checks for all of them are done and a bitmask is returned. Then the correct instruction is fetched from this result.

So a check for MMX on windows would do something like this:

http://www.xordan.com/code

I think this is quite a nice solution. It allows us to easily add new checks in the future.

While writing some configure checks for xmmintrin.h and __m128 I ran into a problematic problem. GCC requires -msse to be enabled for me to access builtin intrinsic functions. However, -msse also tells the compiler to optimize non-floating point code with sse instructions :) To quote from the GCC manual:

"These options will enable GCC to use these extended instructions in generated code, even without -mfpmath=sse. Applications which perform runtime CPU detection must compile separate files for each supported architecture, using the appropriate flags. In particular, the file containing the CPU detection code should be compiled without these options."

To me, this is not a great option. I'm not sure why the GCC devs decided to force compiler optimizations upon us if we want to use intrinsics at all, but that's the way it is... maybe. I'm going to experiment on defining what the xmmintrin.h header requires to be defined.. maybe that will work. If not then we'll have to try what the manual suggests, making each file which uses intrinsics compile with the required flags. The third option is to say "screw this" and write my own versions of the intrinsics using asm. I'll still need to use the builtin stuff for x86_64, but that's okay because -msse and crew are defined by default on that platform. My hope is that I can trick the headers that all is good without giving the compiler an 'okay' to optimize.

Once a solution for this is done, I need to work out a code path for using these optimizations. Right now I'm favouring either using templates along with my own functions, or having a function like blah(SIMDcode, C++Code, arg1, arg2, argn); I haven't decided. Obviously I need to keep the overhead and code duplication down to a minimum. More on this later.

Trackback address for this post:

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Comments, Trackbacks, Pingbacks:

I love your blog.. very nice colors & theme. Did you design this website yourself or did
you hire someone to do it for you? Plz respond as I'm looking to design my own blog and would like to find out where u got this from. thank you
PermalinkPermalink 2012-11-08 @ 18:57
An outstanding share! I have just forwarded this onto a colleague
who has been doing a little homework on this. And he
actually bought me dinner simply because I stumbled upon
it for him... lol. So let me reword this.... Thanks for the
meal!! But yeah, thanks for spending time to talk about this topic here on your web site.
PermalinkPermalink 2012-11-14 @ 01:47
Comment from: green smoke coupon code [Visitor] · http://vtipy.vsetko.com/forum/profile.php?id=58261
In the event it becomes hard to puff, which is a sign how the
battery must be recharged. In the event that doesn't repair get in touch with our own customer service team.
PermalinkPermalink 2013-03-22 @ 05:34
Comment from: www.updated.asia [Visitor] · http://www.updated.asia/article.php?id=2943
Hi there! I just wanted to ask if you ever have any trouble with hackers?
My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no backup.
Do you have any methods to prevent hackers?
PermalinkPermalink 2013-03-28 @ 06:08
Comment from: wiki.forumphp.web.id [Visitor] · http://wiki.forumphp.web.id/index.php?title=Pengguna:AshelyDri
A lot of areas have banned the act of smoking in public and in
eating joints, to support those who don't smoke sit in an environment where they aren't at
a risk from inhaling the toxins released.
PermalinkPermalink 2013-03-31 @ 23:15
Comment from: Gilda [Visitor] · http://support.jodohost.com/members/niukeira.50487/
I have been smoking regarding 25 years a 20 a day gentleman (sometimes much more
when I am working from home). I have tried more-or-less every
thing to stop at once or another and constantly failed I
just like the smoking encounter and areas don't change that.
PermalinkPermalink 2013-04-02 @ 15:59
you're truly a just right webmaster. The site loading speed is incredible. It kind of feels that you're doing any unique trick.
In addition, The contents are masterpiece.
you've performed a magnificent job in this matter!
PermalinkPermalink 2013-04-07 @ 14:28
Comment from: Joy [Visitor] · http://dev.promo121.com/profile/jolenesche
Right here is the perfect website for everyone who wants
to find out about this topic. You understand so much its almost hard to argue with
you (not that I actually will need to_HaHa).
You certainly put a new spin on a topic which has been discussed for ages.
Great stuff, just wonderful!
PermalinkPermalink 2013-04-08 @ 16:19
Comment from: Svcmc.Jbcourse.Com [Visitor] · http://svcmc.jbcourse.com/user/view.php?id=33752&course=1
I was a bit more than reluctant to try smoking.
I had to give up with the horrible smell of the traditional
cigarettes to keep around my buddies who are chain smokers largely.
Now, I don't compromise, while i have my very own set of custom-made and noble E-cigs by Eco-friendly Smoke. We look the smartest with these specifically designed smoking. I use the actual zero cigarette smoking highly tasting menthol ice Eco-friendly Smoke e-cig.
PermalinkPermalink 2013-04-10 @ 03:14
Nice post. I learn something totally new and challenging on sites I stumbleupon
on a daily basis. It's always useful to read content from other writers and practice a little something from their websites.
PermalinkPermalink 2013-04-11 @ 21:49
Comment from: Http://www.iconcompanions.com [Visitor] · http://eco.guyana.virtualhealthlibrary.org/tiki-index.php?page=UserPagebellyyia
Just desire to say your article is as astounding.
The clarity in your post is just cool and i can assume you
are an expert on this subject. Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post.
Thanks a million and please carry on the rewarding work.
PermalinkPermalink 2013-04-15 @ 01:03
Comment from: http://ebx.ch/mediawiki1/index.php?title=Bright_Green_Smoke_Coupons_The_Same_Articles [Visitor] · http://ebx.ch/mediawiki1/index.php?title=Bright_Green_Smoke_Coupons_The_Same_Articles
Hello There. I found your weblog the use of msn.
This is an extremely neatly written article.
I'll make sure to bookmark it and come back to read more of your useful information. Thank you for the post. I'll certainly comeback.
PermalinkPermalink 2013-04-17 @ 01:19
Comment from: v2 cigs Review [Visitor] · http://www.internet-friedhof.de/userinfo.php?uid=12876
you are in point of fact a excellent webmaster. The site loading velocity is amazing.
It sort of feels that you're doing any distinctive trick. In addition, The contents are masterpiece. you have done a great activity in this subject!
PermalinkPermalink 2013-04-18 @ 14:27
Useful info. Fortunate me I discovered your website by accident, and I'm stunned why this accident didn't came about earlier!
I bookmarked it.
PermalinkPermalink 2013-04-19 @ 17:09
Comment from: Www.libanonchat.org [Visitor] · http://Www.libanonchat.org/index.php?do=/profile-100591/info/
Awesome post.
PermalinkPermalink 2013-04-20 @ 20:44
Comment from: Power Ecig Reviews [Visitor] · http://klaniny.pl/tiki/tiki-index.php?page=UserPagemichelsey
This is really interesting, You are a very skilled blogger.
I have joined your feed and look forward to seeking
more of your great post. Also, I have shared your website in my social networks!
PermalinkPermalink 2013-04-25 @ 11:48
Comment from: http://www.prnewswire.com/news-releases/v2-cigs-coupon-codes-released-at-theecigexpertscom-183592391 [Visitor] · http://wiki.fastzep.scholtz.sk/FastZep?title=Redaktor:KendrickU
Correct following it was introduced in the global market place, cigarette users about the world
discovered one thing new to rave about.
PermalinkPermalink 2013-04-28 @ 13:40
Have you ever thought about writing an e-book or guest authoring on
other sites? I have a blog centered on the same subjects you discuss and would love to have you share some stories/information.
I know my readers would appreciate your work. If you are even
remotely interested, feel free to send me an email.
PermalinkPermalink 2013-05-01 @ 16:18
Comment from: Author's external home page... [Visitor] · http://www.turktour.no/author/PorterCon
Hello, I enjoy reading all of your article post.

I wanted to write a little comment to support you.
PermalinkPermalink 2013-05-04 @ 22:49
Comment from: click the Following document [Visitor] · http://successring.com/profile/OlliePres
Saved as a favorite, I like your site!
PermalinkPermalink 2013-05-08 @ 19:58
Hello! I've been following your website for some time now and finally got the bravery to go ahead and give you a shout out from Lubbock Tx! Just wanted to say keep up the excellent work!
PermalinkPermalink 2013-05-09 @ 03:22

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

May 2013
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Search

Archives

Misc

XML Feeds

What is this?

powered by
b2evolution