- Sep 01, 2010
-
-
Chris Lattner authored
the testcases should be merged. llvm-svn: 112711
-
Bill Wendling authored
int x(int t) { if (t & 256) return -26; return 0; } We generate this: tst.w r0, #256 mvn r0, #25 it eq moveq r0, #0 while gcc generates this: ands r0, r0, #256 it ne mvnne r0, #25 bx lr Scandalous really! During ISel time, we can look for this particular pattern. One where we have a "MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND instruction to 0. Something like this (greatly simplified): %r0 = ISD::AND ... ARMISD::CMPZ %r0, 0 @ sets [CPSR] %r0 = ARMISD::MOVCC 0, -26 @ reads [CPSR] All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR] when it's zero. The zero value will all ready be in the %r0 register and we only need to change it if the AND wasn't zero. Easy! llvm-svn: 112664
-
- Aug 31, 2010
-
-
Bill Wendling authored
is meant to do exactly the same thing. Thanks to Jim Grosbach for pointing this out! :-) llvm-svn: 112538
-
- Aug 30, 2010
-
-
Jim Grosbach authored
Make ARM add rN, sp, #imm instructions rematerializable. That's how the address of locals is calculated, so this should help relieve register pressure a bit. Recalculating the local address is almost always going to be better than spilling. llvm-svn: 112503
-
Bill Wendling authored
optional modified register (instead of reg0). Along with r112461 it will make sure that the optional define of CPSR is marked as "def" and will thus mark the instructions using these classes (t2ANDS*) as setting the 's' flag. llvm-svn: 112462
-
- Aug 29, 2010
-
-
Bill Wendling authored
- Create T2I_bin_sw_irs to be like T2I_bin_w_irs, but that it sets the S bit. llvm-svn: 112399
-
Bill Wendling authored
llvm-svn: 112395
-
Bill Wendling authored
it sets the CPSR register. llvm-svn: 112393
-
- Aug 26, 2010
-
-
Jim Grosbach authored
encodable as a 16-bit wide instruction. llvm-svn: 112195
-
Dan Gohman authored
llvm-svn: 112191
-
Bill Wendling authored
comparison with 0. These two pieces of code should give identical results: rsbs r1, r1, 0 cmp r0, r1 mov r0, #0 it ls mov r0, #1 and: cmn r0, r1 mov r0, #0 it ls mov r0, #1 However, the CMN gives the *opposite* result when r1 is 0. This is because the carry flag is set in the CMP case but not in the CMN case. In short, the CMP instruction doesn't perform a truncate of the (logical) NOT of 0 plus the value of r0 and the carry bit (because the "carry bit" parameter to AddWithCarry is defined as 1 in this case, the carry flag will always be set when r0 >= 0). The CMN instruction doesn't perform a NOT of 0 so there is never a "carry" when this AddWithCarry is performed (because the "carry bit" parameter to AddWithCarry is defined as 0). The AddWithCarry in the CMP case seems to be relying upon the identity: ~x + 1 = -x However when x is 0 and unsigned, this doesn't hold: x = 0 ~x = 0xFFFF FFFF ~x + 1 = 0x1 0000 0000 (-x = 0) != (0x1 0000 0000 = ~x + 1) Therefore, we should disable *all* versions of CMN, especially when comparing against zero, until we can limit when the CMN instruction is used (when we know that the RHS is not 0) or when we have a hardware fix for this. (See the ARM docs for the "AddWithCarry" pseudo-code.) This is related to <rdar://problem/7569620>. llvm-svn: 112176
-
- Aug 19, 2010
-
-
Bill Wendling authored
llvm-svn: 111481
-
- Aug 17, 2010
-
-
Jakob Stoklund Olesen authored
llvm-svn: 111277
-
Jim Grosbach authored
llvm-svn: 111266
-
Bob Wilson authored
printing "lsl #0". This fixes the remaining parts of pr7792. Make corresponding changes for encoding/decoding these instructions. llvm-svn: 111251
-
Bob Wilson authored
that the high halfword is zero. The shift need not be exactly 16 bits. llvm-svn: 111196
-
- Aug 16, 2010
-
-
Bob Wilson authored
instructions besides saturate instructions. No functional changes. llvm-svn: 111168
-
- Aug 14, 2010
-
-
Bob Wilson authored
llvm-svn: 111068
-
Bob Wilson authored
This fixes another part of PR7792. llvm-svn: 111057
-
- Aug 13, 2010
-
-
Bob Wilson authored
instruction opcode. This fixes part of PR7792. llvm-svn: 111047
-
- Aug 11, 2010
-
-
Evan Cheng authored
llvm-svn: 110787
-
Evan Cheng authored
memory and synchronization barrier dmb and dsb instructions. - Change instruction names to something more sensible (matching name of actual instructions). - Added tests for memory barrier codegen. llvm-svn: 110785
-
Daniel Dunbar authored
llvm-svn: 110780
-
Evan Cheng authored
llvm-svn: 110745
-
- Aug 10, 2010
-
-
Evan Cheng authored
llvm-svn: 110710
-
- Aug 08, 2010
-
-
Bill Wendling authored
relatively expensive comparison analyzer on each instruction. Also rename the comparison analyzer method to something more in line with what it actually does. This pass is will eventually be folded into the Machine CSE pass. llvm-svn: 110539
-
- Jul 31, 2010
-
-
Bob Wilson authored
the jtblock_operand print methods. This avoids extra newlines in the disassembler's output. PR7757. llvm-svn: 109948
-
- Jul 30, 2010
-
-
Jim Grosbach authored
have 4 bits per register in the operand encoding), but have undefined behavior when the operand value is 13 or 15 (SP and PC, respectively). The trivial coalescer in linear scan sometimes will merge a copy from SP into a subsequent instruction which uses the copy, and if that instruction cannot legally reference SP, we get bad code such as: mls r0,r9,r0,sp instead of: mov r2, sp mls r0, r9, r0, r2 This patch adds a new register class for use by Thumb2 that excludes the problematic registers (SP and PC) and is used instead of GPR for those operands which cannot legally reference PC or SP. The trivial coalescer explicitly requires that the register class of the destination for the COPY instruction contain the source register for the COPY to be considered for coalescing. This prevents errant instructions like that above. PR7499 llvm-svn: 109842
-
Nate Begeman authored
llvm-svn: 109813
-
- Jul 29, 2010
-
-
Nate Begeman authored
Add intrinsics __builtin_arm_qadd & __builtin_arm_qsub to allow access to the QADD & QSUB instructions. Behave identically to __qadd & __qsub RealView instruction intrinsics. llvm-svn: 109770
-
Jim Grosbach authored
Remove incorrect substitution pattern for UXTB16. It wrongly assumed the input shift was actually a rotate. rdar://8240138 llvm-svn: 109693
-
- Jul 20, 2010
-
-
Jim Grosbach authored
instruction selection to prefer it when possible. rdar://7903972 llvm-svn: 108844
-
- Jul 17, 2010
-
-
Jim Grosbach authored
and a combine pattern to use it for setting a bit-field to a constant value. More to come for non-constant stores. llvm-svn: 108570
-
- Jul 14, 2010
-
-
Jim Grosbach authored
in the literal field of an instruction. E.g., long long foo(long long a) { return a - 734439407618LL; } rdar://7038284 llvm-svn: 108339
-
Bob Wilson authored
Patch by Brian Lucas. PR7636. llvm-svn: 108332
-
- Jun 29, 2010
-
-
Evan Cheng authored
llvm-svn: 107122
-
- Jun 24, 2010
-
-
Eli Friedman authored
llvm-svn: 106770
-
- Jun 21, 2010
-
-
Jim Grosbach authored
being moved around away from the jump table it references. rdar://8104340 llvm-svn: 106483
-
- Jun 19, 2010
-
-
Evan Cheng authored
- This fixed a number of bugs in if-converter, tail merging, and post-allocation scheduler. If-converter now runs branch folding / tail merging first to maximize if-conversion opportunities. - Also changed the t2IT instruction slightly. It now defines the ITSTATE register which is read by instructions in the IT block. - Added Thumb2 specific hazard recognizer to ensure the scheduler doesn't change the instruction ordering in the IT block (since IT mask has been finalized). It also ensures no other instructions can be scheduled between instructions in the IT block. This is not yet enabled. llvm-svn: 106344
-
- Jun 02, 2010
-
-
Jim Grosbach authored
llvm-svn: 105350
-