gas: bmi

Quentin Neill quentin.neill.gnu@gmail.com
Thu Apr 5 14:30:00 GMT 2012


On Thu, Apr 5, 2012 at 9:28 AM, Quentin Neill
<quentin.neill.gnu@gmail.com> wrote:
> On Tue, Apr 3, 2012 at 9:47 AM, nick clifton <nickc@redhat.com> wrote:
>> Hi Christopher,
>>
>>
>>> (I may have sent this to the wrong list... resubmitting...)
>>
>>
>> You have found the correct list now.
>>
>>
>>
>>> Hey guys, how do I get gas to output the BEXTR instruction?
>>
>>
>> Try searching for it in the GAS testsuite.  For example:
>> gas/testsuite/gas/i386/x86-64-tbm.s.  So based on that, this should work:
>>
>>  % cat fred.s
>>
>>         .allow_index_reg
>>        .text
>>
>>  _start:
>>
>>    BEXTR    $0x0,%eax,%r15d
>>
>>  % as fred.s -o fred.o
>>  % objdump -d fred.o
>>  Disassembly of section .text:
>>
>>  0000000000000000 <_start>:
>>     0:   8f 6a 78 10 f8 00 00    bextr  $0x0,%eax,%r15d
>>     7:   00 00
>>
>>
>> Cheers
>>  Nick
>
> Note there are two forms of bextr, "register form" in the BMI
> instruction set, and "immediate form" in the TBM instruction set.
>
> As Nick showed, the test suite is a good place to start, it shows both forms:
>
> $ grep -m1 -i bextr gas/testsuite/gas/i386/???.s
> gas/testsuite/gas/i386/bmi.s:   bextr %eax,%ebx,%esi
> gas/testsuite/gas/i386/tbm.s:    BEXTR    $0x67,(%edx,%esi,8),%ebx
> gas/testsuite/gas/i386/x86-64-bmi.s:    bextr %eax,%ebx,%esi
> gas/testsuite/gas/i386/x86-64-tbm.s:    BEXTR    $0x0,%eax,%r15d
>
> --
> Quentin

The astute will notice my command and output didn't match, it should have been:

$ grep -m1 -i bextr gas/testsuite/gas/i386/*.s
gas/testsuite/gas/i386/bmi.s:   bextr %eax,%ebx,%esi
gas/testsuite/gas/i386/tbm.s:    BEXTR    $0x67,(%edx,%esi,8),%ebx
gas/testsuite/gas/i386/x86-64-bmi.s:    bextr %eax,%ebx,%esi
gas/testsuite/gas/i386/x86-64-tbm.s:    BEXTR    $0x0,%eax,%r15d



More information about the Binutils mailing list