[llvm-commits] [llvm] r137804 - in /llvm/trunk: lib/Target/Mips/MipsISelLowering.cpp lib/Target/Mips/MipsISelLowering.h lib/Target/Mips/MipsInstrFormats.td lib/Target/Mips/MipsInstrInfo.td test/CodeGen/Mips/extins.ll

Akira Hatanaka ahatanak at gmail.com
Wed Aug 17 13:54:02 PDT 2011


Please see the attached patch.

I couldn't find a way to have pos and size appear in the right hand
side as you suggested, but tblgen produces the correct binding.
Is this what you had in mind?

On Wed, Aug 17, 2011 at 11:08 AM, Bruno Cardoso Lopes
<bruno.cardoso at gmail.com> wrote:
> Hi,
>
>> Encoding of instruction "ext $dst, $src, $pos, $size" looks like this:
>>
>> field31-26, field25-21, field20-16, field15-11, field10-6, field5-0
>> 31,           $src,          $dst,         $size,       $pos,       0
>>
>> The FR format binds the operands in the following order,
>> (rd:field15-11), (rs:field25-21), (rt:field20-16), (shamt:field10-6)
>>
>> so if I want to use the FR format to define "ext $dst, $src, $pos,
>> $size", the operands need to be given in the following order:
>>
>> $size, $src, $dst, $pos
>>
>> Is it possible to do so? In the format of FR, (dag outs) appears
>> before (dag ins).
>
> The format FR doesn't specify any constraints about the dags outs and
> ins, but only with the encoding. In your ExtIns class which will
> inherit from FR, you can assign the new encoding as for example:
>
> let shamt = pos
> let rd = size
> ...
>
> One more thing, please use $rs and $rt directly, instead of $src and
> $dst, this is actually what we should in all places.
> Thanks
>
> --
> Bruno Cardoso Lopes
> http://www.brunocardoso.cc
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extins.patch
Type: text/x-patch
Size: 4112 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110817/195b82be/attachment.bin>


More information about the llvm-commits mailing list