Skip to content
  1. Jul 01, 2013
    • Bill Schmidt's avatar
      Index: test/CodeGen/PowerPC/reloc-align.ll · 48fc20a0
      Bill Schmidt authored
      ===================================================================
      --- test/CodeGen/PowerPC/reloc-align.ll	(revision 0)
      +++ test/CodeGen/PowerPC/reloc-align.ll	(revision 0)
      @@ -0,0 +1,34 @@
      +; RUN: llc -mcpu=pwr7 -O1 < %s | FileCheck %s
      +
      +; This test verifies that the peephole optimization of address accesses
      +; does not produce a load or store with a relocation that can't be
      +; satisfied for a given instruction encoding.  Reduced from a test supplied
      +; by Hal Finkel.
      +
      +target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
      +target triple = "powerpc64-unknown-linux-gnu"
      +
      +%struct.S1 = type { [8 x i8] }
      +
      +@main.l_1554 = internal global { i8, i8, i8, i8, i8, i8, i8, i8 } { i8 -1, i8 -6, i8 57, i8 62, i8 -48, i8 0, i8 58, i8 80 }, align 1
      +
      +; Function Attrs: nounwind readonly
      +define signext i32 @main() #0 {
      +entry:
      +  %call = tail call fastcc signext i32 @func_90(%struct.S1* byval bitcast ({ i8, i8, i8, i8, i8, i8, i8, i8 }* @main.l_1554 to %struct.S1*))
      +; CHECK-NOT: ld {{[0-9]+}}, main.l_1554@toc@l
      +  ret i32 %call
      +}
      +
      +; Function Attrs: nounwind readonly
      +define internal fastcc signext i32 @func_90(%struct.S1* byval nocapture %p_91) #0 {
      +entry:
      +  %0 = bitcast %struct.S1* %p_91 to i64*
      +  %bf.load = load i64* %0, align 1
      +  %bf.shl = shl i64 %bf.load, 26
      +  %bf.ashr = ashr i64 %bf.shl, 54
      +  %bf.cast = trunc i64 %bf.ashr to i32
      +  ret i32 %bf.cast
      +}
      +
      +attributes #0 = { nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
      Index: lib/Target/PowerPC/PPCAsmPrinter.cpp
      ===================================================================
      --- lib/Target/PowerPC/PPCAsmPrinter.cpp	(revision 185327)
      +++ lib/Target/PowerPC/PPCAsmPrinter.cpp	(working copy)
      @@ -679,7 +679,26 @@ void PPCAsmPrinter::EmitInstruction(const MachineI
             OutStreamer.EmitRawText(StringRef("\tmsync"));
             return;
           }
      +    break;
      +  case PPC::LD:
      +  case PPC::STD:
      +  case PPC::LWA: {
      +    // Verify alignment is legal, so we don't create relocations
      +    // that can't be supported.
      +    // FIXME:  This test is currently disabled for Darwin.  The test
      +    // suite shows a handful of test cases that fail this check for
      +    // Darwin.  Those need to be investigated before this sanity test
      +    // can be enabled for those subtargets.
      +    if (!Subtarget.isDarwin()) {
      +      unsigned OpNum = (MI->getOpcode() == PPC::STD) ? 2 : 1;
      +      const MachineOperand &MO = MI->getOperand(OpNum);
      +      if (MO.isGlobal() && MO.getGlobal()->getAlignment() < 4)
      +        llvm_unreachable("Global must be word-aligned for LD, STD, LWA!");
      +    }
      +    // Now process the instruction normally.
      +    break;
         }
      +  }
       
         LowerPPCMachineInstrToMCInst(MI, TmpInst, *this);
         OutStreamer.EmitInstruction(TmpInst);
      Index: lib/Target/PowerPC/PPCISelDAGToDAG.cpp
      ===================================================================
      --- lib/Target/PowerPC/PPCISelDAGToDAG.cpp	(revision 185327)
      +++ lib/Target/PowerPC/PPCISelDAGToDAG.cpp	(working copy)
      @@ -1530,6 +1530,14 @@ void PPCDAGToDAGISel::PostprocessISelDAG() {
             if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(ImmOpnd)) {
               SDLoc dl(GA);
               const GlobalValue *GV = GA->getGlobal();
      +        // We can't perform this optimization for data whose alignment
      +        // is insufficient for the instruction encoding.
      +        if (GV->getAlignment() < 4 &&
      +            (StorageOpcode == PPC::LD || StorageOpcode == PPC::STD ||
      +             StorageOpcode == PPC::LWA)) {
      +          DEBUG(dbgs() << "Rejected this candidate for alignment.\n\n");
      +          continue;
      +        }
               ImmOpnd = CurDAG->getTargetGlobalAddress(GV, dl, MVT::i64, 0, Flags);
             } else if (ConstantPoolSDNode *CP =
                        dyn_cast<ConstantPoolSDNode>(ImmOpnd)) {
      
      llvm-svn: 185380
      48fc20a0
  2. Jun 21, 2013
    • Ulrich Weigand's avatar
      · d51c09f5
      Ulrich Weigand authored
      [PowerPC] Rename some more VK_PPC_ enums
      
      This renames more VK_PPC_ enums, to make them more closely reflect
      the @modifier string they represent.  This also prepares for adding
      a bunch of new VK_PPC_ enums in upcoming patches.
      
      For consistency, some MO_ flags related to VK_PPC_ enums are
      likewise renamed.
      
      No change in behaviour.
      
      llvm-svn: 184547
      d51c09f5
    • Ulrich Weigand's avatar
      · 68e2e1b3
      Ulrich Weigand authored
      [PowerPC] Clean up VK_PPC_TOC... names
      
      This is another minor cleanup; to bring enum names in line
      with the corresponding @modifier names, this renames:
      
        VK_PPC_TOC -> VK_PPC_TOCBASE
        VK_PPC_TOC_ENTRY -> VK_PPC_TOC16
      
      No code change intended.
      
      llvm-svn: 184491
      68e2e1b3
  3. Jun 20, 2013
    • Ulrich Weigand's avatar
      · 4727888f
      Ulrich Weigand authored
      [PowerPC] Remove unused parameter
      
      The isDarwin parameter to the llvm::LowerPPCMachineInstrToMCInst
      routine is now no longer needed; remove it.
      
      llvm-svn: 184441
      4727888f
  4. Jun 16, 2013
  5. May 24, 2013
    • Ulrich Weigand's avatar
      · 41789de1
      Ulrich Weigand authored
      [PowerPC] Clean up generation of ha16() / lo16() markers
      
      When targeting the Darwin assembler, we need to generate markers ha16() and
      lo16() to designate the high and low parts of a (symbolic) immediate.  This
      is necessary not just for plain symbols, but also for certain symbolic
      expression, typically along the lines of ha16(A - B).  The latter doesn't
      work when simply using VariantKind flags on the symbol reference.
      This is why the current back-end uses hacks (explicitly called out as such
      via multiple FIXMEs) in the symbolLo/symbolHi print methods.
      
      This patch uses target-defined MCExpr codes to represent the Darwin
      ha16/lo16 constructs, following along the lines of the equivalent solution
      used by the ARM back end to handle their :upper16: / :lower16: markers.
      This allows us to get rid of special handling both in the symbolLo/symbolHi
      print method and in the common code MCExpr::print routine.  Instead, the
      ha16 / lo16 markers are printed simply in a custom print routine for the
      target MCExpr types.  (As a result, the symbolLo/symbolHi print methods
      can now replaced by a single printS16ImmOperand routine that also handles
      symbolic operands.)
      
      The patch also provides a EvaluateAsRelocatableImpl routine to handle
      ha16/lo16 constructs.  This is not actually used at the moment by any
      in-tree code, but is provided as it makes merging into David Fang's
      out-of-tree Mach-O object writer simpler.
      
      Since there is no longer any need to treat VK_PPC_GAS_HA16 and
      VK_PPC_DARWIN_HA16 differently, they are merged into a single
      VK_PPC_ADDR16_HA (and likewise for the _LO16 types).
      
      llvm-svn: 182616
      41789de1
  6. Apr 17, 2013
  7. Apr 05, 2013
    • Hal Finkel's avatar
      Rename the current PPC BCL definition to BCLalways · e5680b3c
      Hal Finkel authored
      BCL is normally a conditional branch-and-link instruction, but has
      an unconditional form (which is used in the SjLj code, for example).
      To make clear that this BCL instruction definition is specifically
      the special unconditional form (which does not meaningfully take
      a condition-register input), rename it to BCLalways.
      
      No functionality change intended.
      
      llvm-svn: 178803
      e5680b3c
  8. Mar 26, 2013
    • Ulrich Weigand's avatar
      PowerPC: Remove LDrs pattern. · 4a083886
      Ulrich Weigand authored
      The LDrs pattern is a duplicate of LD, except that it accepts memory
      addresses where the displacement is a symbolLo64.  An operand type
      "memrs" is defined for just that purpose.
      
      However, this wouldn't be necessary if the default "memrix" operand
      type were to simply accept 64-bit symbolic addresses directly.
      The only problem with that is that it uses "symbolLo", which is
      hardcoded to 32-bit.
      
      To fix this, this commit changes "memri" and "memrix" to use new
      operand types for the memory displacement, which allow iPTR
      instead of i32.  This will also make address parsing easier to
      implment in the asm parser.
      
      No change in generated code.
      
      llvm-svn: 178005
      4a083886
    • Ulrich Weigand's avatar
      PowerPC: Remove ADDIL patterns. · 35f9fdfd
      Ulrich Weigand authored
      The ADDI/ADDI8 patterns are currently duplicated into ADDIL/ADDI8L,
      which describe the same instruction, except that they accept a
      symbolLo[64] operand instead of a s16imm[64] operand.
      
      This duplication confuses the asm parser, and it actually not really
      needed, since symbolLo[64] already accepts immediate operands anyway.
      So this commit removes the duplicate patterns.
      
      No change in generated code.
      
      llvm-svn: 178004
      35f9fdfd
  9. Mar 23, 2013
    • Hal Finkel's avatar
      MCize the bcl instruction in PPCAsmPrinter · f07a8e04
      Hal Finkel authored
      I recently added a BCL instruction definition as part of implementing SjLj
      support. This can also be used to MCize bcl emission in the asm printer.
      
      No functionality change intended.
      
      llvm-svn: 177830
      f07a8e04
  10. Mar 22, 2013
    • Ulrich Weigand's avatar
      Remove ABI-duplicated call instruction patterns. · f62e83f4
      Ulrich Weigand authored
      We currently have a duplicated set of call instruction patterns depending
      on the ABI to be followed (Darwin vs. Linux).  This is a bit odd; while the
      different ABIs will result in different instruction sequences, the actual
      instructions themselves ought to be independent of the ABI.  And in fact it
      turns out that the only nontrivial difference between the two sets of
      patterns is that in the PPC64 Linux ABI, the instruction used for indirect
      calls is marked to take X11 as extra input register (which is indeed used
      only with that ABI to hold an incoming environment pointer for nested
      functions).  However, this does not need to be hard-coded at the .td
      pattern level; instead, the C++ code expanding calls can simply add that
      use, just like it adds uses for argument registers anyway.
      
      No change in generated code expected.
      
      llvm-svn: 177735
      f62e83f4
  11. Feb 21, 2013
    • Bill Schmidt's avatar
      Large code model support for PowerPC. · 27917785
      Bill Schmidt authored
      Large code model is identical to medium code model except that the
      addis/addi sequence for "local" accesses is never used.  All accesses
      use the addis/ld sequence.
      
      The coding changes are straightforward; most of the patch is taken up
      with creating variants of the medium model tests for large model.
      
      llvm-svn: 175767
      27917785
  12. Feb 04, 2013
  13. Jan 09, 2013
  14. Jan 07, 2013
  15. Jan 02, 2013
    • Chandler Carruth's avatar
      Move all of the header files which are involved in modelling the LLVM IR · 9fb823bb
      Chandler Carruth authored
      into their new header subdirectory: include/llvm/IR. This matches the
      directory structure of lib, and begins to correct a long standing point
      of file layout clutter in LLVM.
      
      There are still more header files to move here, but I wanted to handle
      them in separate commits to make tracking what files make sense at each
      layer easier.
      
      The only really questionable files here are the target intrinsic
      tablegen files. But that's a battle I'd rather not fight today.
      
      I've updated both CMake and Makefile build systems (I think, and my
      tests think, but I may have missed something).
      
      I've also re-sorted the includes throughout the project. I'll be
      committing updates to Clang, DragonEgg, and Polly momentarily.
      
      llvm-svn: 171366
      9fb823bb
  16. Dec 14, 2012
    • 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
  17. Dec 12, 2012
    • 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
  18. 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
  19. 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
  20. 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
  21. Nov 27, 2012
    • Bill Schmidt's avatar
      This patch implements medium code model support for 64-bit PowerPC. · 34627e34
      Bill Schmidt authored
      The default for 64-bit PowerPC is small code model, in which TOC entries
      must be addressable using a 16-bit offset from the TOC pointer.  Additionally,
      only TOC entries are addressed via the TOC pointer.
      
      With medium code model, TOC entries and data sections can all be addressed
      via the TOC pointer using a 32-bit offset.  Cooperation with the linker
      allows 16-bit offsets to be used when these are sufficient, reducing the
      number of extra instructions that need to be executed.  Medium code model
      also does not generate explicit TOC entries in ".section toc" for variables
      that are wholly internal to the compilation unit.
      
      Consider a load of an external 4-byte integer.  With small code model, the
      compiler generates:
      
      	ld 3, .LC1@toc(2)
      	lwz 4, 0(3)
      
      	.section	.toc,"aw",@progbits
      .LC1:
      	.tc ei[TC],ei
      
      With medium model, it instead generates:
      
      	addis 3, 2, .LC1@toc@ha
      	ld 3, .LC1@toc@l(3)
      	lwz 4, 0(3)
      
      	.section	.toc,"aw",@progbits
      .LC1:
      	.tc ei[TC],ei
      
      Here .LC1@toc@ha is a relocation requesting the upper 16 bits of the
      32-bit offset of ei's TOC entry from the TOC base pointer.  Similarly,
      .LC1@toc@l is a relocation requesting the lower 16 bits.  Note that if
      the linker determines that ei's TOC entry is within a 16-bit offset of
      the TOC base pointer, it will replace the "addis" with a "nop", and
      replace the "ld" with the identical "ld" instruction from the small
      code model example.
      
      Consider next a load of a function-scope static integer.  For small code
      model, the compiler generates:
      
      	ld 3, .LC1@toc(2)
      	lwz 4, 0(3)
      
      	.section	.toc,"aw",@progbits
      .LC1:
      	.tc test_fn_static.si[TC],test_fn_static.si
      	.type	test_fn_static.si,@object
      	.local	test_fn_static.si
      	.comm	test_fn_static.si,4,4
      
      For medium code model, the compiler generates:
      
      	addis 3, 2, test_fn_static.si@toc@ha
      	addi 3, 3, test_fn_static.si@toc@l
      	lwz 4, 0(3)
      
      	.type	test_fn_static.si,@object
      	.local	test_fn_static.si
      	.comm	test_fn_static.si,4,4
      
      Again, the linker may replace the "addis" with a "nop", calculating only
      a 16-bit offset when this is sufficient.
      
      Note that it would be more efficient for the compiler to generate:
      
      	addis 3, 2, test_fn_static.si@toc@ha
              lwz 4, test_fn_static.si@toc@l(3)
      
      The current patch does not perform this optimization yet.  This will be
      addressed as a peephole optimization in a later patch.
      
      For the moment, the default code model for 64-bit PowerPC will remain the
      small code model.  We plan to eventually change the default to medium code
      model, which matches current upstream GCC behavior.  Note that the different
      code models are ABI-compatible, so code compiled with different models will
      be linked and execute correctly.
      
      I've tested the regression suite and the application/benchmark test suite in
      two ways:  Once with the patch as submitted here, and once with additional
      logic to force medium code model as the default.  The tests all compile
      cleanly, with one exception.  The mandel-2 application test fails due to an
      unrelated ABI compatibility with passing complex numbers.  It just so happens
      that small code model was incredibly lucky, in that temporary values in 
      floating-point registers held the expected values needed by the external
      library routine that was called incorrectly.  My current thought is to correct
      the ABI problems with _Complex before making medium code model the default,
      to avoid introducing this "regression."
      
      Here are a few comments on how the patch works, since the selection code
      can be difficult to follow:
      
      The existing logic for small code model defines three pseudo-instructions:
      LDtoc for most uses, LDtocJTI for jump table addresses, and LDtocCPT for
      constant pool addresses.  These are expanded by SelectCodeCommon().  The
      pseudo-instruction approach doesn't work for medium code model, because
      we need to generate two instructions when we match the same pattern.
      Instead, new logic in PPCDAGToDAGISel::Select() intercepts the TOC_ENTRY
      node for medium code model, and generates an ADDIStocHA followed by either
      a LDtocL or an ADDItocL.  These new node types correspond naturally to
      the sequences described above.
      
      The addis/ld sequence is generated for the following cases:
       * Jump table addresses
       * Function addresses
       * External global variables
       * Tentative definitions of global variables (common linkage)
      
      The addis/addi sequence is generated for the following cases:
       * Constant pool entries
       * File-scope static global variables
       * Function-scope static variables
      
      Expanding to the two-instruction sequences at select time exposes the
      instructions to subsequent optimization, particularly scheduling.
      
      The rest of the processing occurs at assembly time, in
      PPCAsmPrinter::EmitInstruction.  Each of the instructions is converted to
      a "real" PowerPC instruction.  When a TOC entry needs to be created, this
      is done here in the same manner as for the existing LDtoc, LDtocJTI, and
      LDtocCPT pseudo-instructions (I factored out a new routine to handle this).
      
      I had originally thought that if a TOC entry was needed for LDtocL or
      ADDItocL, it would already have been generated for the previous ADDIStocHA.
      However, at higher optimization levels, the ADDIStocHA may appear in a 
      different block, which may be assembled textually following the block
      containing the LDtocL or ADDItocL.  So it is necessary to include the
      possibility of creating a new TOC entry for those two instructions.
      
      Note that for LDtocL, we generate a new form of LD called LDrs.  This
      allows specifying the @toc@l relocation for the offset field of the LD
      instruction (i.e., the offset is replaced by a SymbolLo relocation).
      When the peephole optimization described above is added, we will need
      to do similar things for all immediate-form load and store operations.
      
      The seven "mcm-n.ll" test cases are kept separate because otherwise the
      intermingling of various TOC entries and so forth makes the tests fragile
      and hard to understand.
      
      The above assumes use of an external assembler.  For use of the
      integrated assembler, new relocations are added and used by
      PPCELFObjectWriter.  Testing is done with "mcm-obj.ll", which tests for
      proper generation of the various relocations for the same sequences
      tested with the external assembler.
      
      llvm-svn: 168708
      34627e34
  22. Nov 26, 2012
  23. Nov 24, 2012
  24. Nov 12, 2012
  25. Nov 05, 2012
    • Hal Finkel's avatar
      Add support for the PowerPC-specific inline asm Z constraint and y modifier. · 4f24c621
      Hal Finkel authored
      The Z constraint specifies an r+r memory address, and the y modifier expands
      to the "r, r" in the asm string. For this initial implementation, the base
      register is forced to r0 (which has the special meaning of 0 for r+r addressing
      on PowerPC) and the full address is taken in the second register. In the
      future, this should be improved.
      
      llvm-svn: 167388
      4f24c621
  26. Nov 01, 2012
    • Chandler Carruth's avatar
      Revert the majority of the next patch in the address space series: · 5da3f051
      Chandler Carruth authored
      r165941: Resubmit the changes to llvm core to update the functions to
               support different pointer sizes on a per address space basis.
      
      Despite this commit log, this change primarily changed stuff outside of
      VMCore, and those changes do not carry any tests for correctness (or
      even plausibility), and we have consistently found questionable or flat
      out incorrect cases in these changes. Most of them are probably correct,
      but we need to devise a system that makes it more clear when we have
      handled the address space concerns correctly, and ideally each pass that
      gets updated would receive an accompanying test case that exercises that
      pass specificaly w.r.t. alternate address spaces.
      
      However, from this commit, I have retained the new C API entry points.
      Those were an orthogonal change that probably should have been split
      apart, but they seem entirely good.
      
      In several places the changes were very obvious cleanups with no actual
      multiple address space code added; these I have not reverted when
      I spotted them.
      
      In a few other places there were merge conflicts due to a cleaner
      solution being implemented later, often not using address spaces at all.
      In those cases, I've preserved the new code which isn't address space
      dependent.
      
      This is part of my ongoing effort to clean out the partial address space
      code which carries high risk and low test coverage, and not likely to be
      finished before the 3.2 release looms closer. Duncan and I would both
      like to see the above issues addressed before we return to these
      changes.
      
      llvm-svn: 167222
      5da3f051
  27. Oct 25, 2012
    • Adhemerval Zanella's avatar
      Initial TOC support for PowerPC64 object creation · f2aceda8
      Adhemerval Zanella authored
      This patch adds initial PPC64 TOC MC object creation using the small mcmodel
      (a single 64K TOC) adding the some TOC relocations (R_PPC64_TOC,
      R_PPC64_TOC16, and R_PPC64_TOC16DS).
      
      The addition of 'undefinedExplicitRelSym' hook on 'MCELFObjectTargetWriter'
      is meant to avoid the creation of an unreferenced ".TOC." symbol (used in
      the .odp creation) as well to set the R_PPC64_TOC relocation target as the
      temporary ".TOC." symbol. On PPC64 ABI, the R_PPC64_TOC relocation should
      not point to any symbol.
      
      llvm-svn: 166677
      f2aceda8
  28. Oct 15, 2012
  29. Oct 11, 2012
  30. Oct 08, 2012
  31. Sep 18, 2012
Loading