[llvm-commits] [llvm] r163287 - in /llvm/trunk/lib/Target/Mips: CMakeLists.txt MipsAsmPrinter.cpp MipsDirectObjLower.cpp MipsDirectObjLower.h MipsMCInstLower.cpp MipsMCInstLower.h

Akira Hatanaka ahatanak at gmail.com
Fri Sep 14 10:34:07 PDT 2012


This patch was reviewed internally at mips.

clang actually does print the pseudo when you compile with "-S". The
function which does the pseudo-to-real expansion is called only if
OutStreamer.hasRawTextSupport() returns false:

+    if (!OutStreamer.hasRawTextSupport()){


But I realize now that perhaps this expansion should happen in
MCCodeEmitter::EncodeInstruction as you suggest. The purpose of this patch
was to change the function to do a mcinst-to-mcinst conversion to make it
available to both direct object emitter and assembler. If the function is
called in MCCodeEmitter::EncodeInstruction, then that will take care of
both cases.


On Thu, Sep 13, 2012 at 6:09 PM, Rafael EspĂ­ndola <
rafael.espindola at gmail.com> wrote:

> On 5 September 2012 22:31, Jack Carter <jcarter at mips.com> wrote:
> > Author: jacksprat
> > Date: Wed Sep  5 21:31:34 2012
> > New Revision: 163287
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=163287&view=rev
> > Log:
> > There are some Mips instructions that are lowered by the
> > assembler such as shifts greater than 32. In the case
> > of direct object, the code gen needs to do this lowering
> > since the assembler is not involved.
> >
> > With the advent of the llvm-mc assembler, it also needs
> > to do the same lowering.
> >
> > This patch makes that specific lowering code accessible
> > to both the direct object output and the assembler.
> >
> > This patch does not affect generated output.
>
> Has this patch been reviewed? It doesn't look like the best solution.
> If I understand it correctly, there is a pseudo instruction that the
> mips assembler turns into a real instruction. This looks really
> similar to the .cfi pseudo instructions. The way we handle them is
>
> * Codegen just uses a regular MCStreamer interface to print the pseudo
> instruction.
> * The Asm streamer prints the text representation of the pseudo
> instruction.
> * The object streamer expands it into the "real stuff".
>
> The user observed difference is that "clang -S" uses the pseudo
> instruction, which is a good thing, no?
>
> Cheers,
> Rafael
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120914/6b5a5af6/attachment.html>


More information about the llvm-commits mailing list