Skip to content
  1. Dec 18, 2012
  2. Dec 17, 2012
  3. Dec 16, 2012
    • NAKAMURA Takumi's avatar
      MCPureStreamer.cpp: Try to fix build, pruning EmitDebugLabel(). · c7146e25
      NAKAMURA Takumi authored
      llvm-svn: 170280
      c7146e25
    • Reed Kotler's avatar
      This patch is needed to make c++ exceptions work for mips16. · aee4d5d1
      Reed Kotler authored
      Mips16 is really a processor decoding mode (ala thumb 1) and in the same
      program, mips16 and mips32 functions can exist and can call each other.
      
      If a jal type instruction encounters an address with the lower bit set, then
      the processor switches to mips16 mode (if it is not already in it). If the
      lower bit is not set, then it switches to mips32 mode.
      
      The linker knows which functions are mips16 and which are mips32.
      When relocation is performed on code labels, this lower order bit is
      set if the code label is a mips16 code label.
      
      In general this works just fine, however when creating exception handling
      tables and dwarf, there are cases where you don't want this lower order
      bit added in.
      
      This has been traditionally distinguished in gas assembly source by using a
      different syntax for the label.
      
      lab1:      ; this will cause the lower order bit to be added
      lab2=.     ; this will not cause the lower order bit to be added
      
      In some cases, it does not matter because in dwarf and debug tables
      the difference of two labels is used and in that case the lower order
      bits subtract each other out.
      
      To fix this, I have added to mcstreamer the notion of a debuglabel.
      The default is for label and debug label to be the same. So calling
      EmitLabel and EmitDebugLabel produce the same result.
      
      For various reasons, there is only one set of labels that needs to be
      modified for the mips exceptions to work. These are the "$eh_func_beginXXX" 
      labels.
      
      Mips overrides the debug label suffix from ":" to "=." .
      
      This initial patch fixes exceptions. More changes most likely
      will be needed to DwarfCFException to make all of this work
      for actual debugging. These changes will be to emit debug labels in some
      places where a simple label is emitted now.
      
      Some historical discussion on this from gcc can be found at:
      http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00623.html
      http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01273.html 
      
      llvm-svn: 170279
      aee4d5d1
  4. Dec 14, 2012
    • Pedro Artigas's avatar
      · b95c53e2
      Pedro Artigas authored
      Add more reset methods to make all objects that the backend may use for outputting code have a reset, some are not used but were declared for completeness
      
      llvm-svn: 170227
      b95c53e2
    • Bill Schmidt's avatar
      This patch improves the 64-bit PowerPC InitialExec TLS support by providing · 9f0b4ec0
      Bill Schmidt authored
      for a wider range of GOT entries that can hold thread-relative offsets.
      This matches the behavior of GCC, which was not documented in the PPC64 TLS
      ABI.  The ABI will be updated with the new code sequence.
      
      Former sequence:
      
        ld 9,x@got@tprel(2)
        add 9,9,x@tls
      
      New sequence:
      
        addis 9,2,x@got@tprel@ha
        ld 9,x@got@tprel@l(9)
        add 9,9,x@tls
      
      Note that a linker optimization exists to transform the new sequence into
      the shorter sequence when appropriate, by replacing the addis with a nop
      and modifying the base register and relocation type of the ld.
      
      llvm-svn: 170209
      9f0b4ec0
  5. Dec 12, 2012
    • Pedro Artigas's avatar
      · 7212ee45
      Pedro Artigas authored
      Make the MCStreamer have a reset method and call that after finalization of the asm printer, 
      also changed MCContext to a single reset only method for simplicity as requested on the list
      
      llvm-svn: 170041
      7212ee45
    • Chad Rosier's avatar
      [ms-inline asm] Make sure we fail gracefully on parse errors. Parse errors · 149e8e04
      Chad Rosier authored
      should only occur on invalid input.  Instruction matching errors aren't
      unexpected, so we can't rely on the AsmParsers HadError variable directly.
      rdar://12840278
      
      llvm-svn: 170037
      149e8e04
    • Eli Bendersky's avatar
      Make naming consistent, add comments and sanity asserts · e11ab3aa
      Eli Bendersky authored
      llvm-svn: 170007
      e11ab3aa
    • Bill Schmidt's avatar
      This patch implements local-dynamic TLS model support for the 64-bit · 24b8dd6e
      Bill Schmidt authored
      PowerPC target.  This is the last of the four models, so we now have 
      full TLS support.
      
      This is mostly a straightforward extension of the general dynamic model.
      I had to use an additional Chain operand to tie ADDIS_DTPREL_HA to the
      register copy following ADDI_TLSLD_L; otherwise everything above the
      ADDIS_DTPREL_HA appeared dead and was removed.
      
      As before, there are new test cases to test the assembly generation, and
      the relocations output during integrated assembly.  The expected code
      gen sequence can be read in test/CodeGen/PowerPC/tls-ld.ll.
      
      There are a couple of things I think can be done more efficiently in the
      overall TLS code, so there will likely be a clean-up patch forthcoming;
      but for now I want to be sure the functionality is in place.
      
      Bill
      
      llvm-svn: 170003
      24b8dd6e
    • Logan Chien's avatar
      Add ARM NONE and PREL31 relocation types. · 4dd14fb5
      Logan Chien authored
      Add R_ARM_NONE and R_ARM_PREL31 relocation types
      to MCExpr.  Both of them will be used while
      generating .ARM.extab and .ARM.exidx sections.
      
      llvm-svn: 169965
      4dd14fb5
  6. Dec 11, 2012
    • Bill Schmidt's avatar
      This patch implements the general dynamic TLS model for 64-bit PowerPC. · c56f1d34
      Bill Schmidt authored
      Given a thread-local symbol x with global-dynamic access, the generated
      code to obtain x's address is:
      
           Instruction                            Relocation            Symbol
        addis ra,r2,x@got@tlsgd@ha           R_PPC64_GOT_TLSGD16_HA       x
        addi  r3,ra,x@got@tlsgd@l            R_PPC64_GOT_TLSGD16_L        x
        bl __tls_get_addr(x@tlsgd)           R_PPC64_TLSGD                x
                                             R_PPC64_REL24           __tls_get_addr
        nop
        <use address in r3>
      
      The implementation borrows from the medium code model work for introducing
      special forms of ADDIS and ADDI into the DAG representation.  This is made
      slightly more complicated by having to introduce a call to the external
      function __tls_get_addr.  Using the full call machinery is overkill and,
      more importantly, makes it difficult to add a special relocation.  So I've
      introduced another opcode GET_TLS_ADDR to represent the function call, and
      surrounded it with register copies to set up the parameter and return value.
      
      Most of the code is pretty straightforward.  I ran into one peculiarity
      when I introduced a new PPC opcode BL8_NOP_ELF_TLSGD, which is just like
      BL8_NOP_ELF except that it takes another parameter to represent the symbol
      ("x" above) that requires a relocation on the call.  Something in the 
      TblGen machinery causes BL8_NOP_ELF and BL8_NOP_ELF_TLSGD to be treated
      identically during the emit phase, so this second operand was never
      visited to generate relocations.  This is the reason for the slightly
      messy workaround in PPCMCCodeEmitter.cpp:getDirectBrEncoding().
      
      Two new tests are included to demonstrate correct external assembly and
      correct generation of relocations using the integrated assembler.
      
      Comments welcome!
      
      Thanks,
      Bill
      
      llvm-svn: 169910
      c56f1d34
    • Eli Bendersky's avatar
      Remove the RelaxAll overrule in MCAssembler::fixupNeedsRelaxation, · 0f74f173
      Eli Bendersky authored
      because that method is only getting called for MCInstFragment. These
      fragments aren't even generated when RelaxAll is set, which is why the
      flag reference here is superfluous. Removing it simplifies the code
      with no harmful effects.
      
      An assertion is added higher up to make sure this path is never
      reached.
      
      llvm-svn: 169886
      0f74f173
  7. Dec 10, 2012
  8. Dec 08, 2012
  9. Dec 07, 2012
  10. Dec 06, 2012
  11. Dec 05, 2012
  12. Dec 04, 2012
    • Bill Schmidt's avatar
      This patch introduces initial-exec model support for thread-local storage · ca4a0c9d
      Bill Schmidt authored
      on 64-bit PowerPC ELF.
      
      The patch includes code to handle external assembly and MC output with the
      integrated assembler.  It intentionally does not support the "old" JIT.
      
      For the initial-exec TLS model, the ABI requires the following to calculate
      the address of external thread-local variable x:
      
       Code sequence            Relocation                  Symbol
        ld 9,x@got@tprel(2)      R_PPC64_GOT_TPREL16_DS      x
        add 9,9,x@tls            R_PPC64_TLS                 x
      
      The register 9 is arbitrary here.  The linker will replace x@got@tprel
      with the offset relative to the thread pointer to the generated GOT
      entry for symbol x.  It will replace x@tls with the thread-pointer
      register (13).
      
      The two test cases verify correct assembly output and relocation output
      as just described.
      
      PowerPC-specific selection node variants are added for the two
      instructions above:  LD_GOT_TPREL and ADD_TLS.  These are inserted
      when an initial-exec global variable is encountered by
      PPCTargetLowering::LowerGlobalTLSAddress(), and later lowered to
      machine instructions LDgotTPREL and ADD8TLS.  LDgotTPREL is a pseudo
      that uses the same LDrs support added for medium code model's LDtocL,
      with a different relocation type.
      
      The rest of the processing is straightforward.
      
      llvm-svn: 169281
      ca4a0c9d
    • Chandler Carruth's avatar
      Sort includes for all of the .h files under the 'lib' tree. These were · 802d7555
      Chandler Carruth authored
      missed in the first pass because the script didn't yet handle include
      guards.
      
      Note that the script is now able to handle all of these headers without
      manual edits. =]
      
      llvm-svn: 169224
      802d7555
  13. Dec 03, 2012
    • Chandler Carruth's avatar
      Use the new script to sort the includes of every file under lib. · ed0881b2
      Chandler Carruth authored
      Sooooo many of these had incorrect or strange main module includes.
      I have manually inspected all of these, and fixed the main module
      include to be the nearest plausible thing I could find. If you own or
      care about any of these source files, I encourage you to take some time
      and check that these edits were sensible. I can't have broken anything
      (I strictly added headers, and reordered them, never removed), but they
      may not be the headers you'd really like to identify as containing the
      API being implemented.
      
      Many forward declarations and missing includes were added to a header
      files to allow them to parse cleanly when included first. The main
      module rule does in fact have its merits. =]
      
      llvm-svn: 169131
      ed0881b2
  14. Dec 01, 2012
  15. Nov 30, 2012
Loading