213 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-win32 | FileCheck %s -check-prefix=WIN643; RUN: llc < %s -mtriple=x86_64-mingw32 | FileCheck %s -check-prefix=WIN644 5define i64 @double_to_i128(double %d) nounwind strictfp {6; WIN64-LABEL: double_to_i128:7; WIN64: # %bb.0:8; WIN64-NEXT: subq $40, %rsp9; WIN64-NEXT: callq __fixdfti10; WIN64-NEXT: movq %xmm0, %rax11; WIN64-NEXT: addq $40, %rsp12; WIN64-NEXT: retq13 %1 = tail call i128 @llvm.experimental.constrained.fptosi.i128.f64(double %d, metadata !"fpexcept.strict")14 %2 = trunc i128 %1 to i6415 ret i64 %216}17 18define i64 @double_to_ui128(double %d) nounwind strictfp {19; WIN64-LABEL: double_to_ui128:20; WIN64: # %bb.0:21; WIN64-NEXT: subq $40, %rsp22; WIN64-NEXT: callq __fixunsdfti23; WIN64-NEXT: movq %xmm0, %rax24; WIN64-NEXT: addq $40, %rsp25; WIN64-NEXT: retq26 %1 = tail call i128 @llvm.experimental.constrained.fptoui.i128.f64(double %d, metadata !"fpexcept.strict")27 %2 = trunc i128 %1 to i6428 ret i64 %229}30 31define i64 @float_to_i128(float %d) nounwind strictfp {32; WIN64-LABEL: float_to_i128:33; WIN64: # %bb.0:34; WIN64-NEXT: subq $40, %rsp35; WIN64-NEXT: callq __fixsfti36; WIN64-NEXT: movq %xmm0, %rax37; WIN64-NEXT: addq $40, %rsp38; WIN64-NEXT: retq39 %1 = tail call i128 @llvm.experimental.constrained.fptosi.i128.f32(float %d, metadata !"fpexcept.strict")40 %2 = trunc i128 %1 to i6441 ret i64 %242}43 44define i64 @float_to_ui128(float %d) nounwind strictfp {45; WIN64-LABEL: float_to_ui128:46; WIN64: # %bb.0:47; WIN64-NEXT: subq $40, %rsp48; WIN64-NEXT: callq __fixunssfti49; WIN64-NEXT: movq %xmm0, %rax50; WIN64-NEXT: addq $40, %rsp51; WIN64-NEXT: retq52 %1 = tail call i128 @llvm.experimental.constrained.fptoui.i128.f32(float %d, metadata !"fpexcept.strict")53 %2 = trunc i128 %1 to i6454 ret i64 %255}56 57define i64 @longdouble_to_i128(ptr nocapture readonly %0) nounwind strictfp {58; WIN64-LABEL: longdouble_to_i128:59; WIN64: # %bb.0:60; WIN64-NEXT: subq $56, %rsp61; WIN64-NEXT: fldt (%rcx)62; WIN64-NEXT: fstpt {{[0-9]+}}(%rsp)63; WIN64-NEXT: wait64; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx65; WIN64-NEXT: callq __fixxfti66; WIN64-NEXT: movq %xmm0, %rax67; WIN64-NEXT: addq $56, %rsp68; WIN64-NEXT: retq69 %2 = load x86_fp80, ptr %0, align 1670 %3 = tail call i128 @llvm.experimental.constrained.fptosi.i128.f80(x86_fp80 %2, metadata !"fpexcept.strict")71 %4 = trunc i128 %3 to i6472 ret i64 %473}74 75define i64 @longdouble_to_ui128(ptr nocapture readonly %0) nounwind strictfp {76; WIN64-LABEL: longdouble_to_ui128:77; WIN64: # %bb.0:78; WIN64-NEXT: subq $56, %rsp79; WIN64-NEXT: fldt (%rcx)80; WIN64-NEXT: fstpt {{[0-9]+}}(%rsp)81; WIN64-NEXT: wait82; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx83; WIN64-NEXT: callq __fixunsxfti84; WIN64-NEXT: movq %xmm0, %rax85; WIN64-NEXT: addq $56, %rsp86; WIN64-NEXT: retq87 %2 = load x86_fp80, ptr %0, align 1688 %3 = tail call i128 @llvm.experimental.constrained.fptoui.i128.f80(x86_fp80 %2, metadata !"fpexcept.strict")89 %4 = trunc i128 %3 to i6490 ret i64 %491}92 93define double @i128_to_double(ptr nocapture readonly %0) nounwind strictfp {94; WIN64-LABEL: i128_to_double:95; WIN64: # %bb.0:96; WIN64-NEXT: subq $56, %rsp97; WIN64-NEXT: movaps (%rcx), %xmm098; WIN64-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)99; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx100; WIN64-NEXT: callq __floattidf101; WIN64-NEXT: addq $56, %rsp102; WIN64-NEXT: retq103 %2 = load i128, ptr %0, align 16104 %3 = tail call double @llvm.experimental.constrained.sitofp.f64.i128(i128 %2, metadata !"round.dynamic", metadata !"fpexcept.strict")105 ret double %3106}107 108define double @ui128_to_double(ptr nocapture readonly %0) nounwind strictfp {109; WIN64-LABEL: ui128_to_double:110; WIN64: # %bb.0:111; WIN64-NEXT: subq $56, %rsp112; WIN64-NEXT: movaps (%rcx), %xmm0113; WIN64-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)114; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx115; WIN64-NEXT: callq __floatuntidf116; WIN64-NEXT: addq $56, %rsp117; WIN64-NEXT: retq118 %2 = load i128, ptr %0, align 16119 %3 = tail call double @llvm.experimental.constrained.uitofp.f64.i128(i128 %2, metadata !"round.dynamic", metadata !"fpexcept.strict")120 ret double %3121}122 123define float @i128_to_float(ptr nocapture readonly %0) nounwind strictfp {124; WIN64-LABEL: i128_to_float:125; WIN64: # %bb.0:126; WIN64-NEXT: subq $56, %rsp127; WIN64-NEXT: movaps (%rcx), %xmm0128; WIN64-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)129; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx130; WIN64-NEXT: callq __floattisf131; WIN64-NEXT: addq $56, %rsp132; WIN64-NEXT: retq133 %2 = load i128, ptr %0, align 16134 %3 = tail call float @llvm.experimental.constrained.sitofp.f32.i128(i128 %2, metadata !"round.dynamic", metadata !"fpexcept.strict")135 ret float %3136}137 138define float @ui128_to_float(ptr nocapture readonly %0) nounwind strictfp {139; WIN64-LABEL: ui128_to_float:140; WIN64: # %bb.0:141; WIN64-NEXT: subq $56, %rsp142; WIN64-NEXT: movaps (%rcx), %xmm0143; WIN64-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)144; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx145; WIN64-NEXT: callq __floatuntisf146; WIN64-NEXT: addq $56, %rsp147; WIN64-NEXT: retq148 %2 = load i128, ptr %0, align 16149 %3 = tail call float @llvm.experimental.constrained.uitofp.f32.i128(i128 %2, metadata !"round.dynamic", metadata !"fpexcept.strict")150 ret float %3151}152 153define void @i128_to_longdouble(ptr noalias nocapture sret(x86_fp80) align 16 %agg.result, ptr nocapture readonly %0) nounwind strictfp {154; WIN64-LABEL: i128_to_longdouble:155; WIN64: # %bb.0:156; WIN64-NEXT: pushq %rsi157; WIN64-NEXT: subq $64, %rsp158; WIN64-NEXT: movq %rcx, %rsi159; WIN64-NEXT: movaps (%rdx), %xmm0160; WIN64-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)161; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx162; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rdx163; WIN64-NEXT: callq __floattixf164; WIN64-NEXT: fldt {{[0-9]+}}(%rsp)165; WIN64-NEXT: fstpt (%rsi)166; WIN64-NEXT: wait167; WIN64-NEXT: movq %rsi, %rax168; WIN64-NEXT: addq $64, %rsp169; WIN64-NEXT: popq %rsi170; WIN64-NEXT: retq171 %2 = load i128, ptr %0, align 16172 %3 = tail call x86_fp80 @llvm.experimental.constrained.sitofp.f80.i128(i128 %2, metadata !"round.dynamic", metadata !"fpexcept.strict")173 store x86_fp80 %3, ptr %agg.result, align 16174 ret void175}176 177define void @ui128_to_longdouble(ptr noalias nocapture sret(x86_fp80) align 16 %agg.result, ptr nocapture readonly %0) nounwind strictfp {178; WIN64-LABEL: ui128_to_longdouble:179; WIN64: # %bb.0:180; WIN64-NEXT: pushq %rsi181; WIN64-NEXT: subq $64, %rsp182; WIN64-NEXT: movq %rcx, %rsi183; WIN64-NEXT: movaps (%rdx), %xmm0184; WIN64-NEXT: movaps %xmm0, {{[0-9]+}}(%rsp)185; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rcx186; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rdx187; WIN64-NEXT: callq __floatuntixf188; WIN64-NEXT: fldt {{[0-9]+}}(%rsp)189; WIN64-NEXT: fstpt (%rsi)190; WIN64-NEXT: wait191; WIN64-NEXT: movq %rsi, %rax192; WIN64-NEXT: addq $64, %rsp193; WIN64-NEXT: popq %rsi194; WIN64-NEXT: retq195 %2 = load i128, ptr %0, align 16196 %3 = tail call x86_fp80 @llvm.experimental.constrained.uitofp.f80.i128(i128 %2, metadata !"round.dynamic", metadata !"fpexcept.strict")197 store x86_fp80 %3, ptr %agg.result, align 16198 ret void199}200 201declare i128 @llvm.experimental.constrained.fptosi.i128.f64(double, metadata)202declare i128 @llvm.experimental.constrained.fptoui.i128.f64(double, metadata)203declare i128 @llvm.experimental.constrained.fptosi.i128.f32(float, metadata)204declare i128 @llvm.experimental.constrained.fptoui.i128.f32(float, metadata)205declare i128 @llvm.experimental.constrained.fptosi.i128.f80(x86_fp80, metadata)206declare i128 @llvm.experimental.constrained.fptoui.i128.f80(x86_fp80, metadata)207declare double @llvm.experimental.constrained.sitofp.f64.i128(i128, metadata, metadata)208declare double @llvm.experimental.constrained.uitofp.f64.i128(i128, metadata, metadata)209declare float @llvm.experimental.constrained.sitofp.f32.i128(i128, metadata, metadata)210declare float @llvm.experimental.constrained.uitofp.f32.i128(i128, metadata, metadata)211declare x86_fp80 @llvm.experimental.constrained.sitofp.f80.i128(i128, metadata, metadata)212declare x86_fp80 @llvm.experimental.constrained.uitofp.f80.i128(i128, metadata, metadata)213