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]
Other format: [Raw text]

Re: A happy problem caused by loongson2f's div.g instruction


Zhang Le <r0bertz@gentoo.org> writes:
> On 19:18 Mon 10 Nov     , Zhang Le wrote:
>> However, now I think adding a earlyclobber constraint may be the way to go.
>> Since it is a less intrusive and more elegant (comparing with my patch above) change.
>
> This solution is as easy as adding two bytes (two &s's) to the original patch:
> @@ -11,7 +11,7 @@ Index: trunk/gcc/config/mips/loongson.md
>  +;;new integer instructions
>  +
>  +(define_insn "<u>div<mode>3"
> -+  [(set (match_operand:GPR 0 "register_operand" "=d")
> ++  [(set (match_operand:GPR 0 "register_operand" "=&d")
>  +      (any_div:GPR
>  +              (match_operand:GPR 1 "register_operand" "d")
>  +              (match_operand:GPR 2 "register_operand" "d")))]
> @@ -22,7 +22,7 @@ Index: trunk/gcc/config/mips/loongson.md
>  +)
>  +
>  +(define_insn "<u>mod<mode>3"
> -+  [(set (match_operand:GPR 0 "register_operand" "=d")
> ++  [(set (match_operand:GPR 0 "register_operand" "=&d")
>  +      (any_mod:GPR
>  +              (match_operand:GPR 1 "register_operand" "d")
>  +              (match_operand:GPR 2 "register_operand" "d")))]

FWIW, I agree this is probably the best fix.

Richard


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