Skip to content
  1. Sep 21, 2006
  2. Sep 20, 2006
    • Andrew Lenharth's avatar
      Account for pseudo-ops correctly · ccdaecc4
      Andrew Lenharth authored
      llvm-svn: 30548
      ccdaecc4
    • Chris Lattner's avatar
      The DarwinAsmPrinter need not check for isDarwin. createPPCAsmPrinterPass · a81a75c3
      Chris Lattner authored
      should create the right asmprinter subclass.
      
      llvm-svn: 30542
      a81a75c3
    • Chris Lattner's avatar
      Wrap some darwin'isms with isDarwin checks. · 8597a2fc
      Chris Lattner authored
      llvm-svn: 30541
      8597a2fc
    • Nick Lewycky's avatar
      Use a total ordering to compare instructions. · cfff1c3f
      Nick Lewycky authored
      Fixes infinite loop in resolve().
      
      llvm-svn: 30540
      cfff1c3f
    • Andrew Lenharth's avatar
      simplify · 44cb67af
      Andrew Lenharth authored
      llvm-svn: 30535
      44cb67af
    • Andrew Lenharth's avatar
      catch constants more often · f007f21c
      Andrew Lenharth authored
      llvm-svn: 30534
      f007f21c
    • Andrew Lenharth's avatar
      catch another constant · b04e899b
      Andrew Lenharth authored
      llvm-svn: 30533
      b04e899b
    • Andrew Lenharth's avatar
      clarify with test case · 97a4e99a
      Andrew Lenharth authored
      llvm-svn: 30531
      97a4e99a
    • Andrew Lenharth's avatar
      Add Note · e2d138a4
      Andrew Lenharth authored
      llvm-svn: 30530
      e2d138a4
    • Jim Laskey's avatar
      Trim the home directory from the dejagnu test · fbeab727
      Jim Laskey authored
      llvm-svn: 30519
      fbeab727
    • Chris Lattner's avatar
      item done · fba9e8f4
      Chris Lattner authored
      llvm-svn: 30518
      fba9e8f4
    • Chris Lattner's avatar
      Compile: · c8cd62d3
      Chris Lattner authored
      int test3(int a, int b) { return (a < 0) ? a : 0; }
      
      to:
      
      _test3:
              srawi r2, r3, 31
              and r3, r2, r3
              blr
      
      instead of:
      
      _test3:
              cmpwi cr0, r3, 1
              li r2, 0
              blt cr0, LBB2_2 ;entry
      LBB2_1: ;entry
              mr r3, r2
      LBB2_2: ;entry
              blr
      
      
      This implements: PowerPC/select_lt0.ll:seli32_a_a
      
      llvm-svn: 30517
      c8cd62d3
    • Chris Lattner's avatar
      new testcase · 2b09e1d2
      Chris Lattner authored
      llvm-svn: 30516
      2b09e1d2
    • Chris Lattner's avatar
      add a note · 27d8985a
      Chris Lattner authored
      llvm-svn: 30515
      27d8985a
    • Chris Lattner's avatar
      Fold the full generality of (any_extend (truncate x)) · 8746e2cd
      Chris Lattner authored
      llvm-svn: 30514
      8746e2cd
    • Chris Lattner's avatar
      Two things: · 8b68decb
      Chris Lattner authored
      1. teach SimplifySetCC that '(srl (ctlz x), 5) == 0' is really x != 0.
      2. Teach visitSELECT_CC to use SimplifySetCC instead of calling it and
         ignoring the result.  This allows us to compile:
      
      bool %test(ulong %x) {
        %tmp = setlt ulong %x, 4294967296
        ret bool %tmp
      }
      
      to:
      
      _test:
              cntlzw r2, r3
              cmplwi cr0, r3, 1
              srwi r2, r2, 5
              li r3, 0
              beq cr0, LBB1_2 ;
      LBB1_1: ;
              mr r3, r2
      LBB1_2: ;
              blr
      
      instead of:
      
      _test:
              addi r2, r3, -1
              cntlzw r2, r2
              cntlzw r3, r3
              srwi r2, r2, 5
              cmplwi cr0, r2, 0
              srwi r2, r3, 5
              li r3, 0
              bne cr0, LBB1_2 ;
      LBB1_1: ;
              mr r3, r2
      LBB1_2: ;
              blr
      
      This isn't wonderful, but it's an improvement.
      
      llvm-svn: 30513
      8b68decb
    • Chris Lattner's avatar
      This is already done · f62f090e
      Chris Lattner authored
      llvm-svn: 30512
      f62f090e
    • Chris Lattner's avatar
      We went through all that trouble to compute whether it was safe to transform · 380c7e9a
      Chris Lattner authored
      this comparison, but never checked it.  Whoops, no wonder we miscompiled
      177.mesa!
      
      llvm-svn: 30511
      380c7e9a
    • Chris Lattner's avatar
      Improve PPC64 equality comparisons like PPC32 comparisons. · da9b1a93
      Chris Lattner authored
      llvm-svn: 30510
      da9b1a93
    • Chris Lattner's avatar
      Two improvements: · aa3926b7
      Chris Lattner authored
      1. Codegen this comparison:
           if (X == 0x8000)
      
      as:
      
              cmplwi cr0, r3, 32768
              bne cr0, LBB1_2 ;cond_next
      
      instead of:
      
              lis r2, 0
              ori r2, r2, 32768
              cmpw cr0, r3, r2
              bne cr0, LBB1_2 ;cond_next
      
      
      2. Codegen this comparison:
            if (X == 0x12345678)
      
      as:
      
              xoris r2, r3, 4660
              cmplwi cr0, r2, 22136
              bne cr0, LBB1_2 ;cond_next
      
      instead of:
      
              lis r2, 4660
              ori r2, r2, 22136
              cmpw cr0, r3, r2
              bne cr0, LBB1_2 ;cond_next
      
      llvm-svn: 30509
      aa3926b7
    • Chris Lattner's avatar
      Add a note that we should match rlwnm better · ab33d350
      Chris Lattner authored
      llvm-svn: 30508
      ab33d350
    • Chris Lattner's avatar
      Legalize is no longer limited to cleverness with just constant shift amounts. · 601b8651
      Chris Lattner authored
      Allow it to be clever when possible and fall back to the gross code when needed.
      
      This allows us to compile:
      
      long long foo1(long long X, int C) {
        return X << (C|32);
      }
      long long foo2(long long X, int C) {
        return X << (C&~32);
      }
      
      to:
      _foo1:
              rlwinm r2, r5, 0, 27, 31
              slw r3, r4, r2
              li r4, 0
              blr
      
      
              .globl  _foo2
              .align  4
      _foo2:
              rlwinm r2, r5, 0, 27, 25
              subfic r5, r2, 32
              slw r3, r3, r2
              srw r5, r4, r5
              or r3, r3, r5
              slw r4, r4, r2
              blr
      
      instead of:
      
      _foo1:
              ori r2, r5, 32
              subfic r5, r2, 32
              addi r6, r2, -32
              srw r5, r4, r5
              slw r3, r3, r2
              slw r6, r4, r6
              or r3, r3, r5
              slw r4, r4, r2
              or r3, r3, r6
              blr
      
      
              .globl  _foo2
              .align  4
      _foo2:
              rlwinm r2, r5, 0, 27, 25
              subfic r5, r2, 32
              addi r6, r2, -32
              srw r5, r4, r5
              slw r3, r3, r2
              slw r6, r4, r6
              or r3, r3, r5
              slw r4, r4, r2
              or r3, r3, r6
              blr
      
      llvm-svn: 30507
      601b8651
    • Chris Lattner's avatar
      Expand 64-bit shifts more optimally if we know that the high bit of the · 875ea0cd
      Chris Lattner authored
      shift amount is one or zero.  For example, for:
      
      long long foo1(long long X, int C) {
        return X << (C|32);
      }
      
      long long foo2(long long X, int C) {
        return X << (C&~32);
      }
      
      we get:
      
      _foo1:
              movb $31, %cl
              movl 4(%esp), %edx
              andb 12(%esp), %cl
              shll %cl, %edx
              xorl %eax, %eax
              ret
      _foo2:
              movb $223, %cl
              movl 4(%esp), %eax
              movl 8(%esp), %edx
              andb 12(%esp), %cl
              shldl %cl, %eax, %edx
              shll %cl, %eax
              ret
      
      instead of:
      
      _foo1:
              subl $4, %esp
              movl %ebx, (%esp)
              movb $32, %bl
              movl 8(%esp), %eax
              movl 12(%esp), %edx
              movb %bl, %cl
              orb 16(%esp), %cl
              shldl %cl, %eax, %edx
              shll %cl, %eax
              xorl %ecx, %ecx
              testb %bl, %bl
              cmovne %eax, %edx
              cmovne %ecx, %eax
              movl (%esp), %ebx
              addl $4, %esp
              ret
      _foo2:
              subl $4, %esp
              movl %ebx, (%esp)
              movb $223, %cl
              movl 8(%esp), %eax
              movl 12(%esp), %edx
              andb 16(%esp), %cl
              shldl %cl, %eax, %edx
              shll %cl, %eax
              xorl %ecx, %ecx
              xorb %bl, %bl
              testb %bl, %bl
              cmovne %eax, %edx
              cmovne %ecx, %eax
              movl (%esp), %ebx
              addl $4, %esp
              ret
      
      llvm-svn: 30506
      875ea0cd
Loading