brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.7 KiB · a899660 Raw
148 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-unknown-unknown   -mattr=+sse,+sse2,+slow-lea,+slow-3ops-lea | FileCheck %s --check-prefixes=ALL,X86,X86-SLOWLEA3; RUN: llc < %s -mtriple=i686-unknown-unknown   -mattr=+sse,+sse2,-slow-lea,-slow-3ops-lea | FileCheck %s --check-prefixes=ALL,X86,X86-FASTLEA4; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse,+sse2,+slow-lea,+slow-3ops-lea | FileCheck %s --check-prefixes=ALL,X645; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse,+sse2,-slow-lea,-slow-3ops-lea | FileCheck %s --check-prefixes=ALL,X646 7; These two forms are equivalent:8;   sub %y, (xor %x, -1)9;   add (add %x, 1), %y10; Some targets may prefer one to the other.11 12define i8 @scalar_i8(i8 %x, i8 %y) nounwind {13; X86-LABEL: scalar_i8:14; X86:       # %bb.0:15; X86-NEXT:    movzbl {{[0-9]+}}(%esp), %eax16; X86-NEXT:    addb {{[0-9]+}}(%esp), %al17; X86-NEXT:    incb %al18; X86-NEXT:    retl19;20; X64-LABEL: scalar_i8:21; X64:       # %bb.0:22; X64-NEXT:    # kill: def $esi killed $esi def $rsi23; X64-NEXT:    # kill: def $edi killed $edi def $rdi24; X64-NEXT:    leal (%rdi,%rsi), %eax25; X64-NEXT:    incb %al26; X64-NEXT:    # kill: def $al killed $al killed $eax27; X64-NEXT:    retq28  %t0 = add i8 %x, 129  %t1 = add i8 %y, %t030  ret i8 %t131}32 33define i16 @scalar_i16(i16 %x, i16 %y) nounwind {34; X86-LABEL: scalar_i16:35; X86:       # %bb.0:36; X86-NEXT:    movzwl {{[0-9]+}}(%esp), %eax37; X86-NEXT:    addw {{[0-9]+}}(%esp), %ax38; X86-NEXT:    incl %eax39; X86-NEXT:    # kill: def $ax killed $ax killed $eax40; X86-NEXT:    retl41;42; X64-LABEL: scalar_i16:43; X64:       # %bb.0:44; X64-NEXT:    # kill: def $esi killed $esi def $rsi45; X64-NEXT:    # kill: def $edi killed $edi def $rdi46; X64-NEXT:    leal 1(%rdi,%rsi), %eax47; X64-NEXT:    # kill: def $ax killed $ax killed $eax48; X64-NEXT:    retq49  %t0 = add i16 %x, 150  %t1 = add i16 %y, %t051  ret i16 %t152}53 54define i32 @scalar_i32(i32 %x, i32 %y) nounwind {55; X86-SLOWLEA-LABEL: scalar_i32:56; X86-SLOWLEA:       # %bb.0:57; X86-SLOWLEA-NEXT:    movl {{[0-9]+}}(%esp), %eax58; X86-SLOWLEA-NEXT:    movl {{[0-9]+}}(%esp), %ecx59; X86-SLOWLEA-NEXT:    addl %ecx, %eax60; X86-SLOWLEA-NEXT:    addl $1, %eax61; X86-SLOWLEA-NEXT:    retl62;63; X86-FASTLEA-LABEL: scalar_i32:64; X86-FASTLEA:       # %bb.0:65; X86-FASTLEA-NEXT:    movl {{[0-9]+}}(%esp), %eax66; X86-FASTLEA-NEXT:    movl {{[0-9]+}}(%esp), %ecx67; X86-FASTLEA-NEXT:    leal 1(%ecx,%eax), %eax68; X86-FASTLEA-NEXT:    retl69;70; X64-LABEL: scalar_i32:71; X64:       # %bb.0:72; X64-NEXT:    # kill: def $esi killed $esi def $rsi73; X64-NEXT:    # kill: def $edi killed $edi def $rdi74; X64-NEXT:    leal 1(%rdi,%rsi), %eax75; X64-NEXT:    retq76  %t0 = add i32 %x, 177  %t1 = add i32 %y, %t078  ret i32 %t179}80 81define i64 @scalar_i64(i64 %x, i64 %y) nounwind {82; X86-LABEL: scalar_i64:83; X86:       # %bb.0:84; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax85; X86-NEXT:    movl {{[0-9]+}}(%esp), %edx86; X86-NEXT:    addl {{[0-9]+}}(%esp), %eax87; X86-NEXT:    adcl {{[0-9]+}}(%esp), %edx88; X86-NEXT:    addl $1, %eax89; X86-NEXT:    adcl $0, %edx90; X86-NEXT:    retl91;92; X64-LABEL: scalar_i64:93; X64:       # %bb.0:94; X64-NEXT:    leaq 1(%rdi,%rsi), %rax95; X64-NEXT:    retq96  %t0 = add i64 %x, 197  %t1 = add i64 %y, %t098  ret i64 %t199}100 101define <16 x i8> @vector_i128_i8(<16 x i8> %x, <16 x i8> %y) nounwind {102; ALL-LABEL: vector_i128_i8:103; ALL:       # %bb.0:104; ALL-NEXT:    paddb %xmm1, %xmm0105; ALL-NEXT:    pcmpeqd %xmm1, %xmm1106; ALL-NEXT:    psubb %xmm1, %xmm0107; ALL-NEXT:    ret{{[l|q]}}108  %t0 = add <16 x i8> %x, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>109  %t1 = add <16 x i8> %y, %t0110  ret <16 x i8> %t1111}112 113define <8 x i16> @vector_i128_i16(<8 x i16> %x, <8 x i16> %y) nounwind {114; ALL-LABEL: vector_i128_i16:115; ALL:       # %bb.0:116; ALL-NEXT:    paddw %xmm1, %xmm0117; ALL-NEXT:    pcmpeqd %xmm1, %xmm1118; ALL-NEXT:    psubw %xmm1, %xmm0119; ALL-NEXT:    ret{{[l|q]}}120  %t0 = add <8 x i16> %x, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>121  %t1 = add <8 x i16> %y, %t0122  ret <8 x i16> %t1123}124 125define <4 x i32> @vector_i128_i32(<4 x i32> %x, <4 x i32> %y) nounwind {126; ALL-LABEL: vector_i128_i32:127; ALL:       # %bb.0:128; ALL-NEXT:    paddd %xmm1, %xmm0129; ALL-NEXT:    pcmpeqd %xmm1, %xmm1130; ALL-NEXT:    psubd %xmm1, %xmm0131; ALL-NEXT:    ret{{[l|q]}}132  %t0 = add <4 x i32> %x, <i32 1, i32 1, i32 1, i32 1>133  %t1 = add <4 x i32> %y, %t0134  ret <4 x i32> %t1135}136 137define <2 x i64> @vector_i128_i64(<2 x i64> %x, <2 x i64> %y) nounwind {138; ALL-LABEL: vector_i128_i64:139; ALL:       # %bb.0:140; ALL-NEXT:    paddq %xmm1, %xmm0141; ALL-NEXT:    pcmpeqd %xmm1, %xmm1142; ALL-NEXT:    psubq %xmm1, %xmm0143; ALL-NEXT:    ret{{[l|q]}}144  %t0 = add <2 x i64> %x, <i64 1, i64 1>145  %t1 = add <2 x i64> %y, %t0146  ret <2 x i64> %t1147}148