i386.md floating point comparison with general register

John Wehle john@feith.com
Fri Mar 26 19:13:00 GMT 1999


I'm looking at improving the i386 floating point comparision
patterns and am curious about:

  [(set (cc0)
        (match_operator 2 "VOIDmode_compare_op"
                        [(match_operand:XF 0 "register_operand" "f")
                         (float:XF
                          (match_operand:SI 1 "nonimmediate_operand" "rm"))]))

Which appears to be a pattern for the benefit of combine.  What seems odd is
the pattern allows the comparison of a floating point register with a general
register which the i386 doesn't actually support.  It's currently implement
by having output_float_compare load the general register into a floating point
register and then doing the comparison.  Why is it useful to hide this move
from gcc?  Should this pattern perhaps be:

  [(set (cc0)
        (match_operator 2 "VOIDmode_compare_op"
                        [(match_operand:XF 0 "register_operand" "f")
                         (float:XF
                          (match_operand:SI 1 "memory_operand" "m"))]))

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



More information about the Gcc mailing list