Skip to contentSkip to conversation

Current egcs, binutils and kernel (fwd)

DISCUSSION David Edelsohn 3 participants 5 messages Apr 20, 1999 – Apr 24, 1999 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

The original POWER architecture with the MQ register allowed a
short sequence to provide this 64-bit functionality. The PowerPC instruction set does not provide the necessary building blocks, so GCC falls back to the C implementation in libgcc2.c producing the assembly code shown in the later posting.

David

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#2 lore raw
Quoted 6 lines · David Edelsohn

The original POWER architecture with the MQ register allowed a
short sequence to provide this 64-bit functionality. The PowerPC instruction set does not provide the necessary building blocks, so GCC falls back to the C implementation in libgcc2.c producing the assembly code shown in the later posting.

Yes, but the kernel is not linked with libgcc2. Anyway I've posted a patch to correctly implement this. And then I've noticed just after that people do more work than necessary in the cvt_df and cvt_fd routines: floating point loads and stores never affect or depend on the FPSCR contents, so there is no point at all in manipulating it (except adding bloat for the sake of adding bloat).

Gabriel.

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#3 lore raw
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Gabriel Paubert writes:

David> The original POWER architecture with the MQ register allowed a David> short sequence to provide this 64-bit functionality. The PowerPC David> instruction set does not provide the necessary building blocks, so GCC David> falls back to the C implementation in libgcc2.c producing the assembly David> code shown in the later posting.

Gabriel> Yes, but the kernel is not linked with libgcc2. Anyway I've posted a patch Gabriel> to correctly implement this. And then I've noticed just after that people Gabriel> do more work than necessary in the cvt_df and cvt_fd routines: floating Gabriel> point loads and stores never affect or depend on the FPSCR contents, so Gabriel> there is no point at all in manipulating it (except adding bloat for the Gabriel> sake of adding bloat).

The purpose of my earlier message was to explain what was
occurring in rs6000.md and why GCC was calling the function instead of inlining the code. I thought that some people might actually want to understand *WHY* the function was required and why GCC was behaving as designed.

David

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#4 lore raw
Quoted 5 lines · David Edelsohn

The purpose of my earlier message was to explain what was
occurring in rs6000.md and why GCC was calling the function instead of inlining the code. I thought that some people might actually want to understand *WHY* the function was required and why GCC was behaving as designed.

Ok, calm down. But I still don't know why GCC does not expand this inline. It's 8 or 10 instructions, without branches so it's not much bigger than a call for which you have to set up 3 parameter registers and which may destroy many more registers according to the ABI conventions. Furthermore if only one of the 2 result registers is needed, it may be simplified quite significantly (i'm not sure it's easy to do in current GCC to split a variable using 2 registers to remove dead code).

Maybe it's time to add the alternatives in rs6000.md, enabled with a -minline-longlongshifts option. But I don't yet know enough of GCC to implement it.

Gabriel.

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]

#5 lore raw
In reply to Gabriel Paubert
Quoted 3 lines · Gabriel Paubert

to correctly implement this. And then I've noticed just after that people do more work than necessary in the cvt_df and cvt_fd routines: floating point loads and stores never affect or depend on the FPSCR contents, so

Arrghl, you're right. I had thought you could get overflows or other errors being signalled, that's why I had the fpscr load/save in there, but it appears from the manual that I was wrong.

Paul.

[[ This message was sent via the linuxppc-dev mailing list. Replies are ]] [[ not forced back to the list, so be sure to Cc linuxppc-dev if your ]] [[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting. ]]