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
Vvaldis.kletnieks@vt.edu <valdis.kletnieks@vt.edu>
Date
Apr 25, 2005, 18:55 UTC
Message-ID
<200504251855.j3PItHQs021408@turing-police.cc.vt.edu>
In-Reply-To
<426D33BA.8040604@tiscali.de>
On Mon, 25 Apr 2005 20:15:22 +0200, Matthias-Christian Ott said:
> But this makes, like "register",  direct use of processor registers (it stores int arguments in eax, ebx, etc.).
`-mregparm=NUM'
     Control how many registers are used to pass integer arguments.  By
     default, no registers are used to pass arguments, and at most 3
     registers can be used.  You can control this behavior for a
     specific function by using the function attribute `regparm'.
     *Note Function Attributes::.
     *Warning:* if you use this switch, and NUM is nonzero, then you
     must build all modules with the same value, including any
     libraries.  This includes the system libraries and startup modules.

If it weren't for that *warning*, you could get away with making this another auto-optimizable value (similar to register allocation inside a function). Alas, the caller and called functions can be in different .o files, and as a result, you need to be able to specify the NUM to use to each invocation of gcc involved, as there's an ABI change involved....

> Stay serious. The book only teaches you ISO-C 99 like many other books. So
> where's your problem?

The problem is the supposition that the implied 3 week's experience in a language makes anybody qualified to comment on how to use it truly effectively (for that matter, I've been programming in C since SunOS 3.2, literally 2 decades ago, and I'm still finding little corners I didn't previously know...)

Previous: Arjan van de VenNext: Brian O'Mahoney
Message 19 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.