Skip to content
  1. Mar 22, 2013
  2. Mar 21, 2013
    • Jack Carter's avatar
      This patch enables the Mips .set directive to define aliases · d76b2376
      Jack Carter authored
      The .set directive in the Mips the assembler can be 
      used to set the value of a symbol to an expression. 
      This changes the symbol's value and type to conform 
      to the expression's.
      
      Syntax: .set symbol, expression
      
      This patch implements the parsing of the above syntax 
      and enables the parser to use defined symbols when 
      parsing operands.
      
      Contributor: Vladimir Medic
      llvm-svn: 177667
      d76b2376
    • Hal Finkel's avatar
      Implement builtin_{setjmp/longjmp} on PPC · 756810fe
      Hal Finkel authored
      This implements SJLJ lowering on PPC, making the Clang functions
      __builtin_{setjmp/longjmp} functional on PPC platforms. The implementation
      strategy is similar to that on X86, with the exception that a branch-and-link
      variant is used to get the right jump address. Credit goes to Bill Schmidt for
      suggesting the use of the unconditional bcl form (instead of the regular bl
      instruction) to limit return-address-cache pollution.
      
      Benchmarking the speed at -O3 of:
      
      static jmp_buf env_sigill;
      
      void foo() {
                      __builtin_longjmp(env_sigill,1);
      }
      
      main() {
      	...
      
              for (int i = 0; i < c; ++i) {
                      if (__builtin_setjmp(env_sigill)) {
                              goto done;
                      } else {
                              foo();
                      }
      
      done:;
              }
      
      	...
      }
      
      vs. the same code using the libc setjmp/longjmp functions on a P7 shows that
      this builtin implementation is ~4x faster with Altivec enabled and ~7.25x
      faster with Altivec disabled. This comparison is somewhat unfair because the
      libc version must also save/restore the VSX registers which we don't yet
      support.
      
      llvm-svn: 177666
      756810fe
    • Hal Finkel's avatar
      Add support for spilling VRSAVE on PPC · a1431df5
      Hal Finkel authored
      Although there is only one Altivec VRSAVE register, it is a member of
      a register class, and we need the ability to spill it. Because this
      register is normally callee-preserved and handled by special code this
      has never before been necessary. However, this capability will be required by
      a forthcoming commit adding SjLj support.
      
      llvm-svn: 177654
      a1431df5
    • Hal Finkel's avatar
      Correct PPC FRAMEADDR lowering using a pseudo-register · aa03c03a
      Hal Finkel authored
      The old code used to lower FRAMEADDR tried to replicate the logic in the real
      frame-lowering code that determines whether or not the frame pointer (r31) will
      be used. When it seemed as through the frame pointer would not be used, the
      stack pointer (r1) was used instead. Unfortunately, because the stack size is
      not yet known, this does not work. Instead, this change introduces new
      always-reserved pseudo-registers (FP and FP8) that are replaced during prologue
      insertion with the real frame-pointer register (either r1 or r31).
      
      It is important that this intrinsic always return a valid frame address because
      it is used by Clang to store the frame address as part of code generation for
      __builtin_setjmp.
      
      llvm-svn: 177653
      aa03c03a
    • Renato Golin's avatar
      Avoid NEON SP-FP unless unsafe-math or Darwin · b4dd6c59
      Renato Golin authored
      NEON is not IEEE 754 compliant, so we should avoid lowering single-precision
      floating point operations with NEON unless unsafe-math is turned on. The
      equivalent VFP instructions are IEEE 754 compliant, but in some cores they're
      much slower, so some archs/OSs might still request it to be on by default,
      such as Swift and Darwin.
      
      llvm-svn: 177651
      b4dd6c59
    • Jakob Stoklund Olesen's avatar
      Add a WriteMicrocoded for ancient microcoded instructions. · 5891cf97
      Jakob Stoklund Olesen authored
      llvm-svn: 177611
      5891cf97
    • Jakob Stoklund Olesen's avatar
      Model prefetches and barriers as loads. · 712f6748
      Jakob Stoklund Olesen authored
      It's not yet clear if these instructions need a more careful model.
      
      llvm-svn: 177599
      712f6748
    • Jakob Stoklund Olesen's avatar
      Add a catch-all WriteSystem SchedWrite type. · 5b535c96
      Jakob Stoklund Olesen authored
      This is used for all the expensive system instructions.
      
      llvm-svn: 177598
      5b535c96
  3. Mar 20, 2013
  4. Mar 19, 2013
    • Chad Rosier's avatar
      [ms-inline asm] Move the immediate asm rewrite into the target specific · f3c04f6a
      Chad Rosier authored
      logic as a QOI cleanup.  No functional change.  Tests already in place.
      rdar://13456414
      
      llvm-svn: 177446
      f3c04f6a
    • Jakob Stoklund Olesen's avatar
      Annotate X86InstrCompiler.td with SchedRW lists. · 9bd6b8bd
      Jakob Stoklund Olesen authored
      Add a new WriteZero SchedWrite type for the common dependency-breaking
      instructions that clear a register.
      
      llvm-svn: 177442
      9bd6b8bd
    • Chad Rosier's avatar
      [ms-inline asm] Create a helper function, CreateMemForInlineAsm, that creates · 7ca135b2
      Chad Rosier authored
      an X86Operand, but also performs a Sema lookup and adds the sizing directive
      when appropriate.  Use this when parsing a bracketed statement.  This is
      necessary to get the instruction matching correct as well.  Test case coming
      on clang side.
      rdar://13455408
      
      llvm-svn: 177439
      7ca135b2
    • Ulrich Weigand's avatar
      Add missing mayLoad flag to LHAUX8 and LWAUX. · 01dd4c1a
      Ulrich Weigand authored
      All pre-increment load patterns need to set the mayLoad flag (since
      they don't provide a DAG pattern).
      
      This was missing for LHAUX8 and LWAUX, which is added by this patch.
      
      llvm-svn: 177431
      01dd4c1a
    • Ulrich Weigand's avatar
      Rewrite LHAU8 pattern to use standard memory operand. · f8030096
      Ulrich Weigand authored
      As opposed to to pre-increment store patterns, the pre-increment
      load patterns were already using standard memory operands, with
      the sole exception of LHAU8.
      
      As there's no real reason why LHAU8 should be different here,
      this patch simply rewrites the pattern to also use a memri
      operand, just like all the other patterns.
      
      llvm-svn: 177430
      f8030096
    • Ulrich Weigand's avatar
      Rewrite pre-increment store patterns to use standard memory operands. · d850167a
      Ulrich Weigand authored
      Currently, pre-increment store patterns are written to use two separate
      operands to represent address base and displacement:
      
        stwu $rS, $ptroff($ptrreg)
      
      This causes problems when implementing the assembler parser, so this
      commit changes the patterns to use standard (complex) memory operands
      like in all other memory access instruction patterns:
      
        stwu $rS, $dst
      
      To still match those instructions against the appropriate pre_store
      SelectionDAG nodes, the patch uses the new feature that allows a Pat
      to match multiple DAG operands against a single (complex) instruction
      operand.
      
      Approved by Hal Finkel.
      
      llvm-svn: 177429
      d850167a
    • Ulrich Weigand's avatar
      Fix sub-operand size mismatch in tocentry operands. · fd24544f
      Ulrich Weigand authored
      The tocentry operand class refers to 64-bit values (it is only used in 64-bit,
      where iPTR is a 64-bit type), but its sole suboperand is designated as 32-bit
      type.  This causes a mismatch to be detected at compile-time with the TableGen
      patch I'll check in shortly.
      
      To fix this, this commit changes the suboperand to a 64-bit type as well.
      
      llvm-svn: 177427
      fd24544f
    • Ulrich Weigand's avatar
      Remove an invalid and unnecessary Pat pattern from the X86 backend: · 80d9ad39
      Ulrich Weigand authored
        def : Pat<(load (i64 (X86Wrapper tglobaltlsaddr :$dst))),
                  (MOV64rm tglobaltlsaddr :$dst)>;
      
      This pattern is invalid because the MOV64rm instruction expects a
      source operand of type "i64mem", which is a subclass of X86MemOperand
      and thus actually consists of five MI operands, but the Pat provides
      only a single MI operand ("tglobaltlsaddr" matches an SDnode of
      type ISD::TargetGlobalTLSAddress and provides a single output).
      
      Thus, if the pattern were ever matched, subsequent uses of the MOV64rm
      instruction pattern would access uninitialized memory.  In addition,
      with the TableGen patch I'm about to check in, this would actually be
      reported as a build-time error.
      
      Fortunately, the pattern does in fact never match, for at least two
      independent reasons.
      
      First, the code generator actually never generates a pattern of the
      form (load (X86Wrapper (tglobaltlsaddr))).  For most combinations of
      TLS and code models, (tglobaltlsaddr) represents just an offset that
      needs to be added to some base register, so it is never directly
      dereferenced.  The only exception is the initial-exec model, where
      (tglobaltlsaddr) refers to the (pc-relative) address of a GOT slot,
      which *is* in fact directly dereferenced: but in that case, the
      X86WrapperRIP node is used, not X86Wrapper, so the Pat doesn't match.
      
      Second, even if some patterns along those lines *were* ever generated,
      we should not need an extra Pat pattern to match it.  Instead, the
      original MOV64rm instruction pattern ought to match directly, since
      it uses an "addr" operand, which is implemented via the SelectAddr
      C++ routine; this routine is supposed to accept the full range of
      input DAGs that may be implemented by a single mov instruction,
      including those cases involving ISD::TargetGlobalTLSAddress (and
      actually does so e.g. in the initial-exec case as above).
      
      To avoid build breaks (due to the above-mentioned error) after the
      TableGen patch is checked in, I'm removing this Pat here.
      
      llvm-svn: 177426
      80d9ad39
    • Hal Finkel's avatar
      Prepare to make r0 an allocatable register on PPC · 638a9fa4
      Hal Finkel authored
      Currently the PPC r0 register is unconditionally reserved. There are two reasons
      for this:
      
       1. r0 is treated specially (as the constant 0) by certain instructions, and so
          cannot be used with those instructions as a regular register.
      
       2. r0 is used as a temporary register in the CR-register spilling process
          (where, under some circumstances, we require two GPRs).
      
      This change addresses the first reason by introducing a restricted register
      class (without r0) for use by those instructions that treat r0 specially. These
      register classes have a new pseudo-register, ZERO, which represents the r0-as-0
      use. This has the side benefit of making the existing target code simpler (and
      easier to understand), and will make it clear to the register allocator that
      uses of r0 as 0 don't conflict will real uses of the r0 register.
      
      Once the CR spilling code is improved, we'll be able to allocate r0.
      
      Adding these extra register classes, for some reason unclear to me, causes
      requests to the target to copy 32-bit registers to 64-bit registers. The
      resulting code seems correct (and causes no test-suite failures), and the new
      test case covers this new kind of asymmetric copy.
      
      As r0 is still reserved, no functionality change intended.
      
      llvm-svn: 177423
      638a9fa4
    • Nadav Rotem's avatar
      Optimize sext <4 x i8> and <4 x i16> to <4 x i64>. · 0f1bc60d
      Nadav Rotem authored
      Patch by Ahmad, Muhammad T <muhammad.t.ahmad@intel.com>
      
      llvm-svn: 177421
      0f1bc60d
    • Jakob Stoklund Olesen's avatar
      Annotate X86InstrExtension.td with SchedRW lists. · af39940b
      Jakob Stoklund Olesen authored
      llvm-svn: 177418
      af39940b
    • Jakob Stoklund Olesen's avatar
      Annotate a lot of X86InstrInfo.td with SchedRW lists. · caf3d89f
      Jakob Stoklund Olesen authored
      llvm-svn: 177417
      caf3d89f
    • Chad Rosier's avatar
      [ms-inline asm] Move the size directive asm rewrite into the target specific · 120eefd1
      Chad Rosier authored
      logic as a QOI cleanup.
      rdar://13445327
      
      llvm-svn: 177413
      120eefd1
    • Hal Finkel's avatar
      Cleanup PPC64 unaligned i64 load/store · 66814863
      Hal Finkel authored
      Remove an accidentally-added instruction definition and add a comment in the
      test case. This is in response to a post-commit review by Bill Schmidt.
      
      No functionality change intended.
      
      llvm-svn: 177404
      66814863
    • Renato Golin's avatar
      Improve long vector sext/zext lowering on ARM · 227eb6fc
      Renato Golin authored
      The ARM backend currently has poor codegen for long sext/zext
      operations, such as v8i8 -> v8i32. This patch addresses this
      by performing a custom expansion in ARMISelLowering. It also
      adds/changes the cost of such lowering in ARMTTI.
      
      This partially addresses PR14867.
      
      Patch by Pete Couperus
      
      llvm-svn: 177380
      227eb6fc
Loading