So I got the eval version of icl to try what kind of optimisation speedup it gives to my chess program.
It seemed pretty fancy , with lot of 'extra' options to tweak the compilation , profile guided optimisation ,etc.
But the 'feature' which caught my fancy was code generation for a platform which might actually work : so essentially I wanted to see what sort of speedup I will get if I target for P4 ...
Note , chess programs have branches - lots and lots of them , and are essentially integer math : so cmov and family would give nice speedup. Also , vectorization of loops should be nice too.
I run for the P4 target (I ran for SSE2 actually) and voila - refused to execute on my comp !
"Fatal Error : This program was not built to run on the processor in your system."
Hmm , this is interesting - athlon 4200 supports SSE2 ... google'd and voila , I learn about the
law suit between amd and intel , etc , etc. (Yep , old news - but then I never bothered with it until now :-D )
Now , how to make this work ?
I found
this , give it a shot - no luck.
So , rolled up my sleeves , tried fixing that program - gave up : it is essentially brute force search for a pattern which has been changed in icc8.0 I guess.
Since I am not used to the PE format , wrote something which interprets the exe and was proceeding to find ways of 'nop'ing all those references to the intel 'checker routine' (__intel_new_proc_init_P btw).
Since I have lost touch with assembly for a while ,
googled to find out opcode forms for a proc call.
That is when I came across
this.
He already has perl scripts to patch the exe !
Got them , tried them - and voila ! It works !!
Moral of the story - search for reuse before reinventing :-)
This is one lesson I keep relearning ;-)
* Update * The perl script breaks executable if I use PGO .... not sure why since the difference are the same. Mailed author and looking at the objdump myself too (I am way too rusty :-( )
6 Comments:
Have fun!
have a nice time
I see you kept your promise to be back on Sunday with your 'to post or not to post' but I don't see it in your blog yet ...
Seems that bloglines work in, as they call in IM world, psyche mode ...
Actually I posted that ... and removed it :-)
It was my ramble on what/how I post - and I was on two minds whether to post it in the first place.
That post was describing the typical 'code-path' involved in me posting something here :-D ... and I fell for two of the points described there and removed the post ;-)
Thats My Boy!
What are you refering to vipin ?
I thought I told you that before leaving ...
Post a Comment
<< Home