This is the mail archive of the gcc-patches@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: Incorrect code using gcc 2.8.x for Motorola 5200 Coldfire


Jeffrey A Law wrote:
> 
>   In message <35E577BF.D73E3356@intellistor.com>you write:
[...]
> 
>   > --- m68k.h.orig Tue Aug 11 20:01:02 1998
>   > +++ m68k.h      Tue Aug 18 06:59:10 1998
>   > @@ -468,7 +468,7 @@
>   >     if 68881 use is disabled.  */
>   >
>   >  #define HARD_REGNO_MODE_OK(REGNO, MODE) \
>   > -  (((REGNO) < 16                                       \
>   > +  ((TARGET_5200 && ((REGNO) < 24 && (REGNO) > 7) && (MODE == QImode)) ? 0
>   > :
>   > ((REGNO) < 16                                 \
>   >     && !((REGNO) < 8 && (REGNO) + GET_MODE_SIZE ((MODE)) / 4 > 8))      \
>   >     || ((REGNO) < 24                                    \
>   >         && TARGET_68881                                  \
>   > --- m68k.md.orig        Wed Aug 12 02:12:45 1998
>   > +++ m68k.md     Tue Aug 18 06:58:38 1998
>   > @@ -1027,8 +1027,8 @@
>    "* return output_move_qimode (operands);")
>   >
>   >  (define_insn ""
>   > -  [(set (match_operand:QI 0 "general_operand" "=d*a<Q>,d*am")
>   > -       (match_operand:QI 1 "general_operand" "d*ami,d*a<Q>"))]
>   > +  [(set (match_operand:QI 0 "general_operand" "=d*<Q>,d*m")
>   > +       (match_operand:QI 1 "general_operand" "d*mi,d*<Q>"))]
>   >    "TARGET_5200"
>   >    "* return output_move_qimode (operands);")
> These seem reasonable if we make them dependent on your target.
> 
> A very quick scan of m68k.md didn't show any other obvious cases where
> we would do a QImode access to an address register.
> 
> jeff

I missed this last week.

My understanding - which might be quite erroneous - was that QImode
operations were allowed to trash the non-QI
part of the register, so move.l ad,ad  and  lea i,a could be used
for qimode moves to/from an address reg.
We can't have movstrictqi though.

Preventing QImode values from being in address regs seems a bit severe.

Seems we can allow ri -> a and ri -> d.  Movl a0,d0 isn't going to set
the cc
right though.

On the same basis, perhaps add/subqi3 should be allowed to use address
regs.

John.


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