Skip to contentSkip to conversation

Pseudo-ops: IAS versus ia64-hp-linux-as

Linux-ia64 HARISH J PRABHU 4 participants 5 messages Jan 29, 2002 – Feb 5, 2002

lore
Share & tools
lore
#0 lore raw

Hello
Does the ia64-hp-linux-as assembler which comes with the
Ski/NUE support all pseudo-ops as done by the
Intel Assembler IAS , [ as given in the Assembler Users Guide] ?
The Guide is unclear about what the ld8.mov instruction does. Can somebody explain this to me ?

#1 lore raw
Quoted 4 lines

Does the ia64-hp-linux-as assembler which comes with the
Ski/NUE support all pseudo-ops as done by the
Intel Assembler IAS , [ as given in the Assembler Users Guide] ?

GNU as follows the assembler and architecture documentation. There are some differences in syntax from IAS because IAS doesn't always follow the documentation. No one has really tried to figure out whether IAS or the docs are wrong, we just follow the docs. There are only a couple of minor differences though which are easy to work around.

GNU as supports all of the pseudo-ops, and most of the directives. I don't know of anyone who has tried to verify this, so there could be some obscure ones missing. Some of the optional directives are deliberately not immplemented. These are mostly the directives for performing register allocation in the assembler. GNU as doesn't do register allocation, nor do we think it should. Also, .org is not implemented since GNU ld can't support it.

Quoted 2 lines

The Guide is unclear about what the ld8.mov instruction does. Can somebody explain this to me ?

There is ld8.mov instruction. Perhaps you mean ld8.fill? See the Software Developers Manual, which explains what every instruction does. See also the explanation of the register stack engine and NaT bits, which us what ld8.fill is used for.

Jim

#2 lore raw
In reply to HARISH J PRABHU
Quoted 1 line

Harish,

for reference use IA-64 Software Developer's Manual Vol. 3 Intel-No. 245319-002 (also as pdf). But I didn't find ld8.mov. Do you want to load a register from storage or do you want to move from one register to another?

Christian

Quoted 8 lines

Hello
Does the ia64-hp-linux-as assembler which comes with the
Ski/NUE support all pseudo-ops as done by the
Intel Assembler IAS , [ as given in the Assembler Users Guide] ?
The Guide is unclear about what the ld8.mov instruction does. Can somebody explain this to me ?

#3 lore raw
In reply to HARISH J PRABHU

The following explanation is from the developer of IAS:
--------------

The ld8.mov and the ltoff22x linker operator are the way to implement link time optimization.

The problem:
To get the address of a symbol it takes 3 cycles for an arbitrary symbol and 1 cycle for a symbol in the short section (close to the GP). But if we define all the symbols in the short section we may overflow the short section and it will fail in link time.

The solution:
Mark certain symbols as potential for placement in the short section and the linker will decide if there is enough space there.

The regular code:

	addl r15 = @ltoff(SYM), gp ;;
	ld8 r16 = [r15]			<== r16 holds the address of SYM

The optimized code:

	addl r16 = @gprel(SYM), gp	<== r16 holds the address of SYM

The code with ld8.mov and ltoff22X:

	addl r15 = @ltoffx(SYM), gp ;;
	ld8.mov r16 = [r15]		<== r16 holds the address of SYM

In the case that the linker decide to place SYM in the short section the ltoff will actually be gprel and the ld8 will be converted to mov. If the linker decide not to place SYM in the short section it becomes that same as the regular case.

Note: that the two must come together and the need for linker support. As far as I know GNU linker does not support this.

-----Original Message-----
From: Christian Hildner [mailto:[email protected]]
Sent: Wed, January 30, 2002 10:12 PM
To: [email protected]; [email protected]
Subject: Re: [Linux-ia64] Pseudo-ops: IAS versus ia64-hp-linux-as

Quoted 1 line

Harish,

for reference use IA-64 Software Developer's Manual Vol. 3 Intel-No. 245319-002 (also as pdf).
But I didn't find ld8.mov. Do you want to load a register from storage or do you want to move
from one register to another?

Christian

Quoted 8 lines

Hello
Does the ia64-hp-linux-as assembler which comes with the
Ski/NUE support all pseudo-ops as done by the
Intel Assembler IAS , [ as given in the Assembler Users Guide] ?
The Guide is unclear about what the ld8.mov instruction does. Can somebody explain this to me ?

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64

#4 lore raw
In reply to HARISH J PRABHU
Quoted 1 line

The following explanation is from the developer of IAS:

Thanks for the explanation. It has been obvious to me for almost 3 years that there was a problem with managing the size of the short data section, and it is good to see that Intel has defined a solution for this.

Quoted 2 lines

Note: that the two must come together and the need for linker support. As far as I know GNU linker does not support this.

Because the GNU hackers didn't know about the feature until now. ld8.mov isn't mentioned in my copy of the Assembler Reference Guide. I see that there is a new version of it on the Intel web site, but in order to figure that out, I had to download it first. It would be nice if these documents had version numbers, so I can more easily tell when new versions are available. Also, the lack of change bars and a document history chapter means I have to compare the new doc against the old doc by hand to find what is new. That is enough of a hassle that I rarely bother to do it.

Jim