public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Porting GCC to new target
@ 2003-12-10  8:24 Savithri Venkatachalapathy
  0 siblings, 0 replies; 9+ messages in thread
From: Savithri Venkatachalapathy @ 2003-12-10  8:24 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1213 bytes --]

Hi,

I have a question regarding branch implementation in
the .md file.

I have a cmpsi instructiosn which stores the operands
0 and 1 in static variables branch_op0 and branch_op1.

And in the branch instruction definition operand0 is
the label. I want to concatenate the variable
branch_op0 with the label and output as: b_eq
branch_op0 label

So I am using: 
char buffer[80] =\"\" ;
rtx xoperands[1];
L1: xoperands[0] = operands[0];
...
..
...
  
    strcat(buffer,\"%!b_%b1\");
L2: operands[0] = branch_op[0];
    strcat(buffer,\" %0\");
L3: operands[0] = xoperands[0];
    strcat(buffer,\" %0\");
    output_asm_insn (buffer, operands);

I was expecting the output to be: 
b_eq branch_op label (as per Line1, 2 and 3) instead
the output is: b_eq label label

Could any one tell me how to get this right.

Thanks in advance,
savi

=====
-------------------------------------------------------------------------------
 “Personality is born out of pain. It is the fire shut up in the flint.” --- Yeats
--------------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

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

* Re: Porting GCC to new target
  2003-12-05  5:29 Savithri Venkatachalapathy
@ 2003-12-05 14:04 ` Ian Lance Taylor
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Lance Taylor @ 2003-12-05 14:04 UTC (permalink / raw)
  To: Savithri Venkatachalapathy; +Cc: gcc-help

Savithri Venkatachalapathy <snvpathy@yahoo.com> writes:

> While porting gcc to new target, I am not able to
> figure how to handle branch instructions.
> The .md descriptions of the bne, beq instructions take
> 3 rtx parameters while the expr.c, stmt.c, rtl.h,
> loop.c, unroll.c and optabe.c files have gen-beq(),
> gen-bne() prototypes which take only 1 rtx parameter.
> Hence when I try to 'make' it gives error saying that
> the prototypes of gen-beq() in the files mentioned
> above does not match with the prototype from the .md
> file.
> 
> Could anybody tell me how to overcome this. DO I need
> to download different versions of the 6 files
> mentioned above which have branch prototypes taking 3
> parameters.

From
    http://gcc.gnu.org/onlinedocs/gccint/Jump-Patterns.html#Jump%20Patterns

    Some machines have compare-and-branch instructions and no
    condition code. A similar technique works for them. When it is
    time to "output" a compare instruction, record its operands in two
    static variables. When outputting the branch-on-condition-code
    instruction that follows, actually output a compare-and-branch
    instruction that uses the remembered operands.

See, e.g., the MIPS target "cmpsi" and "beq" patterns.

Ian

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

* Porting GCC to new target
@ 2003-12-05  5:29 Savithri Venkatachalapathy
  2003-12-05 14:04 ` Ian Lance Taylor
  0 siblings, 1 reply; 9+ messages in thread
From: Savithri Venkatachalapathy @ 2003-12-05  5:29 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 1066 bytes --]

Hi,

While porting gcc to new target, I am not able to
figure how to handle branch instructions.
The .md descriptions of the bne, beq instructions take
3 rtx parameters while the expr.c, stmt.c, rtl.h,
loop.c, unroll.c and optabe.c files have gen-beq(),
gen-bne() prototypes which take only 1 rtx parameter.
Hence when I try to 'make' it gives error saying that
the prototypes of gen-beq() in the files mentioned
above does not match with the prototype from the .md
file.

Could anybody tell me how to overcome this. DO I need
to download different versions of the 6 files
mentioned above which have branch prototypes taking 3
parameters.

Any help in this regard would be appreciated.

Thanks,
savi


=====
-------------------------------------------------------------------------------
 “Personality is born out of pain. It is the fire shut up in the flint.” --- Yeats
--------------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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

* Re: Porting GCC to new target
  2003-11-14 16:06 ` Dara Hazeghi
@ 2003-11-21  6:13   ` Savithri Venkatachalapathy
  0 siblings, 0 replies; 9+ messages in thread
From: Savithri Venkatachalapathy @ 2003-11-21  6:13 UTC (permalink / raw)
  To: Dara Hazeghi; +Cc: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 685 bytes --]

Hi,

I am porting gcc to new target. So far it handles user
defined function calls correctly. But it fails when I
try to compile a system call.
Could anybody sugegst me how to support compilation of
system calls. What changes should I make in the .md
and .c files.  

Any suggestions would be appreciated.

Thanks,
savi

=====
-------------------------------------------------------------------------------
 “Personality is born out of pain. It is the fire shut up in the flint.” --- Yeats
--------------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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

* Re: Porting GCC to new target
       [not found] <20031114091925.68490.qmail@web14203.mail.yahoo.com>
@ 2003-11-14 16:06 ` Dara Hazeghi
  2003-11-21  6:13   ` Savithri Venkatachalapathy
  0 siblings, 1 reply; 9+ messages in thread
From: Dara Hazeghi @ 2003-11-14 16:06 UTC (permalink / raw)
  To: Savithri Venkatachalapathy; +Cc: gcc-help


--- Savithri Venkatachalapathy <snvpathy@yahoo.com>
wrote:
> Hi,
> 
> At this moment I want gcc to just compile and
> generate
> assembly code for the new target machine.

Fair enough. In that case, you don't need libgcc. It
won't build unless you have those other tools, so I'd
just force the build to continue after errors, using
make -k, and later make -k install.

That should give you a cross compiler for you target.
You won't be able to generate programs, but you will
be able to compile source to assembly. In particular,
when you invoke your cross gcc, you'll have to add the
-S options, so it doesn't try to assemble (or link)
the code it generates.

Cheers,

Dara

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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

* Re: Porting GCC to new target
  2003-11-12  7:28 ` Savithri Venkatachalapathy
@ 2003-11-14  7:17   ` Dara Hazeghi
  0 siblings, 0 replies; 9+ messages in thread
From: Dara Hazeghi @ 2003-11-14  7:17 UTC (permalink / raw)
  To: Savithri Venkatachalapathy; +Cc: gcc-help

Hello,

the error you're getting is most likely because you're
trying to use the x86 assembler on assembly code for
your new target. This won't work.

You'll need an assembler (and linker) for your new
target, otherwise the a gcc port you make won't be any
real use, since you'll have no methods of turning gcc
assembly into executables for your target.

If you already have such an assembler, and gcc isn't
finding it, the options
--with-as=/path/to/my/assembler and  --with-ld=/...
may be useful (see
<http://gcc.gnu.org/install/configure.html> for more
info. on these options, and many others).

Cheers,

Dara



__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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

* Re: Porting GCC to new target
  2003-11-11  7:37 Dara Hazeghi
@ 2003-11-12  7:28 ` Savithri Venkatachalapathy
  2003-11-14  7:17   ` Dara Hazeghi
  0 siblings, 1 reply; 9+ messages in thread
From: Savithri Venkatachalapathy @ 2003-11-12  7:28 UTC (permalink / raw)
  To: Dara Hazeghi; +Cc: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 3286 bytes --]

