[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

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Wed Aug 17 11:08:35 PDT 2011


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




More information about the llvm-commits mailing list