forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ABI Question

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sun Feb 27, 2005 1:20 pm    Post subject: ABI Question Reply with quote

I was looking at something and ran into a question - what ABI does the EE gcc use? Be specific as there are a dozen MIPS ABIs floating around. I don't think I've seen this mentioned anywhere in the examples and what-not.

Thanks.
Back to top
View user's profile Send private message AIM Address
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sun Feb 27, 2005 4:04 pm    Post subject: Reply with quote

Cygnus' EABI.
_________________
"He was warned..."
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Feb 28, 2005 4:00 am    Post subject: Reply with quote

That was helpful... a little googoling turned up this:
http://sources.redhat.com/ml/binutils/2003-06/msg00436.html

Could someone please look this over and see if there are any differences to the EE abi the toolchain builds?
Back to top
View user's profile Send private message AIM Address
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Feb 28, 2005 6:40 am    Post subject: Reply with quote

The EABI used in GCC for the EE uses 64-bit longs, and 32-bit pointers. Stack alignment is 16 bytes, not 8. IIRC, structs with 8 or fewer bytes are passed as values as opposed to 4 given in the spec. Perhaps pixel knows more about that, 'cause I also seem to remember that value being 16 at some point. It would make sense if it's 16 bytes because that's the most data a EE register can hold.

Everything else looks OK.
_________________
"He was warned..."
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Feb 28, 2005 12:00 pm    Post subject: Reply with quote

That's the kind of info some programmers need. We should probably make a doc for PS2Dev that details the EABI the toolchain gcc uses. We could start with something like the message I linked to above, then make the appropriate changes where needed.
Back to top
View user's profile Send private message AIM Address
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Feb 28, 2005 2:14 pm    Post subject: Reply with quote

Thanks for volunteering!
_________________
"He was warned..."
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Mon Feb 28, 2005 7:35 pm    Post subject: Reply with quote

mrbrown wrote:
The EABI used in GCC for the EE uses 64-bit longs, and 32-bit pointers. Stack alignment is 16 bytes, not 8. IIRC, structs with 8 or fewer bytes are passed as values as opposed to 4 given in the spec. Perhaps pixel knows more about that, 'cause I also seem to remember that value being 16 at some point. It would make sense if it's 16 bytes because that's the most data a EE register can hold.

Everything else looks OK.
Never looked at how ee-gcc handles structs-passed-as-arguments. But it would sound strange since even though 16-bytes is the biggest thing EE can handle in its registers, gcc doesn't know about how to do anything with that apart of load and store. Trying...

-----

With a 16-bytes structure passed on first argument of a function, a0 contains a pointer to the structure.
With a 8-bytes structure passed on first argument of a function, the structure is contained straight inside the stack.
With a 4-bytes structure passed on first argument of a function, the structure is inside a0.
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Mon Feb 28, 2005 10:24 pm    Post subject: Reply with quote

Ah - interesting that it would put it on the stack, but I guess according to the EABI it's a parameter.

It would be cool if 16 bytes were supported, and MMI instructions were used by the compiler to "depack" the register :).
_________________
"He was warned..."
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Mon Feb 28, 2005 10:36 pm    Post subject: Reply with quote

mrbrown wrote:
It would be cool if 16 bytes were supported, and MMI instructions were used by the compiler to "depack" the register :).
Thanks for volunteering ^_^
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Tue Mar 01, 2005 10:55 am    Post subject: Reply with quote

I'd be glad to put together the ABI spec file. Just keep the comments on various things coming and I'll make the changes in the base spec file. I might also post a question or two when I spot something that needs clarification.
:)
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group