Skip to content
  1. Jan 19, 2005
    • Chris Lattner's avatar
      d54845f5
    • Chris Lattner's avatar
      Teach the code generator that shrd/shld is commutable if it has an immediate. · 29478017
      Chris Lattner authored
      This allows us to generate this:
      
      foo:
              mov %EAX, DWORD PTR [%ESP + 4]
              mov %EDX, DWORD PTR [%ESP + 8]
              shld %EDX, %EDX, 2
              shl %EAX, 2
              ret
      
      instead of this:
      
      foo:
              mov %EAX, DWORD PTR [%ESP + 4]
              mov %ECX, DWORD PTR [%ESP + 8]
              mov %EDX, %EAX
              shrd %EDX, %ECX, 30
              shl %EAX, 2
              ret
      
      Note the magically transmogrifying immediate.
      
      llvm-svn: 19686
      29478017
    • Chris Lattner's avatar
      Finegrainify namespacification · f6932b70
      Chris Lattner authored
      Add default impl of commuteInstruction
      Add notes about ugly V9 code.
      
      llvm-svn: 19684
      f6932b70
    • Chris Lattner's avatar
      Codegen long >> 2 to this: · 41fe201b
      Chris Lattner authored
      foo:
              mov %EAX, DWORD PTR [%ESP + 4]
              mov %EDX, DWORD PTR [%ESP + 8]
              shrd %EAX, %EDX, 2
              sar %EDX, 2
              ret
      
      instead of this:
      
      test1:
              mov %ECX, DWORD PTR [%ESP + 4]
              shr %ECX, 2
              mov %EDX, DWORD PTR [%ESP + 8]
              mov %EAX, %EDX
              shl %EAX, 30
              or %EAX, %ECX
              sar %EDX, 2
              ret
      
      and long << 2 to this:
      
      foo:
              mov %EAX, DWORD PTR [%ESP + 4]
              mov %ECX, DWORD PTR [%ESP + 8]
      ***     mov %EDX, %EAX
              shrd %EDX, %ECX, 30
              shl %EAX, 2
              ret
      
      instead of this:
      
      foo:
              mov %EAX, DWORD PTR [%ESP + 4]
              mov %ECX, %EAX
              shr %ECX, 30
              mov %EDX, DWORD PTR [%ESP + 8]
              shl %EDX, 2
              or %EDX, %ECX
              shl %EAX, 2
              ret
      
      The extra copy (marked ***) can be eliminated when I teach the code generator
      that shrd32rri8 is really commutative.
      
      llvm-svn: 19681
      41fe201b
    • Chris Lattner's avatar
      X86 shifts mask the amount. · d8d30660
      Chris Lattner authored
      llvm-svn: 19678
      d8d30660
    • Chris Lattner's avatar
      Add a hook to find out how the target handles shift amounts that are out of · a05cd83d
      Chris Lattner authored
      range.  Either they are undefined (the default), they mask the shift amount
      to the size of the register (X86, Alpha, etc), or they extend the shift (PPC).
      
      This defaults to undefined, which is conservatively correct.
      
      llvm-svn: 19677
      a05cd83d
  2. Jan 18, 2005
  3. Jan 17, 2005
  4. Jan 16, 2005
  5. Jan 15, 2005
Loading