diff mbox

X86-64: Add -mskip-rax-setup

Message ID CAMe9rOpfWdbJ8ZrzyRdFws9XyrJdOJgndOxWiADJMjbDDo2=6w@mail.gmail.com
State New
Headers show

Commit Message

H.J. Lu Dec. 18, 2014, 7:35 p.m. UTC
On Thu, Dec 18, 2014 at 11:22 AM, Mike Stump <mikestump@comcast.net> wrote:
> On Dec 18, 2014, at 9:43 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> + arguments passed in vector registers.  This can be used to
>> + optimize Linux kernel.</li>
>
> English, to optimize _the_ Linux kernel?

Updated.

Comments

Gerald Pfeifer Dec. 26, 2014, 5:07 a.m. UTC | #1
On Thursday 2014-12-18 11:35, H.J. Lu wrote:
> Updated.

"the RAX register" (i.e., add "the"), and I suggest to make
this a sentence, similar to my previous mail for the other
update.

This is fine with these changes.

Thank you -- and that's a nice hack (in the positive sense)!

Gerald
H.J. Lu Dec. 26, 2014, 3:57 p.m. UTC | #2
On Thu, Dec 25, 2014 at 9:07 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> On Thursday 2014-12-18 11:35, H.J. Lu wrote:
>> Updated.
>
> "the RAX register" (i.e., add "the"), and I suggest to make
> this a sentence, similar to my previous mail for the other
> update.
>
> This is fine with these changes.

Done.

> Thank you -- and that's a nice hack (in the positive sense)!
>

It really is a hack :-) and was suggested by Rasmus Villemoes.

Thanks.
Mike Stump Dec. 27, 2014, 4:18 p.m. UTC | #3
On Dec 26, 2014, at 7:57 AM, "H.J. Lu" <hjl.tools@gmail.com> wrote:
> On Thu, Dec 25, 2014 at 9:07 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
>> On Thursday 2014-12-18 11:35, H.J. Lu wrote:
>>> Updated.
>> 
>> "the RAX register" (i.e., add "the"), and I suggest to make
>> this a sentence, similar to my previous mail for the other
>> update.
>> 
>> This is fine with these changes.
> 
> Done.
> 
>> Thank you -- and that's a nice hack (in the positive sense)!
>> 
> 
> It really is a hack :-) and was suggested by Rasmus Villemoes.

So, my suggestion is similar, but different.  Imagine you find 10 of these things over the years, 10 flags look horrible.  I like the -mkernel style flag where all are bundled up under it, essentially it becomes the kernel API flag.
H.J. Lu Dec. 27, 2014, 4:58 p.m. UTC | #4
On Sat, Dec 27, 2014 at 8:18 AM, Mike Stump <mrs@mrs.kithrup.com> wrote:
> On Dec 26, 2014, at 7:57 AM, "H.J. Lu" <hjl.tools@gmail.com> wrote:
>> On Thu, Dec 25, 2014 at 9:07 PM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
>>> On Thursday 2014-12-18 11:35, H.J. Lu wrote:
>>>> Updated.
>>>
>>> "the RAX register" (i.e., add "the"), and I suggest to make
>>> this a sentence, similar to my previous mail for the other
>>> update.
>>>
>>> This is fine with these changes.
>>
>> Done.
>>
>>> Thank you -- and that's a nice hack (in the positive sense)!
>>>
>>
>> It really is a hack :-) and was suggested by Rasmus Villemoes.
>
> So, my suggestion is similar, but different.  Imagine you find 10 of these things over the years, 10 flags look horrible.  I like the -mkernel style flag where all are bundled up under it, essentially it becomes the kernel API flag.

So far, for Linux x86-64 kernel, we added -mskip-rax-setup and allowed
-mpreferred-stack-boundary=3.  We will see how far it goes :-).
diff mbox

Patch

Index: gcc-5/changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-5/changes.html,v
retrieving revision 1.52
diff -u -p -r1.52 changes.html
--- gcc-5/changes.html 15 Dec 2014 19:55:08 -0000 1.52
+++ gcc-5/changes.html 18 Dec 2014 19:35:28 -0000
@@ -444,6 +444,10 @@  void operator delete[] (void *, std::siz
  place of the __fentry__ or mcount call, so that a call per function
  can be later patched in. This can be used for low overhead tracing or
  hot code patching.</li>
+ <li>The new <code>-mskip-rax-setup</code> option to skip setting
+ up RAX register when SSE is disabled and there are no variable
+ arguments passed in vector registers.  This can be used to
+ optimize the Linux kernel.</li>
   </ul>

 <h3 id="sh">SH</h3>