osdir.com
mailing list archive

Subject: Re: Inline assembly clobbered registers - msg#00073

List: gcc.help

Date: Prev Next Index Thread: Prev Next Index
Christian Hildner <christian.hildner@xxxxxx> writes:

> Falk Hueffner schrieb:
> >Christian Hildner <christian.hildner@xxxxxx> writes:
> >>I need a temporary general register inside the inline assembly
> >>code. The definition for a particular register is possible by for
> >>example "eax". But how to define a general register that the
> >>compiler is allowed to choose as it is possible with input/output
> >>registers who are referenced by %0, %1, ... ? So simply to allow "r"
> >>in the clobbered list and reference it by %x in the assembly code.
> >
> >Why can't you just make it an output variable?
> >
> I made it an input one instead.

That will lead to wrong code, since gcc thinks you won't change it.

> This is possible, but it would be nicer to allow an unspecified
> general register in the clobbered list.

But since the functioinality is trivially available by another way, I
don't think it's worth adding complexity to the compiler for this.

--
Falk



Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: Inline assembly clobbered registers

Falk Hueffner schrieb: Christian Hildner <christian.hildner@xxxxxx> writes: I need a temporary general register inside the inline assembly code. The definition for a particular register is possible by for example "eax". But how to define a general register that the compiler is allowed to choose as it is possible with input/output registers who are referenced by %0, %1, ... ? So simply to allow "r" in the clobbered list and reference it by %x in the assembly code. Why can't you just make it an output variable? I made it an input one instead. This is possible, but it would be nicer to allow an unspecified general register in the clobbered list. Christian

Next Message by Date: click to view message preview

compile time using 2.96

Hi, I am compiling a QT application using g++ version 2.96. It takes about 15 minutes to compile all the files. What do you think the best solution would be to speed up the time? Would a different version be faster? Would some cli arguments tell g++ to optimize for speed? Any help would be appreciated. (Please CC Me) Thanks, Bob Rossi

Previous Message by Thread: click to view message preview

Re: Inline assembly clobbered registers

Falk Hueffner schrieb: Christian Hildner <christian.hildner@xxxxxx> writes: I need a temporary general register inside the inline assembly code. The definition for a particular register is possible by for example "eax". But how to define a general register that the compiler is allowed to choose as it is possible with input/output registers who are referenced by %0, %1, ... ? So simply to allow "r" in the clobbered list and reference it by %x in the assembly code. Why can't you just make it an output variable? I made it an input one instead. This is possible, but it would be nicer to allow an unspecified general register in the clobbered list. Christian

Next Message by Thread: click to view message preview

Re: Inline assembly clobbered registers

Falk Hueffner schrieb: Christian Hildner <christian.hildner@xxxxxx> writes: Falk Hueffner schrieb: Christian Hildner <christian.hildner@xxxxxx> writes: I need a temporary general register inside the inline assembly code. The definition for a particular register is possible by for example "eax". But how to define a general register that the compiler is allowed to choose as it is possible with input/output registers who are referenced by %0, %1, ... ? So simply to allow "r" in the clobbered list and reference it by %x in the assembly code. Why can't you just make it an output variable? I made it an input one instead. That will lead to wrong code, since gcc thinks you won't change it. Inspecting the output I found that there will be no corruption of registers. But since it may not be 100% save I will switch to the usage of output registers (as you suggested). This is possible, but it would be nicer to allow an unspecified general register in the clobbered list. But since the functioinality is trivially available by another way, I don't think it's worth adding complexity to the compiler for this. I am just wondering to be at least the only one that would need that feature. Thanks Christian
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by