[PATCH] [mips] Set GCC-compatible MIPS asssembler options before inline asm blocks.

Toma Tabacu toma.tabacu at imgtec.com
Fri Dec 12 06:26:27 PST 2014


Hi dsanders,

When generating MIPS assembly, LLVM always overrides the default assembler options by emitting the '.set noreorder', '.set nomacro' and '.set noat' directives,
while GCC uses the default options if an assembly-level function contains inline assembly code.

This becomes a problem when the code generated by LLVM is interleaved with inline assembly which assumes GCC-like assembler options (from Linux, for example).

This patch fixes these conflicts by setting the appropriate assembler options at the beginning of an inline asm block and popping them at the end.

http://reviews.llvm.org/D6637

Files:
  include/llvm/CodeGen/AsmPrinter.h
  lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
  lib/Target/Mips/Mips16HardFloat.cpp
  lib/Target/Mips/MipsAsmPrinter.cpp
  lib/Target/Mips/MipsAsmPrinter.h
  test/CodeGen/Mips/fptr2.ll
  test/CodeGen/Mips/inlineasm-assembler-directives.ll
  test/CodeGen/Mips/inlineasm-cnstrnt-reg.ll
  test/CodeGen/Mips/inlineasmmemop.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6637.17227.patch
Type: text/x-patch
Size: 8026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141212/f68d83e9/attachment.bin>


More information about the llvm-commits mailing list