* mips5kc - cpu registers
@ 2003-03-31 16:45 Amit.Lubovsky
2003-03-31 16:05 ` Juan Quintela
2003-03-31 17:21 ` Kevin D. Kissell
0 siblings, 2 replies; 6+ messages in thread
From: Amit.Lubovsky @ 2003-03-31 16:45 UTC (permalink / raw)
To: linux-mips
Hi,
is there a possibility to use cpu registers in the code (temporarily)
instead of allocating
automatic variables something like:
func a()
{
FAST int, i, tmp;
tmp = ...
...
}
as in vxWorks ?
Thanks,
Amit.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: mips5kc - cpu registers
2003-03-31 16:45 mips5kc - cpu registers Amit.Lubovsky
@ 2003-03-31 16:05 ` Juan Quintela
2003-03-31 17:21 ` Kevin D. Kissell
1 sibling, 0 replies; 6+ messages in thread
From: Juan Quintela @ 2003-03-31 16:05 UTC (permalink / raw)
To: Amit.Lubovsky; +Cc: linux-mips
>>>>> "amit" == Amit Lubovsky <Amit.Lubovsky@infineon.com> writes:
amit> Hi,
amit> is there a possibility to use cpu registers in the code (temporarily)
amit> instead of allocating
amit> automatic variables something like:
amit> func a()
amit> {
amit> FAST int, i, tmp;
amit> tmp = ...
amit> ...
amit> }
theorically,
register int i, tmp;
should de that, but I think that no modern compiler will honour the
register keyword. Anyways, you should be doing something really
strange for the compiler not to choose a register for a local
variable when it should automagically.
Later, Juan.
--
In theory, practice and theory are the same, but in practice they
are different -- Larry McVoy
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: mips5kc - cpu registers
2003-03-31 16:45 mips5kc - cpu registers Amit.Lubovsky
2003-03-31 16:05 ` Juan Quintela
@ 2003-03-31 17:21 ` Kevin D. Kissell
2003-03-31 17:21 ` Kevin D. Kissell
2003-04-01 0:37 ` Muthukumar Ratty
1 sibling, 2 replies; 6+ messages in thread
From: Kevin D. Kissell @ 2003-03-31 17:21 UTC (permalink / raw)
To: Amit.Lubovsky, linux-mips
In general, gcc (and most other compilers)
will do this for you automatically if you enable
any reasonable level of optimization. There
is no need to designate the variable as "FAST",
one simply needs to avoid having it be global,
static, or volatile.
----- Original Message -----
From: <Amit.Lubovsky@infineon.com>
To: <linux-mips@linux-mips.org>
Sent: Monday, March 31, 2003 6:45 PM
Subject: mips5kc - cpu registers
> Hi,
> is there a possibility to use cpu registers in the code (temporarily)
> instead of allocating
> automatic variables something like:
> func a()
> {
> FAST int, i, tmp;
> tmp = ...
> ...
> }
>
> as in vxWorks ?
>
> Thanks,
> Amit.
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: mips5kc - cpu registers
2003-03-31 17:21 ` Kevin D. Kissell
@ 2003-03-31 17:21 ` Kevin D. Kissell
2003-04-01 0:37 ` Muthukumar Ratty
1 sibling, 0 replies; 6+ messages in thread
From: Kevin D. Kissell @ 2003-03-31 17:21 UTC (permalink / raw)
To: Amit.Lubovsky, linux-mips
In general, gcc (and most other compilers)
will do this for you automatically if you enable
any reasonable level of optimization. There
is no need to designate the variable as "FAST",
one simply needs to avoid having it be global,
static, or volatile.
----- Original Message -----
From: <Amit.Lubovsky@infineon.com>
To: <linux-mips@linux-mips.org>
Sent: Monday, March 31, 2003 6:45 PM
Subject: mips5kc - cpu registers
> Hi,
> is there a possibility to use cpu registers in the code (temporarily)
> instead of allocating
> automatic variables something like:
> func a()
> {
> FAST int, i, tmp;
> tmp = ...
> ...
> }
>
> as in vxWorks ?
>
> Thanks,
> Amit.
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: mips5kc - cpu registers
2003-03-31 17:21 ` Kevin D. Kissell
2003-03-31 17:21 ` Kevin D. Kissell
@ 2003-04-01 0:37 ` Muthukumar Ratty
2003-04-01 0:37 ` Muthukumar Ratty
1 sibling, 1 reply; 6+ messages in thread
From: Muthukumar Ratty @ 2003-04-01 0:37 UTC (permalink / raw)
To: Kevin D. Kissell; +Cc: Amit.Lubovsky, linux-mips
> In general, gcc (and most other compilers)
> will do this for you automatically if you enable
> any reasonable level of optimization. There
> is no need to designate the variable as "FAST",
> one simply needs to avoid having it be global,
> static, or volatile.
just to add to that... you shouldnt have referred to the address of the
variable. Even if you do, say &tmp, and never assigned it to any ptr,
gcc will not use register for that var.
>
> ----- Original Message -----
> From: <Amit.Lubovsky@infineon.com>
> To: <linux-mips@linux-mips.org>
> Sent: Monday, March 31, 2003 6:45 PM
> Subject: mips5kc - cpu registers
>
>
> > Hi,
> > is there a possibility to use cpu registers in the code (temporarily)
> > instead of allocating
> > automatic variables something like:
> > func a()
> > {
> > FAST int, i, tmp;
> > tmp = ...
> > ...
> > }
> >
> > as in vxWorks ?
> >
> > Thanks,
> > Amit.
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: mips5kc - cpu registers
2003-04-01 0:37 ` Muthukumar Ratty
@ 2003-04-01 0:37 ` Muthukumar Ratty
0 siblings, 0 replies; 6+ messages in thread
From: Muthukumar Ratty @ 2003-04-01 0:37 UTC (permalink / raw)
To: Kevin D. Kissell; +Cc: Amit.Lubovsky, linux-mips
> In general, gcc (and most other compilers)
> will do this for you automatically if you enable
> any reasonable level of optimization. There
> is no need to designate the variable as "FAST",
> one simply needs to avoid having it be global,
> static, or volatile.
just to add to that... you shouldnt have referred to the address of the
variable. Even if you do, say &tmp, and never assigned it to any ptr,
gcc will not use register for that var.
>
> ----- Original Message -----
> From: <Amit.Lubovsky@infineon.com>
> To: <linux-mips@linux-mips.org>
> Sent: Monday, March 31, 2003 6:45 PM
> Subject: mips5kc - cpu registers
>
>
> > Hi,
> > is there a possibility to use cpu registers in the code (temporarily)
> > instead of allocating
> > automatic variables something like:
> > func a()
> > {
> > FAST int, i, tmp;
> > tmp = ...
> > ...
> > }
> >
> > as in vxWorks ?
> >
> > Thanks,
> > Amit.
> >
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-04-01 0:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-31 16:45 mips5kc - cpu registers Amit.Lubovsky
2003-03-31 16:05 ` Juan Quintela
2003-03-31 17:21 ` Kevin D. Kissell
2003-03-31 17:21 ` Kevin D. Kissell
2003-04-01 0:37 ` Muthukumar Ratty
2003-04-01 0:37 ` Muthukumar Ratty
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox