{"thread":{"id":"308","subject":"Re: [PATCH GIT 0.6] make use of register variables & size_t","startedAt":"2005-04-25T17:36:36Z","lastAt":"2005-04-26T18:18:02Z","messageCount":2,"participants":["Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"1628","messageId":"E1DQ7Vg-0003fq-DC@be1.7eggert.dyndns.org","threadId":"308","inReplyTo":"3X9X6-5JP-27@gated-at.bofh.it","subject":"Re: [PATCH GIT 0.6] make use of register variables & size_t","fromName":"Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>","fromEmail":"7eggert@gmx.de","sentAt":"2005-04-25T17:36:36Z","receivedAt":"2005-04-25T17:36:36Z","isPatch":true,"sender":{"key":"7eggert@gmx.de","avatar":"https://gravatar.com/avatar/9a1c1647bae71e0616fd65aef20206af544236fff9df4648647acf7a51517dac?d=mp&s=160"},"body":"Matthias-Christian Ott <matthias.christian@tiscali.de> wrote:\n\n> The \"git\" didn't try store small variables, which aren't referenced, in\n> the processor registers. It also didn't use the size_t type. I corrected\n> a C++ style comment too.\n\nI have compared functions using 'register' against functions not doing that.\nNot using register allowed better optimization on my x86.\n-- \nThe most dangerous thing in the world is a second lieutenant with a map and\na compass.\n\n"},{"id":"1765","messageId":"E1DQUdL-0000rx-P3@be1.7eggert.dyndns.org","threadId":"308","inReplyTo":"3XfpD-21C-11@gated-at.bofh.it","subject":"Re: [PATCH GIT 0.6] make use of register variables & size_t","fromName":"Bodo Eggert <harvested.in.lkml@posting.7eggert.dyndns.org>","fromEmail":"7eggert@gmx.de","sentAt":"2005-04-26T18:18:02Z","receivedAt":"2005-04-26T18:18:02Z","isPatch":true,"sender":{"key":"7eggert@gmx.de","avatar":"https://gravatar.com/avatar/9a1c1647bae71e0616fd65aef20206af544236fff9df4648647acf7a51517dac?d=mp&s=160"},"body":"Matthias-Christian Ott <matthias.christian@tiscali.de> wrote:\n\n> And if you think \"register\" variables are outdated, please remove the\n> CONFIG_REGPARM option from the Kernel source.\n\nRegister variables are outdated because they hinder the compiler from\noptimizing by taking away 1/7 of the usable registers on x86. Use six\nregister variables and you're back to a accumulator-machine.\nUse -O2 or -Os instead, the compiler is smarter than you.\n\nThe regparm calling convention will change the\nload value -> store value on stack -> call sequence into\nload value -> call -> store if needed\nObviously the second form can be better optimized than the first one.\nTherefore it's a gain instead of a loss.\n\nIf you really want to help the compiler, look for something like repeated\npointer dereference or access to global variables and cache them in block-\nlocal variables (pointers, int and uint only, even for caching chars).\nBeware of volatile variables, and don't forget to look at the assembler code.\n-- \nThe generation of random numbers is too important to be left to chance. \n\n"}]}