git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH GIT 0.6] make use of register variables & size_t

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 25, 2005, 18:50 UTC
Message-ID
<Pine.LNX.4.58.0504251147290.18901@ppc970.osdl.org>
In-Reply-To
<426D33BA.8040604@tiscali.de>
On Mon, 25 Apr 2005, Matthias-Christian Ott wrote:
>
> But this makes, like "register", direct use of processor registers (it
> stores int arguments in eax, ebx, etc.).
No. It make _unlike_ "register", direct use of processor registers.

The "register" keyword does _not_ use processor registers. It's just syntactic fluff, and tells the compiler exactly one thing:

 - that the compiler should warn if you take the address of such a thing.

In addition, the compiler may generate code that takes it into account, which most likely means _worse_ code than if it didn't take it into account.

In contrast regparm() actually says something very relevant: it says that the function uses a totally different calling convention.

		Linus
Previous: Matthias-Christian OttNext: Arjan van de Ven
Message 17 of 21 in “make use of register variables & size_t”
  1. make use of register variables & size_tMatthias-Christian Ott, Apr 25, 2005
  2. Rene RebeApr 25, 2005
  3. Matthias-Christian OttApr 25, 2005
  4. Matthias-Christian OttApr 25, 2005
  5. David A. WheelerApr 25, 2005
  6. Petr BaudisApr 25, 2005
  7. Pekka EnbergApr 25, 2005
  8. Linus TorvaldsApr 25, 2005
  9. Matthias-Christian OttApr 25, 2005
  10. Jan-Benedict GlawApr 25, 2005
  11. Thomas GlanzmannApr 25, 2005
  12. Jan-Benedict GlawApr 25, 2005
  13. Matthias-Christian OttApr 25, 2005
  14. valdis.kletnieks@vt.eduApr 25, 2005
  15. Linus TorvaldsApr 25, 2005
  16. Matthias-Christian OttApr 25, 2005
  17. Linus TorvaldsApr 25, 2005
  18. Arjan van de VenApr 25, 2005
  19. valdis.kletnieks@vt.eduApr 25, 2005
  20. Brian O'MahoneyApr 25, 2005
  21. Dmitry TorokhovApr 25, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.