public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: GCC 3.0.3 Prelease problem on --target=m68k-elf
@ 2001-12-13 17:12 Peter Barada
  2001-12-13 17:39 ` Joe Buck
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Barada @ 2001-12-13 17:12 UTC (permalink / raw)
  To: gcc


gcc-3.0.3-20011213 builds with the following config.status:
#!/bin/sh
# This file was generated automatically by configure.  Do not edit.
# This directory was configured as follows:
/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.0.3-20011213/configure --with-gcc-version-trigger=/home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.0.3-20011213/gcc/version.c --host=i686-pc-linux-gnu --target=m68k-elf --prefix=/tmp/crap5 --enable-languages=c --with-local-prefix=/tmp/crap5/m68k-elf --without-headers --with-newlib --disable-shared --norecursion 
# 

Unfortunately it doesn't produce correct code for -m5200 due to the
"r" constraint in the following pattern in gcc/config/m68k/m68k.md:

;; Jump to variable address from dispatch table of relative addresses.
(define_insn ""
  [(set (pc)
	(plus:SI (pc)
		 (sign_extend:SI (match_operand:HI 0 "register_operand" "r"))))
   (use (label_ref (match_operand 1 "" "")))]
  ""

On Coldfire the ext.l instruction can only extend data registers, not
address registers, so either the constraint needs to be changed to
"d", or another pettern needs to be created for TARGET_5200 with a "d"
constraint, and this needs a condition of !TARGET_5200.

-- 
Peter Barada                                   Peter.Barada@motorola.com
Wizard                                         781-852-2768 (direct)
WaveMark Solutions(wholly owned by Motorola)   781-270-0193 (fax)

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: GCC 3.0.3 Prelease problem on --target=m68k-elf
@ 2001-12-14  9:00 Bernard Dautrevaux
  0 siblings, 0 replies; 8+ messages in thread
From: Bernard Dautrevaux @ 2001-12-14  9:00 UTC (permalink / raw)
  To: 'Peter Barada', gcc

> -----Original Message-----
> From: Peter Barada [mailto:pbarada@mail.wm.sps.mot.com]
> Sent: Friday, December 14, 2001 2:10 AM
> To: gcc@gcc.gnu.org
> Subject: Re: GCC 3.0.3 Prelease problem on --target=m68k-elf
> 
> 
> 
> gcc-3.0.3-20011213 builds with the following config.status:
> #!/bin/sh
> # This file was generated automatically by configure.  Do not edit.
> # This directory was configured as follows:
> /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-3.0.3-20
> 011213/configure 
> --with-gcc-version-trigger=/home/pbarada/work/cvs-wavemark/cro
> ss-linux-tools/gcc-3.0.3-20011213/gcc/version.c 
> --host=i686-pc-linux-gnu --target=m68k-elf 
> --prefix=/tmp/crap5 --enable-languages=c 
> --with-local-prefix=/tmp/crap5/m68k-elf --without-headers 
> --with-newlib --disable-shared --norecursion 
> # 
> 
> Unfortunately it doesn't produce correct code for -m5200 due to the
> "r" constraint in the following pattern in gcc/config/m68k/m68k.md:
> 
> ;; Jump to variable address from dispatch table of relative addresses.
> (define_insn ""
>   [(set (pc)
> 	(plus:SI (pc)
> 		 (sign_extend:SI (match_operand:HI 0 
> "register_operand" "r"))))
>    (use (label_ref (match_operand 1 "" "")))]
>   ""
> 
> On Coldfire the ext.l instruction can only extend data registers, not
> address registers, so either the constraint needs to be changed to
> "d", or another pettern needs to be created for TARGET_5200 with a "d"
> constraint, and this needs a condition of !TARGET_5200.
> 

I'm not sure this has anything to do with the 5200. On ALL 68k processors
"ext" instructions are only usable on data registers and that's
understandable: loading a word (16bits) in an address register caus
*automatic* sign extension to 32 bits. There is no way to load a 16bits
unsigned constant in an address register.

The assembler generation part of the pattern you list here was, at least on
2.93.3:  

  if (TARGET_5200) 
    return \"ext%.l %0\;jmp 6(%%pc,%0.l)\";
  else
    return \"jmp 6(%%pc,%0.w)\";

It should in fact be changed to:

  if (TARGET_5200 && !ADDRESS_REG_P (operands[0]))
    return \"ext%.l %0\;jmp 6(%%pc,%0.l)\";
  else
    return \"jmp 6(%%pc,%0.w)\";

or even

  if (ADDRESS_REG_P (operands[0]))
    return \"jmp 6(%%pc,%0.l)\";    
  else if (TARGET_5200) 
    return \"ext%.l %0\;jmp 6(%%pc,%0.l)\";
  else
    return \"jmp 6(%%pc,%0.w)\";

I think this was always present in m68k.md, but was masked by the fact that
this is used only in a very limited context where pre 3.0 gcc version always
loaded the table offset in a data register...

HTH

	Bernard

--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel:	+33 (0) 1 47 68 80 80
Fax:	+33 (0) 1 47 88 97 85
e-mail:	dautrevaux@microprocess.com
		b.dautrevaux@usa.net
-------------------------------------------- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-12-14 23:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-13 17:12 GCC 3.0.3 Prelease problem on --target=m68k-elf Peter Barada
2001-12-13 17:39 ` Joe Buck
2001-12-14  7:51   ` Peter Barada
2001-12-14  7:54     ` Craig Rodrigues
2001-12-14 10:18       ` Peter Barada
2001-12-14  9:05     ` Joe Buck
2001-12-14 16:54       ` Mark Mitchell
2001-12-14  9:00 Bernard Dautrevaux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).