Skip to content
  1. Jul 13, 2013
  2. Jul 12, 2013
  3. Jul 11, 2013
    • Hal Finkel's avatar
      PPC: Add some missing V_SET0 patterns · 47150817
      Hal Finkel authored
      We had patterns to match v4i32 immAllZerosV -> V_SET0, but not patterns for
      v8i16 (which occurs in the test case) or v16i8. The same was true for
      V_SETALLONES (so I added the associated patterns for those as well).
      
      Another bug found by llvm-stress.
      
      llvm-svn: 186108
      47150817
    • Hal Finkel's avatar
      PPCDAGToDAGISel::isRunOfOnes should return false on zero · ff3ea806
      Hal Finkel authored
      This fixes a bug (found by csmith) at -O0 where we attempt to create a RLWIMI
      with an out-of-range operand. Most uses of the isRunOfOnes function are guarded
      by a condition that the value is not zero. This was not true in two places, and
      in both places a zero input would result in an out-of-rage MB value (= 32).
      
      To fix this, isRunOfOnes returns false on a zero input (and I've remove one
      now-redundant guard).
      
      llvm-svn: 186101
      ff3ea806
    • Richard Sandiford's avatar
      [SystemZ] Use zeroing form of RISBG for shift-and-AND sequences · ea9b6aa2
      Richard Sandiford authored
      Extend r186072 to handle shifts and ANDs.
      
      llvm-svn: 186073
      ea9b6aa2
    • Richard Sandiford's avatar
      [SystemZ] Use zeroing form of RISBG for some AND sequences · 84f54a3b
      Richard Sandiford authored
      RISBG can handle some ANDs for which no AND IMMEDIATE exists.
      It also acts as a three-operand AND for some cases where an
      AND IMMEDIATE could be used instead.
      
      It might be worth adding a pass to replace RISBG with AND IMMEDIATE
      in cases where the register operands end up being the same and where
      AND IMMEDIATE is smaller.
      
      llvm-svn: 186072
      84f54a3b
    • Richard Sandiford's avatar
      [SystemZ] Allow 8-bit operands to RISBG · 67ddcd6d
      Richard Sandiford authored
      RISBG has three 8-bit operands (I3, I4 and I5).  I'd originally
      restricted all three to 6 bits, since that's the only range we intended
      to use at the time.  However, the top bit of I4 acts as a "zero" flag for
      RISBG, while the top bit of I3 acts as a "test" flag for RNSBG & co.
      This patch therefore allows them to have the full 8-bit range.
      I've left the fifth operand as a 6-bit value for now since the
      upper 2 bits have no defined meaning.
      
      llvm-svn: 186070
      67ddcd6d
  4. Jul 10, 2013
  5. Jul 09, 2013
    • Bill Schmidt's avatar
      [PowerPC] Better fix for PR16556. · 41221693
      Bill Schmidt authored
      A more complete example of the bug in PR16556 was recently provided,
      showing that the previous fix was not sufficient.  The previous fix is
      reverted herein.
      
      The real problem is that ReplaceNodeResults() uses LowerFP_TO_INT as
      custom lowering for FP_TO_SINT during type legalization, without
      checking whether the input type is handled by that routine.
      LowerFP_TO_INT requires the input to be f32 or f64, so we fail when
      the input is ppcf128.
      
      I'm leaving the test case from the initial fix (r185821) in place, and
      adding the new test as another crash-only check.
      
      llvm-svn: 185959
      41221693
    • Stephen Lin's avatar
      AArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all · 73de7bf5
      Stephen Lin authored
      in-tree implementations of TargetLoweringBase::isFMAFasterThanMulAndAdd in
      order to resolve the following issues with fmuladd (i.e. optional FMA)
      intrinsics:
      
      1. On X86(-64) targets, ISD::FMA nodes are formed when lowering fmuladd
      intrinsics even if the subtarget does not support FMA instructions, leading
      to laughably bad code generation in some situations.
      
      2. On AArch64 targets, ISD::FMA nodes are formed for operations on fp128,
      resulting in a call to a software fp128 FMA implementation.
      
      3. On PowerPC targets, FMAs are not generated from fmuladd intrinsics on types
      like v2f32, v8f32, v4f64, etc., even though they promote, split, scalarize,
      etc. to types that support hardware FMAs.
      
      The function has also been slightly renamed for consistency and to force a
      merge/build conflict for any out-of-tree target implementing it. To resolve,
      see comments and fixed in-tree examples.
      
      llvm-svn: 185956
      73de7bf5
    • Ulrich Weigand's avatar
      · 52cf8e44
      Ulrich Weigand authored
      [PowerPC] Revert r185476 and fix up TLS variant kinds
      
      In the commit message to r185476 I wrote:
      
      >The PowerPC-specific modifiers VK_PPC_TLSGD and VK_PPC_TLSLD
      >correspond exactly to the generic modifiers VK_TLSGD and VK_TLSLD.
      >This causes some confusion with the asm parser, since VK_PPC_TLSGD
      >is output as @tlsgd, which is then read back in as VK_TLSGD.
      >
      >To avoid this confusion, this patch removes the PowerPC-specific
      >modifiers and uses the generic modifiers throughout.  (The only
      >drawback is that the generic modifiers are printed in upper case
      >while the usual convention on PowerPC is to use lower-case modifiers.
      >But this is just a cosmetic issue.)
      
      This was unfortunately incorrect, there is is fact another,
      serious drawback to using the default VK_TLSLD/VK_TLSGD
      variant kinds: using these causes ELFObjectWriter::RelocNeedsGOT
      to return true, which in turn causes the ELFObjectWriter to emit
      an undefined reference to _GLOBAL_OFFSET_TABLE_.
      
      This is a problem on powerpc64, because it uses the TOC instead
      of the GOT, and the linker does not provide _GLOBAL_OFFSET_TABLE_,
      so the symbol remains undefined.  This means shared libraries
      using TLS built with the integrated assembler are currently
      broken.
      
      While the whole RelocNeedsGOT / _GLOBAL_OFFSET_TABLE_ situation
      probably ought to be properly fixed at some point, for now I'm
      simply reverting the r185476 commit.  Now this in turn exposes
      the breakage of handling @tlsgd/@tlsld in the asm parser that
      this check-in was originally intended to fix.
      
      To avoid this regression, I'm also adding a different fix for
      this problem: while common code now parses @tlsgd as VK_TLSGD,
      a special hack in the asm parser translates this code to the
      platform-specific VK_PPC_TLSGD that the back-end now expects.
      While this is not really pretty, it's self-contained and
      shouldn't hurt anything else for now.  One the underlying
      problem is fixed, this hack can be reverted again.
      
      llvm-svn: 185945
      52cf8e44
Loading