Hi,

In the Makefile.in, I compile using:

./xgcc -B./ -O2  -DCROSS_COMPILE -DIN_GCC    -g
-I./include   -g1  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc  -I. -I.
-I./config -c -s  -v -DL${name}

And this gives me an error given below. 

if [ -f libgcc2.ready ] ; then \
	true; \
else \
	touch libgcc2.ready; \
fi
rm -f tmplibgcc1.a libgcc1.S
rm -f tmplibgcc2.a
set -e; \
for name in _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2
_floatdidf _floatdisf _fixunsdfsi _fixunssfsi
_fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi
_fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi
_fixunstfdi _floatditf __gcc_bcmp _varargs __dummy
_eprintf _bb _shtab _clear_cache _trampoline __main
_exit _ctors _pure; \
do \
  echo ${name}; \
  ./xgcc -B./ -O2  -DCROSS_COMPILE -DIN_GCC    -g
-I./include   -g1  -DIN_LIBGCC2
-D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc  -I. -I.
-I./config -c -s  -v -DL${name} \
      ./libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  ` if [ -f
/home/x32v/compiler/egcs-1.1.2/gcc/../binutils/ar ] ;
then echo
/home/x32v/compiler/egcs-1.1.2/gcc/../binutils/ar ;
else if [ "i686-pc-linux-gnu" = "x32v-unknown-none" ]
; then echo ar; else t='s,x,x,'; echo ar | sed -e $t ;
fi; fi` rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_udiv_w_sdiv
Reading specs from ./specs
gcc version egcs-2.91.66 19990314 (egcs-1.1. release)
 ./cpp -lang-c -v -I./include -I . -I. -I./config
-isystem ./include -undef -D__GNUC__=2
-D__GNUC_MINOR__=91 -D__x32v__ -D_X32V__ -D__X32V__
-D_x32v__ -D_X32V__ -D_X32V__ -D__OPTIMIZE__ -g -g1
-DCROSS_COMPILE -DIN_GCC -DIN_LIBGCC2
-D_GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -DL_udiv_w_sdiv
./libgcc2.c /tmp/cc6LOY2T.i
 GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2
release) (X32V)
 #icnlude "..." search starts here:
 #include <...> search starts here:
 include
 .
 config
 include
 End of search list
 ./cc1 /tmp/cc6LOY2T.i -quiet -dumpbase libgcc2.c -g
-g1 -02 -version -o /tmp/ccopYv1G.s
 GNU CPP version egcs-2.91.66 19990314 (egcs-1.1.2
release) (x32v) compiled by GNU C version 2.96
20000731 (Mandrake Linux 8.2 2.96-0.76mdk).
 as -o _udiv_w_sdiv.o /tmp/ccopYv1G.s
 /tmp/ccopYv1G.s: Assembler messages:
 /tmp/ccopYv1G.s:89: Error: invalid character '_' in
mnemonic
 make: *** [libgcc2.a]Error 1

I would really appreciate if you could help me in
getting rid of this error.

Regards,
savi
--- Dara Hazeghi <dhazeghi@yahoo.com> wrote:
> Hello,
> 
> you don't provide enough information in your
> question
> to be able to provide much of an answer. What is the
> exact command line that's giving this error? What
> are
> the actual commands that are being invoked (add -v
> to
> the gcc command line to get a listing of what's
> actually occurring). Thanks,
> 
> Dara
> 
> __________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
> http://antispam.yahoo.com/whatsnewfree


=====
-------------------------------------------------------------------------------
 “Personality is born out of pain. It is the fire shut up in the flint.” --- Yeats
--------------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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

* Re: Porting GCC to new target
@ 2003-11-11  7:37 Dara Hazeghi
  2003-11-12  7:28 ` Savithri Venkatachalapathy
  0 siblings, 1 reply; 9+ messages in thread
From: Dara Hazeghi @ 2003-11-11  7:37 UTC (permalink / raw)
  To: snvpathy; +Cc: gcc-help

Hello,

you don't provide enough information in your question
to be able to provide much of an answer. What is the
exact command line that's giving this error? What are
the actual commands that are being invoked (add -v to
the gcc command line to get a listing of what's
actually occurring). Thanks,

Dara

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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

* Porting GCC to new target
@ 2003-11-11  4:39 Savithri Venkatachalapathy
  0 siblings, 0 replies; 9+ messages in thread
From: Savithri Venkatachalapathy @ 2003-11-11  4:39 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 581 bytes --]

Hi,

While porting gcc to a new target, I am getting these
errors.

"Invalid character '_' in mneumonic"

I would appreciate if anybody could how to get rid of
this error.

Thanks,
savi

=====
-------------------------------------------------------------------------------
 “Personality is born out of pain. It is the fire shut up in the flint.” --- Yeats
--------------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

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

end of thread, other threads:[~2003-12-10  8:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-10  8:24 Porting GCC to new target Savithri Venkatachalapathy
  -- strict thread matches above, loose matches on Subject: below --
2003-12-05  5:29 Savithri Venkatachalapathy
2003-12-05 14:04 ` Ian Lance Taylor
     [not found] <20031114091925.68490.qmail@web14203.mail.yahoo.com>
2003-11-14 16:06 ` Dara Hazeghi
2003-11-21  6:13   ` Savithri Venkatachalapathy
2003-11-11  7:37 Dara Hazeghi
2003-11-12  7:28 ` Savithri Venkatachalapathy
2003-11-14  7:17   ` Dara Hazeghi
2003-11-11  4:39 Savithri Venkatachalapathy

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).