public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC ASM(): Urgent!
@ 2000-02-29 18:10 YZ Dai
  2000-03-01  0:59 ` Martin v. Loewis
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: YZ Dai @ 2000-02-29 18:10 UTC (permalink / raw)
  To: help-gcc

Hi,

I'm using GNU CC, ccmips or asmips. I see within the generated .s file
from .c file there are:

jpeg_idct_ifast:
 .frame $fp,368,$31  # vars= 360, regs= 1/0, args= 0, extra= 0
 .mask 0x40000000,-8
 .fmask 0x00000000,0

1. What does .frame,.mask and .fmask means?
2. Which registers are protected? Which registers I can use in my ASM()
routine?
3. How to support Mips R3900 instruction like MULT rd,rs,rt?
4. In GCC book within a macro "\" gives operator value, but the example
gives compile error:
.macro mname rd
    .word   \ rd
.endm

5. How to debug and trace in the asm() instructions in a .C file?

Many thanks!

YZ DAI



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

* Re: GCC ASM(): Urgent!
  2000-02-29 18:10 GCC ASM(): Urgent! YZ Dai
@ 2000-03-01  0:59 ` Martin v. Loewis
  2000-04-01  0:00   ` Martin v. Loewis
  2000-03-01 11:34 ` Alexandre Oliva
  2000-04-01  0:00 ` YZ Dai
  2 siblings, 1 reply; 6+ messages in thread
From: Martin v. Loewis @ 2000-03-01  0:59 UTC (permalink / raw)
  To: yz; +Cc: help-gcc

> 1. What does .frame,.mask and .fmask means?

I don't know anything about MIPS assembly, but looking at
config/mips/mips.c, it appears that 

.frame defines how the stack frame is organized, with the parameters
<register holding the frame pointer>, <size of the frame pointer>
<register holding the return value>

.mask and .fmask describe what registers are saved:
.mask <mask of gp registers saved>,<offset from vfp to store gp registers>
.fmask <mask of saved fp registers>,<offset from vfp to store fp registers>

> 2. Which registers are protected? Which registers I can use in my ASM()
> routine?

I can't answer this question.

> 3. How to support Mips R3900 instruction like MULT rd,rs,rt?

According to mips.h and mips.md, this is generated when

/* Generate three-operand multiply instructions for both SImode and DImode.  */
#define GENERATE_MULT3         (TARGET_MIPS3900				\
				&& !TARGET_MIPS16)

So it should be should be used if not on a 16bit target.

> 4. In GCC book within a macro "\" gives operator value, but the example
> gives compile error:
> .macro mname rd
>     .word   \ rd
> .endm

Again, I don't know.

> 5. How to debug and trace in the asm() instructions in a .C file?

What exactly do you mean by trace? Please use the option --save-temps;
this will produce a .s file, which contains the generated assembler
code for inspection.

Hope this helps,
Martin

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

* Re: GCC ASM(): Urgent!
  2000-02-29 18:10 GCC ASM(): Urgent! YZ Dai
  2000-03-01  0:59 ` Martin v. Loewis
@ 2000-03-01 11:34 ` Alexandre Oliva
  2000-04-01  0:00   ` Alexandre Oliva
  2000-04-01  0:00 ` YZ Dai
  2 siblings, 1 reply; 6+ messages in thread
From: Alexandre Oliva @ 2000-03-01 11:34 UTC (permalink / raw)
  To: YZ Dai; +Cc: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

On Feb 29, 2000, YZ Dai <yz@mailhost.telecruz.com> wrote:

> 2. Which registers are protected? Which registers I can use in my ASM()
> routine?

You may want to take a look at the `Extended Asm' node of the GCC
manual.  It explains how to pass data into and out of GCC asm
statements.

-- 
Alexandre Oliva     http://www.ic.unicamp.br/~oliva/     Enjoy Guaraná
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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

* Re: GCC ASM(): Urgent!
  2000-03-01 11:34 ` Alexandre Oliva
@ 2000-04-01  0:00   ` Alexandre Oliva
  0 siblings, 0 replies; 6+ messages in thread
From: Alexandre Oliva @ 2000-04-01  0:00 UTC (permalink / raw)
  To: YZ Dai; +Cc: help-gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

On Feb 29, 2000, YZ Dai <yz@mailhost.telecruz.com> wrote:

> 2. Which registers are protected? Which registers I can use in my ASM()
> routine?

You may want to take a look at the `Extended Asm' node of the GCC
manual.  It explains how to pass data into and out of GCC asm
statements.

-- 
Alexandre Oliva     http://www.ic.unicamp.br/~oliva/     Enjoy Guaraná
Cygnus Solutions, a Red Hat company        aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist    CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org}   Write to mailing lists, not to me

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

* Re: GCC ASM(): Urgent!
  2000-03-01  0:59 ` Martin v. Loewis
@ 2000-04-01  0:00   ` Martin v. Loewis
  0 siblings, 0 replies; 6+ messages in thread
From: Martin v. Loewis @ 2000-04-01  0:00 UTC (permalink / raw)
  To: yz; +Cc: help-gcc

> 1. What does .frame,.mask and .fmask means?

I don't know anything about MIPS assembly, but looking at
config/mips/mips.c, it appears that 

.frame defines how the stack frame is organized, with the parameters
<register holding the frame pointer>, <size of the frame pointer>
<register holding the return value>

.mask and .fmask describe what registers are saved:
.mask <mask of gp registers saved>,<offset from vfp to store gp registers>
.fmask <mask of saved fp registers>,<offset from vfp to store fp registers>

> 2. Which registers are protected? Which registers I can use in my ASM()
> routine?

I can't answer this question.

> 3. How to support Mips R3900 instruction like MULT rd,rs,rt?

According to mips.h and mips.md, this is generated when

/* Generate three-operand multiply instructions for both SImode and DImode.  */
#define GENERATE_MULT3         (TARGET_MIPS3900				\
				&& !TARGET_MIPS16)

So it should be should be used if not on a 16bit target.

> 4. In GCC book within a macro "\" gives operator value, but the example
> gives compile error:
> .macro mname rd
>     .word   \ rd
> .endm

Again, I don't know.

> 5. How to debug and trace in the asm() instructions in a .C file?

What exactly do you mean by trace? Please use the option --save-temps;
this will produce a .s file, which contains the generated assembler
code for inspection.

Hope this helps,
Martin

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

* GCC ASM(): Urgent!
  2000-02-29 18:10 GCC ASM(): Urgent! YZ Dai
  2000-03-01  0:59 ` Martin v. Loewis
  2000-03-01 11:34 ` Alexandre Oliva
@ 2000-04-01  0:00 ` YZ Dai
  2 siblings, 0 replies; 6+ messages in thread
From: YZ Dai @ 2000-04-01  0:00 UTC (permalink / raw)
  To: help-gcc

Hi,

I'm using GNU CC, ccmips or asmips. I see within the generated .s file
from .c file there are:

jpeg_idct_ifast:
 .frame $fp,368,$31  # vars= 360, regs= 1/0, args= 0, extra= 0
 .mask 0x40000000,-8
 .fmask 0x00000000,0

1. What does .frame,.mask and .fmask means?
2. Which registers are protected? Which registers I can use in my ASM()
routine?
3. How to support Mips R3900 instruction like MULT rd,rs,rt?
4. In GCC book within a macro "\" gives operator value, but the example
gives compile error:
.macro mname rd
    .word   \ rd
.endm

5. How to debug and trace in the asm() instructions in a .C file?

Many thanks!

YZ DAI



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

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-29 18:10 GCC ASM(): Urgent! YZ Dai
2000-03-01  0:59 ` Martin v. Loewis
2000-04-01  0:00   ` Martin v. Loewis
2000-03-01 11:34 ` Alexandre Oliva
2000-04-01  0:00   ` Alexandre Oliva
2000-04-01  0:00 ` YZ Dai

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