This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Useless clobber?


> (define_insn ""
>   [(set (match_operand:SI 0 "register_operand" "=d")
>         (mult:SI
>           (zero_extend:SI
>             (match_operand:HI 1 "register_operand" "d"))
>           (zero_extend:SI
>             (match_operand 2 "register_operand" "d"))))
>    ( clobber (match_operand:SI 3 "register_operand" "d"))]
>   ""
>   "impyuu\\t%1,%2,%0")

>    I cannot comunicate with the guys that wrote the machine description(I
> don't know how to contact them), but placing the clobber in this pattern
> seems stupid to me.

The clobber ensures that there's a spare register available when the
insn executes.  The current i386 backend has a similar clobber in
fix_truncXXdi2 patterns because the FPU is implemented using a stack
and there isn't an instruction which converts from floating point to
DImode without popping the stack.  The i386 backend works around this
by making a copy of the register (which requires a spare register)
before doing the conversion.

I don't know if the clobber is necessary for the pattern you're looking
at, however it may be.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]