Patch: Add support for pusha/popa

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Patch: Add support for pusha/popa

Nico Weber
Hi,

the attached patch adds support for "pusha" and "popa" in asm blocks.
It's strictly speaking an llvm patch, but I'm not on llvm-dev.

The binary produced by clang with for the two instructions matches gcc
in i386 mode. In x86_64 mode, gcc correctly points out that the
instruction is 32-bit only, while clang doesn't do this yet. nicholas
on irc says that that's probably because clang doesn't check for
32/64bit mismatches yet for inline assembly.

Let me know what you think.

Thanks,
Nico

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

llvm-pusha.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patch: Add support for pusha/popa

Daniel Dunbar
Hi Nico,

This looks fine to me, but please add a test case to x86_32-new-encoder.s or so.

 - Daniel

On Tue, Jun 22, 2010 at 9:56 PM, Nico Weber <[hidden email]> wrote:

> Hi,
>
> the attached patch adds support for "pusha" and "popa" in asm blocks.
> It's strictly speaking an llvm patch, but I'm not on llvm-dev.
>
> The binary produced by clang with for the two instructions matches gcc
> in i386 mode. In x86_64 mode, gcc correctly points out that the
> instruction is 32-bit only, while clang doesn't do this yet. nicholas
> on irc says that that's probably because clang doesn't check for
> 32/64bit mismatches yet for inline assembly.
>
> Let me know what you think.
>
> Thanks,
> Nico
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Patch: Add support for pusha/popa

Nico Weber
Done.

On Tue, Jun 22, 2010 at 10:17 PM, Daniel Dunbar <[hidden email]> wrote:

> Hi Nico,
>
> This looks fine to me, but please add a test case to x86_32-new-encoder.s or so.
>
>  - Daniel
>
> On Tue, Jun 22, 2010 at 9:56 PM, Nico Weber <[hidden email]> wrote:
>> Hi,
>>
>> the attached patch adds support for "pusha" and "popa" in asm blocks.
>> It's strictly speaking an llvm patch, but I'm not on llvm-dev.
>>
>> The binary produced by clang with for the two instructions matches gcc
>> in i386 mode. In x86_64 mode, gcc correctly points out that the
>> instruction is 32-bit only, while clang doesn't do this yet. nicholas
>> on irc says that that's probably because clang doesn't check for
>> 32/64bit mismatches yet for inline assembly.
>>
>> Let me know what you think.
>>
>> Thanks,
>> Nico
>>
>> _______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

llvm-pusha.patch (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Patch: Add support for pusha/popa

Eli Friedman
In reply to this post by Nico Weber
On Tue, Jun 22, 2010 at 9:56 PM, Nico Weber <[hidden email]> wrote:
> Hi,
>
> the attached patch adds support for "pusha" and "popa" in asm blocks.
> It's strictly speaking an llvm patch, but I'm not on llvm-dev.

Note that you don't have to be subscribed to llvm-dev or llvm-commits
to send a message.

-Eli
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Patch: Add support for pusha/popa

Chris Lattner
In reply to this post by Nico Weber

On Jun 22, 2010, at 10:34 PM, Nico Weber wrote:

> Done.

Looks good to me, please commit (you do have commit access to llvm as well as clang) with two comment typo fixes:

+      // ignore (pushes all GP registoers onto the stack)
..
+      // ignore (pushes all GP registoers onto the stack)

Thanks Nico!

-Chris

>
> On Tue, Jun 22, 2010 at 10:17 PM, Daniel Dunbar <[hidden email]> wrote:
>> Hi Nico,
>>
>> This looks fine to me, but please add a test case to x86_32-new-encoder.s or so.
>>
>>  - Daniel
>>
>> On Tue, Jun 22, 2010 at 9:56 PM, Nico Weber <[hidden email]> wrote:
>>> Hi,
>>>
>>> the attached patch adds support for "pusha" and "popa" in asm blocks.
>>> It's strictly speaking an llvm patch, but I'm not on llvm-dev.
>>>
>>> The binary produced by clang with for the two instructions matches gcc
>>> in i386 mode. In x86_64 mode, gcc correctly points out that the
>>> instruction is 32-bit only, while clang doesn't do this yet. nicholas
>>> on irc says that that's probably because clang doesn't check for
>>> 32/64bit mismatches yet for inline assembly.
>>>
>>> Let me know what you think.
>>>
>>> Thanks,
>>> Nico
>>>
>>> _______________________________________________
>>> cfe-dev mailing list
>>> [hidden email]
>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>
>>>
>>
> <llvm-pusha.patch>_______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Patch: Add support for pusha/popa

Nico Weber
Thanks, committed as r106671.

On Tue, Jun 22, 2010 at 10:48 PM, Chris Lattner <[hidden email]> wrote:

>
> On Jun 22, 2010, at 10:34 PM, Nico Weber wrote:
>
>> Done.
>
> Looks good to me, please commit (you do have commit access to llvm as well as clang) with two comment typo fixes:
>
> +      // ignore (pushes all GP registoers onto the stack)
> ..
> +      // ignore (pushes all GP registoers onto the stack)
>
> Thanks Nico!
>
> -Chris
>
>>
>> On Tue, Jun 22, 2010 at 10:17 PM, Daniel Dunbar <[hidden email]> wrote:
>>> Hi Nico,
>>>
>>> This looks fine to me, but please add a test case to x86_32-new-encoder.s or so.
>>>
>>>  - Daniel
>>>
>>> On Tue, Jun 22, 2010 at 9:56 PM, Nico Weber <[hidden email]> wrote:
>>>> Hi,
>>>>
>>>> the attached patch adds support for "pusha" and "popa" in asm blocks.
>>>> It's strictly speaking an llvm patch, but I'm not on llvm-dev.
>>>>
>>>> The binary produced by clang with for the two instructions matches gcc
>>>> in i386 mode. In x86_64 mode, gcc correctly points out that the
>>>> instruction is 32-bit only, while clang doesn't do this yet. nicholas
>>>> on irc says that that's probably because clang doesn't check for
>>>> 32/64bit mismatches yet for inline assembly.
>>>>
>>>> Let me know what you think.
>>>>
>>>> Thanks,
>>>> Nico
>>>>
>>>> _______________________________________________
>>>> cfe-dev mailing list
>>>> [hidden email]
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>>
>>>>
>>>
>> <llvm-pusha.patch>_______________________________________________
>> cfe-dev mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev