#32 Fixes to Intel bit test

closed
Dave Grove
None
5
2012-09-21
2006-01-21
Ian Rogers
No

The attached patch fixes the problems with the Intel
bit test BURS rule described in bug #1411486. The main
thing it does is implement immediate versions of the
bit test instruction. As the form of this instruction
is shared by btc, btr and bts, the patch also contains
new assembler productions to create these instructions.
The patch also modifies the right shift bit test
instructions as the observed IR no longer contains
moves. The shift right BURS rules were individually
tested to check they created bit test instructions.

    STATEMENT OF ORIGIN FOR A SINGLE CONTRIBUTOR

I, Ian Rogers:

(a) represent that either:

(i) I am the only author and owner of the contributed
software
(described as/entitled fixes to Intel bit test),
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-01-21

    Patch containing fixes to Intel bit test

     
    Attachments
  • Dave Grove
    Dave Grove
    2006-01-22

    Logged In: YES
    user_id=1215435

    Thanks for tracking this down Ian; I should get this
    committed either Monday or Tuesday (in the last steps of
    committing some other changes and I want to clear those first).

     
  • Ian Rogers
    Ian Rogers
    2006-01-23

    Logged In: YES
    user_id=308843

    Thanks Dave. I was toying with the idea of Intel
    instructions that set the carry flag (so bit test and some
    floating point/unsigned compares) have a new BURS
    non-terminal of cf. In situations where the result of the
    bit test or compares is being added to an accumulator (the
    test program I wrote for the bit test instruction) then we
    can generate add with carries or subtract with borrows,
    rather than moving the boolean value into a 32bit register
    (a setb and a movzx) and then adding it. I'm pretty busy at
    the moment (wedding 11/2/06) so I thought I should capture
    this idea somewhere. It could be that it's not worth it :-)

    Ian

     
  • Dave Grove
    Dave Grove
    2006-01-29

    Logged In: YES
    user_id=1215435

    might be worth adding the cf rules. it's the kind of little
    thing that is easy to do in BURS and every once in a while
    it shows up in some hot loop. maybe open a feature for it
    sometime when you have a chance.

    I'll be firing off a regression test for this one as soon as
    the tweak to opt simplifier for % 2 ^ k finishes.