brintos

brintos / llvm-project-archived public Read only

0
0
Text · 23.8 KiB · e3a1b1b Raw
633 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 22; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck -check-prefixes=X64 %s3; RUN: llc -mtriple=i386-pc-win32 < %s | FileCheck -check-prefix=WIN32 %s4 5define { half, i32 } @test_frexp_f16_i32(half %a) nounwind {6; X64-LABEL: test_frexp_f16_i32:7; X64:       # %bb.0:8; X64-NEXT:    subq $24, %rsp9; X64-NEXT:    movaps %xmm0, (%rsp) # 16-byte Spill10; X64-NEXT:    callq __extendhfsf2@PLT11; X64-NEXT:    mulss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm012; X64-NEXT:    callq __truncsfhf2@PLT13; X64-NEXT:    pextrw $0, %xmm0, %ecx14; X64-NEXT:    movl %ecx, %eax15; X64-NEXT:    andl $31744, %eax # imm = 0x7C0016; X64-NEXT:    movdqa (%rsp), %xmm0 # 16-byte Reload17; X64-NEXT:    pextrw $0, %xmm0, %edx18; X64-NEXT:    movl %edx, %esi19; X64-NEXT:    andl $32767, %esi # imm = 0x7FFF20; X64-NEXT:    cmpl $1024, %esi # imm = 0x40021; X64-NEXT:    cmovael %edx, %ecx22; X64-NEXT:    cmovael %esi, %eax23; X64-NEXT:    shrl $10, %eax24; X64-NEXT:    leal -12(%rax), %edi25; X64-NEXT:    cmpl $1024, %esi # imm = 0x40026; X64-NEXT:    cmovael %eax, %edi27; X64-NEXT:    addl $-14, %edi28; X64-NEXT:    andl $-31745, %ecx # imm = 0x83FF29; X64-NEXT:    orl $14336, %ecx # imm = 0x380030; X64-NEXT:    addl $-31744, %esi # imm = 0x840031; X64-NEXT:    movzwl %si, %esi32; X64-NEXT:    xorl %eax, %eax33; X64-NEXT:    cmpl $33792, %esi # imm = 0x840034; X64-NEXT:    cmoval %edi, %eax35; X64-NEXT:    cmovbel %edx, %ecx36; X64-NEXT:    pinsrw $0, %ecx, %xmm037; X64-NEXT:    addq $24, %rsp38; X64-NEXT:    retq39;40; WIN32-LABEL: test_frexp_f16_i32:41; WIN32:       # %bb.0:42; WIN32-NEXT:    pushl %esi43; WIN32-NEXT:    subl $20, %esp44; WIN32-NEXT:    movzwl {{[0-9]+}}(%esp), %eax45; WIN32-NEXT:    movl %eax, (%esp)46; WIN32-NEXT:    calll ___extendhfsf247; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax48; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)49; WIN32-NEXT:    fstpl (%esp)50; WIN32-NEXT:    calll _frexp51; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)52; WIN32-NEXT:    flds {{[0-9]+}}(%esp)53; WIN32-NEXT:    fstps (%esp)54; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %esi55; WIN32-NEXT:    calll ___truncsfhf256; WIN32-NEXT:    movl %esi, %edx57; WIN32-NEXT:    addl $20, %esp58; WIN32-NEXT:    popl %esi59; WIN32-NEXT:    retl60  %result = call { half, i32 } @llvm.frexp.f16.i32(half %a)61  ret { half, i32 } %result62}63 64define half @test_frexp_f16_i32_only_use_fract(half %a) nounwind {65; X64-LABEL: test_frexp_f16_i32_only_use_fract:66; X64:       # %bb.0:67; X64-NEXT:    subq $24, %rsp68; X64-NEXT:    movaps %xmm0, (%rsp) # 16-byte Spill69; X64-NEXT:    callq __extendhfsf2@PLT70; X64-NEXT:    mulss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm071; X64-NEXT:    callq __truncsfhf2@PLT72; X64-NEXT:    pextrw $0, %xmm0, %eax73; X64-NEXT:    movdqa (%rsp), %xmm0 # 16-byte Reload74; X64-NEXT:    pextrw $0, %xmm0, %ecx75; X64-NEXT:    movl %ecx, %edx76; X64-NEXT:    andl $32767, %edx # imm = 0x7FFF77; X64-NEXT:    cmpl $1024, %edx # imm = 0x40078; X64-NEXT:    cmovael %ecx, %eax79; X64-NEXT:    andl $-31745, %eax # imm = 0x83FF80; X64-NEXT:    orl $14336, %eax # imm = 0x380081; X64-NEXT:    addl $-31744, %edx # imm = 0x840082; X64-NEXT:    movzwl %dx, %edx83; X64-NEXT:    cmpl $33792, %edx # imm = 0x840084; X64-NEXT:    cmovbel %ecx, %eax85; X64-NEXT:    pinsrw $0, %eax, %xmm086; X64-NEXT:    addq $24, %rsp87; X64-NEXT:    retq88;89; WIN32-LABEL: test_frexp_f16_i32_only_use_fract:90; WIN32:       # %bb.0:91; WIN32-NEXT:    subl $20, %esp92; WIN32-NEXT:    movzwl {{[0-9]+}}(%esp), %eax93; WIN32-NEXT:    movl %eax, (%esp)94; WIN32-NEXT:    calll ___extendhfsf295; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax96; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)97; WIN32-NEXT:    fstpl (%esp)98; WIN32-NEXT:    calll _frexp99; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)100; WIN32-NEXT:    flds {{[0-9]+}}(%esp)101; WIN32-NEXT:    fstps (%esp)102; WIN32-NEXT:    calll ___truncsfhf2103; WIN32-NEXT:    addl $20, %esp104; WIN32-NEXT:    retl105  %result = call { half, i32 } @llvm.frexp.f16.i32(half %a)106  %result.0 = extractvalue { half, i32 } %result, 0107  ret half %result.0108}109 110define i32 @test_frexp_f16_i32_only_use_exp(half %a) nounwind {111; X64-LABEL: test_frexp_f16_i32_only_use_exp:112; X64:       # %bb.0:113; X64-NEXT:    subq $24, %rsp114; X64-NEXT:    movaps %xmm0, (%rsp) # 16-byte Spill115; X64-NEXT:    callq __extendhfsf2@PLT116; X64-NEXT:    mulss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0117; X64-NEXT:    callq __truncsfhf2@PLT118; X64-NEXT:    pextrw $0, %xmm0, %eax119; X64-NEXT:    andl $31744, %eax # imm = 0x7C00120; X64-NEXT:    movdqa (%rsp), %xmm0 # 16-byte Reload121; X64-NEXT:    pextrw $0, %xmm0, %ecx122; X64-NEXT:    andl $32767, %ecx # imm = 0x7FFF123; X64-NEXT:    cmpl $1024, %ecx # imm = 0x400124; X64-NEXT:    cmovael %ecx, %eax125; X64-NEXT:    shrl $10, %eax126; X64-NEXT:    leal -12(%rax), %edx127; X64-NEXT:    cmpl $1024, %ecx # imm = 0x400128; X64-NEXT:    cmovael %eax, %edx129; X64-NEXT:    addl $-14, %edx130; X64-NEXT:    addl $-31744, %ecx # imm = 0x8400131; X64-NEXT:    movzwl %cx, %ecx132; X64-NEXT:    xorl %eax, %eax133; X64-NEXT:    cmpl $33792, %ecx # imm = 0x8400134; X64-NEXT:    cmoval %edx, %eax135; X64-NEXT:    addq $24, %rsp136; X64-NEXT:    retq137;138; WIN32-LABEL: test_frexp_f16_i32_only_use_exp:139; WIN32:       # %bb.0:140; WIN32-NEXT:    subl $16, %esp141; WIN32-NEXT:    movzwl {{[0-9]+}}(%esp), %eax142; WIN32-NEXT:    movl %eax, (%esp)143; WIN32-NEXT:    calll ___extendhfsf2144; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax145; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)146; WIN32-NEXT:    fstpl (%esp)147; WIN32-NEXT:    calll _frexp148; WIN32-NEXT:    fstp %st(0)149; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %eax150; WIN32-NEXT:    addl $16, %esp151; WIN32-NEXT:    retl152  %result = call { half, i32 } @llvm.frexp.f16.i32(half %a)153  %result.0 = extractvalue { half, i32 } %result, 1154  ret i32 %result.0155}156 157; FIXME158; define { <2 x half>, <2 x i32> } @test_frexp_v2f16_v2i32(<2 x half> %a) nounwind {159;   %result = call { <2 x half>, <2 x i32> } @llvm.frexp.v2f16.v2i32(<2 x half> %a)160;   ret { <2 x half>, <2 x i32> } %result161; }162 163; define <2 x half> @test_frexp_v2f16_v2i32_only_use_fract(<2 x half> %a) nounwind {164;   %result = call { <2 x half>, <2 x i32> } @llvm.frexp.v2f16.v2i32(<2 x half> %a)165;   %result.0 = extractvalue { <2 x half>, <2 x i32> } %result, 0166;   ret <2 x half> %result.0167; }168 169; define <2 x i32> @test_frexp_v2f16_v2i32_only_use_exp(<2 x half> %a) nounwind {170;   %result = call { <2 x half>, <2 x i32> } @llvm.frexp.v2f16.v2i32(<2 x half> %a)171;   %result.1 = extractvalue { <2 x half>, <2 x i32> } %result, 1172;   ret <2 x i32> %result.1173; }174 175define { float, i32 } @test_frexp_f32_i32(float %a) nounwind {176; X64-LABEL: test_frexp_f32_i32:177; X64:       # %bb.0:178; X64-NEXT:    pushq %rax179; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi180; X64-NEXT:    callq frexpf@PLT181; X64-NEXT:    movl {{[0-9]+}}(%rsp), %eax182; X64-NEXT:    popq %rcx183; X64-NEXT:    retq184;185; WIN32-LABEL: test_frexp_f32_i32:186; WIN32:       # %bb.0:187; WIN32-NEXT:    subl $20, %esp188; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax189; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)190; WIN32-NEXT:    flds {{[0-9]+}}(%esp)191; WIN32-NEXT:    fstpl (%esp)192; WIN32-NEXT:    calll _frexp193; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)194; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %eax195; WIN32-NEXT:    flds {{[0-9]+}}(%esp)196; WIN32-NEXT:    addl $20, %esp197; WIN32-NEXT:    retl198  %result = call { float, i32 } @llvm.frexp.f32.i32(float %a)199  ret { float, i32 } %result200}201 202define float @test_frexp_f32_i32_only_use_fract(float %a) nounwind {203; X64-LABEL: test_frexp_f32_i32_only_use_fract:204; X64:       # %bb.0:205; X64-NEXT:    pushq %rax206; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi207; X64-NEXT:    callq frexpf@PLT208; X64-NEXT:    popq %rax209; X64-NEXT:    retq210;211; WIN32-LABEL: test_frexp_f32_i32_only_use_fract:212; WIN32:       # %bb.0:213; WIN32-NEXT:    subl $20, %esp214; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax215; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)216; WIN32-NEXT:    flds {{[0-9]+}}(%esp)217; WIN32-NEXT:    fstpl (%esp)218; WIN32-NEXT:    calll _frexp219; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)220; WIN32-NEXT:    flds {{[0-9]+}}(%esp)221; WIN32-NEXT:    addl $20, %esp222; WIN32-NEXT:    retl223  %result = call { float, i32 } @llvm.frexp.f32.i32(float %a)224  %result.0 = extractvalue { float, i32 } %result, 0225  ret float %result.0226}227 228define i32 @test_frexp_f32_i32_only_use_exp(float %a) nounwind {229; X64-LABEL: test_frexp_f32_i32_only_use_exp:230; X64:       # %bb.0:231; X64-NEXT:    pushq %rax232; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi233; X64-NEXT:    callq frexpf@PLT234; X64-NEXT:    movl {{[0-9]+}}(%rsp), %eax235; X64-NEXT:    popq %rcx236; X64-NEXT:    retq237;238; WIN32-LABEL: test_frexp_f32_i32_only_use_exp:239; WIN32:       # %bb.0:240; WIN32-NEXT:    subl $16, %esp241; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax242; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)243; WIN32-NEXT:    flds {{[0-9]+}}(%esp)244; WIN32-NEXT:    fstpl (%esp)245; WIN32-NEXT:    calll _frexp246; WIN32-NEXT:    fstp %st(0)247; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %eax248; WIN32-NEXT:    addl $16, %esp249; WIN32-NEXT:    retl250  %result = call { float, i32 } @llvm.frexp.f32.i32(float %a)251  %result.0 = extractvalue { float, i32 } %result, 1252  ret i32 %result.0253}254 255; FIXME: Widen vector result256; define { <2 x float>, <2 x i32> } @test_frexp_v2f32_v2i32(<2 x float> %a) nounwind {257;   %result = call { <2 x float>, <2 x i32> } @llvm.frexp.v2f32.v2i32(<2 x float> %a)258;   ret { <2 x float>, <2 x i32> } %result259; }260 261; define <2 x float> @test_frexp_v2f32_v2i32_only_use_fract(<2 x float> %a) nounwind {262;   %result = call { <2 x float>, <2 x i32> } @llvm.frexp.v2f32.v2i32(<2 x float> %a)263;   %result.0 = extractvalue { <2 x float>, <2 x i32> } %result, 0264;   ret <2 x float> %result.0265; }266 267; define <2 x i32> @test_frexp_v2f32_v2i32_only_use_exp(<2 x float> %a) nounwind {268;   %result = call { <2 x float>, <2 x i32> } @llvm.frexp.v2f32.v2i32(<2 x float> %a)269;   %result.1 = extractvalue { <2 x float>, <2 x i32> } %result, 1270;   ret <2 x i32> %result.1271; }272 273define { <4 x float>, <4 x i32> } @test_frexp_v4f32_v4i32(<4 x float> %a) nounwind {274; X64-LABEL: test_frexp_v4f32_v4i32:275; X64:       # %bb.0:276; X64-NEXT:    subq $72, %rsp277; X64-NEXT:    movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill278; X64-NEXT:    shufps {{.*#+}} xmm0 = xmm0[3,3,3,3]279; X64-NEXT:    movq %rsp, %rdi280; X64-NEXT:    callq frexpf@PLT281; X64-NEXT:    movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill282; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload283; X64-NEXT:    movhlps {{.*#+}} xmm0 = xmm0[1,1]284; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi285; X64-NEXT:    callq frexpf@PLT286; X64-NEXT:    unpcklps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Folded Reload287; X64-NEXT:    # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]288; X64-NEXT:    movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill289; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi290; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload291; X64-NEXT:    callq frexpf@PLT292; X64-NEXT:    movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill293; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload294; X64-NEXT:    shufps {{.*#+}} xmm0 = xmm0[1,1,1,1]295; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi296; X64-NEXT:    callq frexpf@PLT297; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload298; X64-NEXT:    unpcklps {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]299; X64-NEXT:    unpcklpd {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Folded Reload300; X64-NEXT:    # xmm1 = xmm1[0],mem[0]301; X64-NEXT:    movaps %xmm1, %xmm0302; X64-NEXT:    movss {{.*#+}} xmm1 = mem[0],zero,zero,zero303; X64-NEXT:    movss {{.*#+}} xmm2 = mem[0],zero,zero,zero304; X64-NEXT:    unpcklps {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]305; X64-NEXT:    movss {{.*#+}} xmm1 = mem[0],zero,zero,zero306; X64-NEXT:    movss {{.*#+}} xmm3 = mem[0],zero,zero,zero307; X64-NEXT:    unpcklps {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]308; X64-NEXT:    movlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]309; X64-NEXT:    addq $72, %rsp310; X64-NEXT:    retq311;312; WIN32-LABEL: test_frexp_v4f32_v4i32:313; WIN32:       # %bb.0:314; WIN32-NEXT:    pushl %esi315; WIN32-NEXT:    subl $44, %esp316; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %esi317; WIN32-NEXT:    leal 24(%esi), %eax318; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)319; WIN32-NEXT:    flds {{[0-9]+}}(%esp)320; WIN32-NEXT:    fstpl (%esp)321; WIN32-NEXT:    calll _frexp322; WIN32-NEXT:    fstpl {{[-0-9]+}}(%e{{[sb]}}p) # 8-byte Folded Spill323; WIN32-NEXT:    leal 20(%esi), %eax324; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)325; WIN32-NEXT:    flds {{[0-9]+}}(%esp)326; WIN32-NEXT:    fstpl (%esp)327; WIN32-NEXT:    calll _frexp328; WIN32-NEXT:    fstpl {{[-0-9]+}}(%e{{[sb]}}p) # 8-byte Folded Spill329; WIN32-NEXT:    leal 16(%esi), %eax330; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)331; WIN32-NEXT:    flds {{[0-9]+}}(%esp)332; WIN32-NEXT:    fstpl (%esp)333; WIN32-NEXT:    calll _frexp334; WIN32-NEXT:    leal 28(%esi), %eax335; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)336; WIN32-NEXT:    flds {{[0-9]+}}(%esp)337; WIN32-NEXT:    fstpl (%esp)338; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)339; WIN32-NEXT:    fldl {{[-0-9]+}}(%e{{[sb]}}p) # 8-byte Folded Reload340; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)341; WIN32-NEXT:    fldl {{[-0-9]+}}(%e{{[sb]}}p) # 8-byte Folded Reload342; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)343; WIN32-NEXT:    calll _frexp344; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)345; WIN32-NEXT:    flds {{[0-9]+}}(%esp)346; WIN32-NEXT:    flds {{[0-9]+}}(%esp)347; WIN32-NEXT:    flds {{[0-9]+}}(%esp)348; WIN32-NEXT:    flds {{[0-9]+}}(%esp)349; WIN32-NEXT:    fstps 12(%esi)350; WIN32-NEXT:    fstps 8(%esi)351; WIN32-NEXT:    fstps 4(%esi)352; WIN32-NEXT:    fstps (%esi)353; WIN32-NEXT:    movl %esi, %eax354; WIN32-NEXT:    addl $44, %esp355; WIN32-NEXT:    popl %esi356; WIN32-NEXT:    retl357  %result = call { <4 x float>, <4 x i32> } @llvm.frexp.v4f32.v4i32(<4 x float> %a)358  ret { <4 x float>, <4 x i32> } %result359}360 361define <4 x float> @test_frexp_v4f32_v4i32_only_use_fract(<4 x float> %a) nounwind {362; X64-LABEL: test_frexp_v4f32_v4i32_only_use_fract:363; X64:       # %bb.0:364; X64-NEXT:    subq $72, %rsp365; X64-NEXT:    movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill366; X64-NEXT:    shufps {{.*#+}} xmm0 = xmm0[3,3,3,3]367; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi368; X64-NEXT:    callq frexpf@PLT369; X64-NEXT:    movaps %xmm0, (%rsp) # 16-byte Spill370; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload371; X64-NEXT:    movhlps {{.*#+}} xmm0 = xmm0[1,1]372; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi373; X64-NEXT:    callq frexpf@PLT374; X64-NEXT:    unpcklps (%rsp), %xmm0 # 16-byte Folded Reload375; X64-NEXT:    # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]376; X64-NEXT:    movaps %xmm0, (%rsp) # 16-byte Spill377; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi378; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload379; X64-NEXT:    callq frexpf@PLT380; X64-NEXT:    movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill381; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload382; X64-NEXT:    shufps {{.*#+}} xmm0 = xmm0[1,1,1,1]383; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi384; X64-NEXT:    callq frexpf@PLT385; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload386; X64-NEXT:    unpcklps {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]387; X64-NEXT:    unpcklpd (%rsp), %xmm1 # 16-byte Folded Reload388; X64-NEXT:    # xmm1 = xmm1[0],mem[0]389; X64-NEXT:    movaps %xmm1, %xmm0390; X64-NEXT:    addq $72, %rsp391; X64-NEXT:    retq392;393; WIN32-LABEL: test_frexp_v4f32_v4i32_only_use_fract:394; WIN32:       # %bb.0:395; WIN32-NEXT:    pushl %esi396; WIN32-NEXT:    subl $60, %esp397; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %esi398; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax399; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)400; WIN32-NEXT:    flds {{[0-9]+}}(%esp)401; WIN32-NEXT:    fstpl (%esp)402; WIN32-NEXT:    calll _frexp403; WIN32-NEXT:    fstpl {{[-0-9]+}}(%e{{[sb]}}p) # 8-byte Folded Spill404; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax405; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)406; WIN32-NEXT:    flds {{[0-9]+}}(%esp)407; WIN32-NEXT:    fstpl (%esp)408; WIN32-NEXT:    calll _frexp409; WIN32-NEXT:    fstpl {{[-0-9]+}}(%e{{[sb]}}p) # 8-byte Folded Spill410; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax411; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)412; WIN32-NEXT:    flds {{[0-9]+}}(%esp)413; WIN32-NEXT:    fstpl (%esp)414; WIN32-NEXT:    calll _frexp415; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax416; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)417; WIN32-NEXT:    flds {{[0-9]+}}(%esp)418; WIN32-NEXT:    fstpl (%esp)419; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)420; WIN32-NEXT:    fldl {{[-0-9]+}}(%e{{[sb]}}p) # 8-byte Folded Reload421; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)422; WIN32-NEXT:    fldl {{[-0-9]+}}(%e{{[sb]}}p) # 8-byte Folded Reload423; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)424; WIN32-NEXT:    calll _frexp425; WIN32-NEXT:    fstps {{[0-9]+}}(%esp)426; WIN32-NEXT:    flds {{[0-9]+}}(%esp)427; WIN32-NEXT:    flds {{[0-9]+}}(%esp)428; WIN32-NEXT:    flds {{[0-9]+}}(%esp)429; WIN32-NEXT:    flds {{[0-9]+}}(%esp)430; WIN32-NEXT:    fstps 12(%esi)431; WIN32-NEXT:    fstps 8(%esi)432; WIN32-NEXT:    fstps 4(%esi)433; WIN32-NEXT:    fstps (%esi)434; WIN32-NEXT:    movl %esi, %eax435; WIN32-NEXT:    addl $60, %esp436; WIN32-NEXT:    popl %esi437; WIN32-NEXT:    retl438  %result = call { <4 x float>, <4 x i32> } @llvm.frexp.v4f32.v4i32(<4 x float> %a)439  %result.0 = extractvalue { <4 x float>, <4 x i32> } %result, 0440  ret <4 x float> %result.0441}442 443define <4 x i32> @test_frexp_v4f32_v4i32_only_use_exp(<4 x float> %a) nounwind {444; X64-LABEL: test_frexp_v4f32_v4i32_only_use_exp:445; X64:       # %bb.0:446; X64-NEXT:    subq $40, %rsp447; X64-NEXT:    movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill448; X64-NEXT:    shufps {{.*#+}} xmm0 = xmm0[3,3,3,3]449; X64-NEXT:    movq %rsp, %rdi450; X64-NEXT:    callq frexpf@PLT451; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload452; X64-NEXT:    movhlps {{.*#+}} xmm0 = xmm0[1,1]453; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi454; X64-NEXT:    callq frexpf@PLT455; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi456; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload457; X64-NEXT:    callq frexpf@PLT458; X64-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload459; X64-NEXT:    shufps {{.*#+}} xmm0 = xmm0[1,1,1,1]460; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi461; X64-NEXT:    callq frexpf@PLT462; X64-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero463; X64-NEXT:    movss {{.*#+}} xmm1 = mem[0],zero,zero,zero464; X64-NEXT:    unpcklps {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]465; X64-NEXT:    movss {{.*#+}} xmm0 = mem[0],zero,zero,zero466; X64-NEXT:    movss {{.*#+}} xmm2 = mem[0],zero,zero,zero467; X64-NEXT:    unpcklps {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]468; X64-NEXT:    movlhps {{.*#+}} xmm0 = xmm0[0],xmm1[0]469; X64-NEXT:    addq $40, %rsp470; X64-NEXT:    retq471;472; WIN32-LABEL: test_frexp_v4f32_v4i32_only_use_exp:473; WIN32:       # %bb.0:474; WIN32-NEXT:    pushl %esi475; WIN32-NEXT:    subl $12, %esp476; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %esi477; WIN32-NEXT:    leal 8(%esi), %eax478; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)479; WIN32-NEXT:    flds {{[0-9]+}}(%esp)480; WIN32-NEXT:    fstpl (%esp)481; WIN32-NEXT:    calll _frexp482; WIN32-NEXT:    fstp %st(0)483; WIN32-NEXT:    leal 4(%esi), %eax484; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)485; WIN32-NEXT:    flds {{[0-9]+}}(%esp)486; WIN32-NEXT:    fstpl (%esp)487; WIN32-NEXT:    calll _frexp488; WIN32-NEXT:    fstp %st(0)489; WIN32-NEXT:    leal 12(%esi), %eax490; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)491; WIN32-NEXT:    flds {{[0-9]+}}(%esp)492; WIN32-NEXT:    fstpl (%esp)493; WIN32-NEXT:    calll _frexp494; WIN32-NEXT:    fstp %st(0)495; WIN32-NEXT:    movl %esi, {{[0-9]+}}(%esp)496; WIN32-NEXT:    flds {{[0-9]+}}(%esp)497; WIN32-NEXT:    fstpl (%esp)498; WIN32-NEXT:    calll _frexp499; WIN32-NEXT:    fstp %st(0)500; WIN32-NEXT:    movl %esi, %eax501; WIN32-NEXT:    addl $12, %esp502; WIN32-NEXT:    popl %esi503; WIN32-NEXT:    retl504  %result = call { <4 x float>, <4 x i32> } @llvm.frexp.v4f32.v4i32(<4 x float> %a)505  %result.1 = extractvalue { <4 x float>, <4 x i32> } %result, 1506  ret <4 x i32> %result.1507}508 509define { double, i32 } @test_frexp_f64_i32(double %a) nounwind {510; X64-LABEL: test_frexp_f64_i32:511; X64:       # %bb.0:512; X64-NEXT:    pushq %rax513; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi514; X64-NEXT:    callq frexp@PLT515; X64-NEXT:    movl {{[0-9]+}}(%rsp), %eax516; X64-NEXT:    popq %rcx517; X64-NEXT:    retq518;519; WIN32-LABEL: test_frexp_f64_i32:520; WIN32:       # %bb.0:521; WIN32-NEXT:    subl $16, %esp522; WIN32-NEXT:    fldl {{[0-9]+}}(%esp)523; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax524; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)525; WIN32-NEXT:    fstpl (%esp)526; WIN32-NEXT:    calll _frexp527; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %eax528; WIN32-NEXT:    addl $16, %esp529; WIN32-NEXT:    retl530  %result = call { double, i32 } @llvm.frexp.f64.i32(double %a)531  ret { double, i32 } %result532}533 534define double @test_frexp_f64_i32_only_use_fract(double %a) nounwind {535; X64-LABEL: test_frexp_f64_i32_only_use_fract:536; X64:       # %bb.0:537; X64-NEXT:    pushq %rax538; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi539; X64-NEXT:    callq frexp@PLT540; X64-NEXT:    popq %rax541; X64-NEXT:    retq542;543; WIN32-LABEL: test_frexp_f64_i32_only_use_fract:544; WIN32:       # %bb.0:545; WIN32-NEXT:    subl $16, %esp546; WIN32-NEXT:    fldl {{[0-9]+}}(%esp)547; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax548; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)549; WIN32-NEXT:    fstpl (%esp)550; WIN32-NEXT:    calll _frexp551; WIN32-NEXT:    addl $16, %esp552; WIN32-NEXT:    retl553  %result = call { double, i32 } @llvm.frexp.f64.i32(double %a)554  %result.0 = extractvalue { double, i32 } %result, 0555  ret double %result.0556}557 558define i32 @test_frexp_f64_i32_only_use_exp(double %a) nounwind {559; X64-LABEL: test_frexp_f64_i32_only_use_exp:560; X64:       # %bb.0:561; X64-NEXT:    pushq %rax562; X64-NEXT:    leaq {{[0-9]+}}(%rsp), %rdi563; X64-NEXT:    callq frexp@PLT564; X64-NEXT:    movl {{[0-9]+}}(%rsp), %eax565; X64-NEXT:    popq %rcx566; X64-NEXT:    retq567;568; WIN32-LABEL: test_frexp_f64_i32_only_use_exp:569; WIN32:       # %bb.0:570; WIN32-NEXT:    subl $16, %esp571; WIN32-NEXT:    fldl {{[0-9]+}}(%esp)572; WIN32-NEXT:    leal {{[0-9]+}}(%esp), %eax573; WIN32-NEXT:    movl %eax, {{[0-9]+}}(%esp)574; WIN32-NEXT:    fstpl (%esp)575; WIN32-NEXT:    calll _frexp576; WIN32-NEXT:    fstp %st(0)577; WIN32-NEXT:    movl {{[0-9]+}}(%esp), %eax578; WIN32-NEXT:    addl $16, %esp579; WIN32-NEXT:    retl580  %result = call { double, i32 } @llvm.frexp.f64.i32(double %a)581  %result.0 = extractvalue { double, i32 } %result, 1582  ret i32 %result.0583}584 585define { float, i32 } @pr160981() {586; X64-LABEL: pr160981:587; X64:       # %bb.0:588; X64-NEXT:    movss {{.*#+}} xmm0 = [9.9999988E-1,0.0E+0,0.0E+0,0.0E+0]589; X64-NEXT:    movl $-126, %eax590; X64-NEXT:    retq591;592; WIN32-LABEL: pr160981:593; WIN32:       # %bb.0:594; WIN32-NEXT:    flds __real@3f7ffffe595; WIN32-NEXT:    movl $-126, %eax596; WIN32-NEXT:    retl597  %ret = call { float, i32 } @llvm.frexp.f32.i32(float bitcast (i32 8388607 to float))598  ret { float, i32 } %ret599}600 601; FIXME: Widen vector result602; define { <2 x double>, <2 x i32> } @test_frexp_v2f64_v2i32(<2 x double> %a) nounwind {603;   %result = call { <2 x double>, <2 x i32> } @llvm.frexp.v2f64.v2i32(<2 x double> %a)604;   ret { <2 x double>, <2 x i32> } %result605; }606 607; define <2 x double> @test_frexp_v2f64_v2i32_only_use_fract(<2 x double> %a) nounwind {608;   %result = call { <2 x double>, <2 x i32> } @llvm.frexp.v2f64.v2i32(<2 x double> %a)609;   %result.0 = extractvalue { <2 x double>, <2 x i32> } %result, 0610;   ret <2 x double> %result.0611; }612 613; define <2 x i32> @test_frexp_v2f64_v2i32_only_use_exp(<2 x double> %a) nounwind {614;   %result = call { <2 x double>, <2 x i32> } @llvm.frexp.v2f64.v2i32(<2 x double> %a)615;   %result.1 = extractvalue { <2 x double>, <2 x i32> } %result, 1616;   ret <2 x i32> %result.1617; }618 619declare { float, i32 } @llvm.frexp.f32.i32(float) #0620declare { <2 x float>, <2 x i32> } @llvm.frexp.v2f32.v2i32(<2 x float>) #0621declare { <4 x float>, <4 x i32> } @llvm.frexp.v4f32.v4i32(<4 x float>) #0622 623declare { half, i32 } @llvm.frexp.f16.i32(half) #0624declare { <2 x half>, <2 x i32> } @llvm.frexp.v2f16.v2i32(<2 x half>) #0625 626declare { double, i32 } @llvm.frexp.f64.i32(double) #0627declare { <2 x double>, <2 x i32> } @llvm.frexp.v2f64.v2i32(<2 x double>) #0628 629declare { half, i16 } @llvm.frexp.f16.i16(half) #0630declare { <2 x half>, <2 x i16> } @llvm.frexp.v2f16.v2i16(<2 x half>) #0631 632attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }633