<meta http-equiv="content-type" content="text/html; charset=utf-8">I hope to address the valid concern. I spent time today in retrying. Unfortunately I think it's hard to find a way to generalize these instructions. BFC and BFI are really "special" ones. So I think they deserve these 5 lines of encoding in the patch.<div>
Compared with 1600 lines in ARMCodeEmitter.cpp, maybe these lines are not adding too much. My apologies for not being able to cut down to 0.</div><div><div><br><div class="gmail_quote">On Wed, May 26, 2010 at 2:15 AM, Shih-wei Liao <span dir="ltr"><<a href="mailto:sliao@google.com">sliao@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I agree that it's probably too easy to add one more to the many cases in ARMCodeEmitter.cpp. My bad. If changing ARM*.td can fix the bugs completely, that will be the best. Anyone knows of a better patch that's doable now? That will be great. I tried and stopped after the irregularities like widthm1 encoding and so on. <div>

<div><br></div><div>Probably we should overhaul the ARM*.td some time soon. Currently these 2 if-conditions can make the ARM JIT usable first, and I agree that I should strive for a better solution. Stay tuned.</div><div>

<div><br><div><div><div><div></div><div class="h5">On Tue, May 25, 2010 at 10:07 PM, Evan Cheng <<a href="mailto:evan.cheng@apple.com" target="_blank">evan.cheng@apple.com</a>> wrote:<br>><br>> Sorry I have been behind on patch reviews. I have some concerns about these patches. We want to prevent special casing for individual instructions. Is it not possible to add generic support for these?<br>

><br>> Evan<br>><br>> On May 25, 2010, at 5:25 PM, Shih-wei Liao <<a href="mailto:sliao@google.com" target="_blank">sliao@google.com</a>> wrote:<br>><br>> > Author: sliao<br>> > Date: Tue May 25 19:25:05 2010<br>

> > New Revision: 104653<br>> ><br>> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=104653&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=104653&view=rev</a><br>> > Log:<br>
> > Adding the missing implementation of Bitfield's "clear" and "insert".<br>
> > Fixing <a href="http://llvm.org/bugs/show_bug.cgi?id=7222" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=7222</a>.<br>> ><br>> > Modified:<br>> >    llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp<br>
> ><br>
> > Modified: llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp<br>> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=104653&r1=104652&r2=104653&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp?rev=104653&r1=104652&r2=104653&view=diff</a><br>

> > ==============================================================================<br>> > --- llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp (original)<br>> > +++ llvm/trunk/lib/Target/ARM/ARMCodeEmitter.cpp Tue May 25 19:25:05 2010<br>

> > @@ -781,10 +781,6 @@<br>> >                                                    unsigned ImplicitRn) {<br>> >   const TargetInstrDesc &TID = MI.getDesc();<br>> ><br>> > -  if (TID.Opcode == ARM::BFC) {<br>

> > -    report_fatal_error("ARMv6t2 JIT is not yet supported.");<br>> > -  }<br>> > -<br>> >   // Part of binary is determined by TableGn.<br>> >   unsigned Binary = getBinaryCodeForInstr(MI);<br>

> ><br>> > @@ -820,6 +816,15 @@<br>> >       Binary |= ((Hi16 >> 12) & 0xF) << 16;<br>> >       emitWordLE(Binary);<br>> >       return;<br>> > +  } else if((TID.Opcode == ARM::BFC) || (TID.Opcode == ARM::BFI)) {<br>

> > +      uint32_t v = ~MI.getOperand(2).getImm();<br>> > +      int32_t lsb = CountTrailingZeros_32(v);<br>> > +      int32_t msb = (32 - CountLeadingZeros_32(v)) - 1;<br>> > +      // Insts[20-16] = msb, Insts[11-7] = lsb<br>

> > +      Binary |= (msb & 0x1F) << 16;<br>> > +      Binary |= (lsb & 0x1F) << 7;<br>> > +      emitWordLE(Binary);<br>> > +      return;<br>> >   }<br>> ><br>> >   // If this is a two-address operand, skip it. e.g. MOVCCr operand 1.<br>

> ><br>> ><br>> > _______________________________________________<br>> > llvm-commits mailing list<br>> > <a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br><br><br></div></div>--<br>Thanks,<br>  Shih-wei<br></div></div></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Thanks,<br>  Shih-wei<br>
</div></div>