#40 Modified BURS to better handle a special case of COND_MOV

closed
None
5
2012-09-21
2006-03-23
G. Kolpin
No

Modified BURS to better handle the special case of a
conditional move instruction where the true and false
values are integers and differ by one. Previously, the
code generated used the following to place either
value into result: result = ((cond ? 0 : -1) &
(false_const - true_const)) + true_const .

In the special case where true_const - false_const ==
1, we can optimize slightly so that result = (cond ? 1
: 0) + false_const .

When false_const - true_const == 1, we first must
negate the conditional result: result = (cond ? -1 : 0)
+ false_const .

STATEMENT OF ORIGIN FOR A SINGLE CONTRIBUTOR

I, Garrett Kolpin:

(a) represent that either:

(i) I am the only author and owner of the contributed
software
(described as/entitled Modified BURS to handle
special case for a conditional move instruction
),
which was neither derived nor copied from any
other software,
or

(ii) that any exception to (i) is software which was
obtained under the
CPL (Common Public License),

and

(b) hereby agree to license this contributed software
under the CPL.

Discussion

  • Ian Rogers

    Ian Rogers - 2006-03-23

    Logged In: YES
    user_id=308843

    The patch looks good to me (although I'm not sure if its
    against the current CVS head). The patch saves one AND in
    the case where the conditional move arguments are both
    integer and differ by 1. This special case wasn't documented
    in the Intel or AMD optimzination manual where I lifted this
    optimization of conditional move from. Well done Garrett for
    spotting this!

    Regards, Ian Rogers

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks