iAPX86 code for ABS (using Microsoft C?)

cliff click cliff at ficc.uu.net
Tue Jun 20 04:24:37 AEST 1989


In article <1202 at draken.nada.kth.se>, d88-eli at nada.kth.se (Erik Liljencrantz) writes:
> I remember a review of Microsoft's C compiler for MS-DOS that stated it
> produced no-conditional-jump-abs-code. The function to convert an integer
> to a positive integer was performed without a conditional jump (i.e. JS or
> something). 

I read an article somewhere (my apologizes to the author) of a fellow that
built a "super-optimizer".  It would try every combination of 68000 
instructions possible, looking for the shortest sequence to do some specific
function.  Needless to say it was very slow.  However, the fellow did
find a sequence to perform an absolute value without any jumps, and several
other interesting sequences.  His code would find the shortest number of
instructions to shift and add in order to multiple by a constant.  I
think he had a very short square root function out of this too.  I'm
pretty sure he got a "printf" function minus floating point handling in
500 bytes (he used library calls for "fputc", but he parsed, "atoi"'d
and copied it all in under 500 bytes).

I would be interested to here if anybody else out there has experimented
with this concept of "super-optimization".

Thanks

-- 
Cliff Click, Software Contractor at Large
Business: uunet.uu.net!ficc!cliff, cliff at ficc.uu.net, +1 713 274 5368 (w).
Disclaimer: lost in the vortices of nilspace...       +1 713 568 3460 (h).



More information about the Comp.lang.c mailing list