Ticket #2129 (new enhancement)

Opened 5 months ago

Last modified 5 months ago

Optimization: Helping gcc with function attributes

Reported by: tqh Owned by: axeld
Priority: normal Milestone: R1
Component: System/Kernel Version: R1 development
Cc: anevilyak Blocked By:
Platform: x86 Blocking:

Description

I wanted to experiment with gcc's attribute((fastcall)) which makes the functions two first arguments being passed in registers. I added it to kernel functions I thought would be called a lot. The resulting OS seems to be very responsive, although no measurements have been done.

My patch is just for inspiration, it is ugly and I did not really care about compability or if I break any API. Providing it here for those interested. It is used A LOT in Mozilla sources btw although hidden behind macros. It might be useful along with other function attributes in critical parts.

Function attributes are described here: http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Attachments

ugly-fastcall.patch (14.5 kB) - added by tqh 5 months ago.
Ugly fastcall patch
ugly-fastcall.r25229.patch (16.4 kB) - added by tqh 4 months ago.
Ugly fastcall patch against r25229

Change History

Changed 5 months ago by tqh

Ugly fastcall patch

Changed 5 months ago by tqh

attribute has two underscores in front and after that went missing in the submission.

Changed 5 months ago by anevilyak

  • cc anevilyak added

Changed 4 months ago by tqh

Ugly fastcall patch against r25229

Note: See TracTickets for help on using tickets.