1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-- -mattr=+slow-3ops-lea | FileCheck %s -check-prefixes=CHECK,X86,SLOW,SLOW-X86
3 ; RUN: llc < %s -mtriple=i686-- -mattr=-slow-3ops-lea | FileCheck %s -check-prefixes=CHECK,X86,FAST,FAST-X86
4 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+slow-3ops-lea | FileCheck %s -check-prefixes=CHECK,X64,SLOW,SLOW-X64
5 ; RUN: llc < %s -mtriple=x86_64-- -mattr=-slow-3ops-lea | FileCheck %s -check-prefixes=CHECK,X64,FAST,FAST-X64
7 ; )32-a)-b --> 32-(a+b) --> -(a+b)+32 --> -((a+b)-32) -> -(a+b+(-32))
9 define i32 @t0(i32 %a, i32 %b) {
12 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
13 ; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx
14 ; X86-NEXT: movl $32, %eax
15 ; X86-NEXT: subl %ecx, %eax
20 ; X64-NEXT: addl %esi, %edi
21 ; X64-NEXT: movl $32, %eax
22 ; X64-NEXT: subl %edi, %eax
28 define i32 @t1(i32 %a, i32 %b) {
31 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
32 ; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx
33 ; X86-NEXT: movl $32, %eax
34 ; X86-NEXT: subl %ecx, %eax
39 ; X64-NEXT: addl %esi, %edi
40 ; X64-NEXT: movl $32, %eax
41 ; X64-NEXT: subl %edi, %eax
47 define i32 @t2(i32 %a, i32 %b) {
50 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
51 ; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx
52 ; X86-NEXT: movl $32, %eax
53 ; X86-NEXT: subl %ecx, %eax
58 ; X64-NEXT: addl %esi, %edi
59 ; X64-NEXT: movl $32, %eax
60 ; X64-NEXT: subl %edi, %eax
67 define i32 @t3(i32 %a, i32 %b) {
70 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
71 ; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx
72 ; X86-NEXT: movl $32, %eax
73 ; X86-NEXT: subl %ecx, %eax
78 ; X64-NEXT: addl %esi, %edi
79 ; X64-NEXT: movl $32, %eax
80 ; X64-NEXT: subl %edi, %eax