From 64d3ed304fe7aa7c4d753da70beaff9f23c4896b Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 27 Oct 2020 17:43:16 +0000 Subject: [PATCH] [X86] Regenerate scalar fptosi/fptoui tests. NFCI. Merge prefixes where possible, use 'X86' instead of 'X32' (which we try to only use for gnux32 triple tests). --- llvm/test/CodeGen/X86/scalar-fp-to-i32.ll | 1726 +++++++-------- llvm/test/CodeGen/X86/scalar-fp-to-i64.ll | 3258 ++++++++++++++--------------- 2 files changed, 2333 insertions(+), 2651 deletions(-) diff --git a/llvm/test/CodeGen/X86/scalar-fp-to-i32.ll b/llvm/test/CodeGen/X86/scalar-fp-to-i32.ll index 4ca20a7..9e0868f 100644 --- a/llvm/test/CodeGen/X86/scalar-fp-to-i32.ll +++ b/llvm/test/CodeGen/X86/scalar-fp-to-i32.ll @@ -1,179 +1,158 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512DQVL_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512DQVL_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512DQVL_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512DQVL_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512DQ_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512DQ_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512DQ_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512DQ_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512F_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512F_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512F_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512F_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X32,SSE3_32,SSE3_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X32,SSE3_32,SSE3_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,SSE3_64,SSE3_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,SSE3_64,SSE3_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X32,SSE2_32,SSE2_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X32,SSE2_32,SSE2_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,SSE2_64,SSE2_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,SSE2_64,SSE2_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse | FileCheck %s --check-prefixes=CHECK,X32,SSE_32,SSE_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse | FileCheck %s --check-prefixes=CHECK,X32,SSE_32,SSE_32_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X32,X87,X87_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X32,X87,X87_LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512DQVL,X86-AVX512-WIN,X86-AVX512DQVL-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512DQVL,X86-AVX512-LIN,X86-AVX512DQVL-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X64,X64-AVX512,X64-AVX512DQVL,X64-AVX512-WIN,X64-AVX512DQVL-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X86,X64-AVX512,X64-AVX512DQVL,X64-AVX512-LIN,X64-AVX512DQVL-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512DQ,X86-AVX512-WIN,X86-AVX512DQ-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512DQ,X86-AVX512-LIN,X86-AVX512DQ-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X64,X64-AVX512,X64-AVX512DQ,X64-AVX512-WIN,X64-AVX512DQ-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X86,X64-AVX512,X64-AVX512DQ,X64-AVX512-LIN,X64-AVX512DQ-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512F,X86-AVX512-WIN,X86-AVX512F-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512F,X86-AVX512-LIN,X86-AVX512F-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X64,X64-AVX512,X64-AVX512F,X64-AVX512-WIN,X64-AVX512F-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X86,X64-AVX512,X64-AVX512F,X64-AVX512-LIN,X64-AVX512F-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE3,X86-SSE-WIN,X86-SSE3-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE3,X86-SSE-LIN,X86-SSE3-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,X64-SSE,X64-SSE3,X64-SSE-WIN,X64-SSE3-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,X64-SSE,X64-SSE3,X64-SSE-LIN,X64-SSE3-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE2,X86-SSE-WIN,X86-SSE2-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE2,X86-SSE-LIN,X86-SSE2-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,X64-SSE,X64-SSE2,X64-SSE-WIN,X64-SSE2-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,X64-SSE,X64-SSE2,X64-SSE-LIN,X64-SSE2-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE1,X86-SSE-WIN,X86-SSE1-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE1,X86-SSE-LIN,X86-SSE1-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X86,X87,X87-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X86,X87,X87-LIN ; Check that scalar FP conversions to signed and unsigned int32 are using ; reasonable sequences, across platforms and target switches. define i32 @f_to_u32(float %a) nounwind { -; AVX512_32-LABEL: f_to_u32: -; AVX512_32: # %bb.0: -; AVX512_32-NEXT: vcvttss2usi {{[0-9]+}}(%esp), %eax -; AVX512_32-NEXT: retl -; -; AVX512_64-LABEL: f_to_u32: -; AVX512_64: # %bb.0: -; AVX512_64-NEXT: vcvttss2usi %xmm0, %eax -; AVX512_64-NEXT: retq -; -; SSE3_32_WIN-LABEL: f_to_u32: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE3_32_WIN-NEXT: movss %xmm0, (%esp) -; SSE3_32_WIN-NEXT: flds (%esp) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: f_to_u32: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE3_32_LIN-NEXT: movss %xmm0, (%esp) -; SSE3_32_LIN-NEXT: flds (%esp) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64-LABEL: f_to_u32: -; SSE3_64: # %bb.0: -; SSE3_64-NEXT: cvttss2si %xmm0, %rax -; SSE3_64-NEXT: # kill: def $eax killed $eax killed $rax -; SSE3_64-NEXT: retq -; -; SSE2_32-LABEL: f_to_u32: -; SSE2_32: # %bb.0: -; SSE2_32-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE2_32-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; SSE2_32-NEXT: movaps %xmm0, %xmm2 -; SSE2_32-NEXT: subss %xmm1, %xmm2 -; SSE2_32-NEXT: cvttss2si %xmm2, %ecx -; SSE2_32-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000 -; SSE2_32-NEXT: cvttss2si %xmm0, %eax -; SSE2_32-NEXT: ucomiss %xmm0, %xmm1 -; SSE2_32-NEXT: cmovbel %ecx, %eax -; SSE2_32-NEXT: retl -; -; SSE2_64-LABEL: f_to_u32: -; SSE2_64: # %bb.0: -; SSE2_64-NEXT: cvttss2si %xmm0, %rax -; SSE2_64-NEXT: # kill: def $eax killed $eax killed $rax -; SSE2_64-NEXT: retq -; -; SSE_32-LABEL: f_to_u32: -; SSE_32: # %bb.0: -; SSE_32-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE_32-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; SSE_32-NEXT: movaps %xmm0, %xmm2 -; SSE_32-NEXT: subss %xmm1, %xmm2 -; SSE_32-NEXT: cvttss2si %xmm2, %ecx -; SSE_32-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000 -; SSE_32-NEXT: cvttss2si %xmm0, %eax -; SSE_32-NEXT: ucomiss %xmm0, %xmm1 -; SSE_32-NEXT: cmovbel %ecx, %eax -; SSE_32-NEXT: retl -; -; X87_WIN-LABEL: f_to_u32: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: flds 8(%ebp) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: f_to_u32: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: flds {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-LABEL: f_to_u32: +; X86-AVX512: # %bb.0: +; X86-AVX512-NEXT: vcvttss2usi {{[0-9]+}}(%esp), %eax +; X86-AVX512-NEXT: retl +; +; X64-AVX512-LABEL: f_to_u32: +; X64-AVX512: # %bb.0: +; X64-AVX512-NEXT: vcvttss2usi %xmm0, %eax +; X64-AVX512-NEXT: retq +; +; X86-SSE3-WIN-LABEL: f_to_u32: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE3-WIN-NEXT: movss %xmm0, (%esp) +; X86-SSE3-WIN-NEXT: flds (%esp) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: f_to_u32: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE3-LIN-NEXT: movss %xmm0, (%esp) +; X86-SSE3-LIN-NEXT: flds (%esp) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE-LABEL: f_to_u32: +; X64-SSE: # %bb.0: +; X64-SSE-NEXT: cvttss2si %xmm0, %rax +; X64-SSE-NEXT: # kill: def $eax killed $eax killed $rax +; X64-SSE-NEXT: retq +; +; X86-SSE2-LABEL: f_to_u32: +; X86-SSE2: # %bb.0: +; X86-SSE2-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE2-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-SSE2-NEXT: movaps %xmm0, %xmm2 +; X86-SSE2-NEXT: subss %xmm1, %xmm2 +; X86-SSE2-NEXT: cvttss2si %xmm2, %ecx +; X86-SSE2-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000 +; X86-SSE2-NEXT: cvttss2si %xmm0, %eax +; X86-SSE2-NEXT: ucomiss %xmm0, %xmm1 +; X86-SSE2-NEXT: cmovbel %ecx, %eax +; X86-SSE2-NEXT: retl +; +; X86-SSE1-LABEL: f_to_u32: +; X86-SSE1: # %bb.0: +; X86-SSE1-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE1-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-SSE1-NEXT: movaps %xmm0, %xmm2 +; X86-SSE1-NEXT: subss %xmm1, %xmm2 +; X86-SSE1-NEXT: cvttss2si %xmm2, %ecx +; X86-SSE1-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000 +; X86-SSE1-NEXT: cvttss2si %xmm0, %eax +; X86-SSE1-NEXT: ucomiss %xmm0, %xmm1 +; X86-SSE1-NEXT: cmovbel %ecx, %eax +; X86-SSE1-NEXT: retl +; +; X87-WIN-LABEL: f_to_u32: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: flds 8(%ebp) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: f_to_u32: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: flds {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptoui float %a to i32 ret i32 %r } define i32 @f_to_s32(float %a) nounwind { -; AVX512_32-LABEL: f_to_s32: -; AVX512_32: # %bb.0: -; AVX512_32-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax -; AVX512_32-NEXT: retl -; -; AVX512_64-LABEL: f_to_s32: -; AVX512_64: # %bb.0: -; AVX512_64-NEXT: vcvttss2si %xmm0, %eax -; AVX512_64-NEXT: retq -; -; SSE3_32-LABEL: f_to_s32: -; SSE3_32: # %bb.0: -; SSE3_32-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax -; SSE3_32-NEXT: retl -; -; SSE3_64-LABEL: f_to_s32: -; SSE3_64: # %bb.0: -; SSE3_64-NEXT: cvttss2si %xmm0, %eax -; SSE3_64-NEXT: retq -; -; SSE2_32-LABEL: f_to_s32: -; SSE2_32: # %bb.0: -; SSE2_32-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax -; SSE2_32-NEXT: retl -; -; SSE2_64-LABEL: f_to_s32: -; SSE2_64: # %bb.0: -; SSE2_64-NEXT: cvttss2si %xmm0, %eax -; SSE2_64-NEXT: retq -; -; SSE_32-LABEL: f_to_s32: -; SSE_32: # %bb.0: -; SSE_32-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax -; SSE_32-NEXT: retl +; X86-AVX512-LABEL: f_to_s32: +; X86-AVX512: # %bb.0: +; X86-AVX512-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax +; X86-AVX512-NEXT: retl +; +; X64-AVX512-LABEL: f_to_s32: +; X64-AVX512: # %bb.0: +; X64-AVX512-NEXT: vcvttss2si %xmm0, %eax +; X64-AVX512-NEXT: retq +; +; X86-SSE-LABEL: f_to_s32: +; X86-SSE: # %bb.0: +; X86-SSE-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax +; X86-SSE-NEXT: retl +; +; X64-SSE-LABEL: f_to_s32: +; X64-SSE: # %bb.0: +; X64-SSE-NEXT: cvttss2si %xmm0, %eax +; X64-SSE-NEXT: retq ; ; X87-LABEL: f_to_s32: ; X87: # %bb.0: @@ -194,183 +173,172 @@ define i32 @f_to_s32(float %a) nounwind { } define i32 @d_to_u32(double %a) nounwind { -; AVX512_32-LABEL: d_to_u32: -; AVX512_32: # %bb.0: -; AVX512_32-NEXT: vcvttsd2usi {{[0-9]+}}(%esp), %eax -; AVX512_32-NEXT: retl -; -; AVX512_64-LABEL: d_to_u32: -; AVX512_64: # %bb.0: -; AVX512_64-NEXT: vcvttsd2usi %xmm0, %eax -; AVX512_64-NEXT: retq -; -; SSE3_32_WIN-LABEL: d_to_u32: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE3_32_WIN-NEXT: movsd %xmm0, (%esp) -; SSE3_32_WIN-NEXT: fldl (%esp) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: d_to_u32: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE3_32_LIN-NEXT: movsd %xmm0, (%esp) -; SSE3_32_LIN-NEXT: fldl (%esp) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64-LABEL: d_to_u32: -; SSE3_64: # %bb.0: -; SSE3_64-NEXT: cvttsd2si %xmm0, %rax -; SSE3_64-NEXT: # kill: def $eax killed $eax killed $rax -; SSE3_64-NEXT: retq -; -; SSE2_32-LABEL: d_to_u32: -; SSE2_32: # %bb.0: -; SSE2_32-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE2_32-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero -; SSE2_32-NEXT: movapd %xmm0, %xmm2 -; SSE2_32-NEXT: subsd %xmm1, %xmm2 -; SSE2_32-NEXT: cvttsd2si %xmm2, %ecx -; SSE2_32-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000 -; SSE2_32-NEXT: cvttsd2si %xmm0, %eax -; SSE2_32-NEXT: ucomisd %xmm0, %xmm1 -; SSE2_32-NEXT: cmovbel %ecx, %eax -; SSE2_32-NEXT: retl -; -; SSE2_64-LABEL: d_to_u32: -; SSE2_64: # %bb.0: -; SSE2_64-NEXT: cvttsd2si %xmm0, %rax -; SSE2_64-NEXT: # kill: def $eax killed $eax killed $rax -; SSE2_64-NEXT: retq -; -; SSE_32_WIN-LABEL: d_to_u32: -; SSE_32_WIN: # %bb.0: -; SSE_32_WIN-NEXT: pushl %ebp -; SSE_32_WIN-NEXT: movl %esp, %ebp -; SSE_32_WIN-NEXT: andl $-8, %esp -; SSE_32_WIN-NEXT: subl $16, %esp -; SSE_32_WIN-NEXT: fldl 8(%ebp) -; SSE_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE_32_WIN-NEXT: movl %ebp, %esp -; SSE_32_WIN-NEXT: popl %ebp -; SSE_32_WIN-NEXT: retl -; -; SSE_32_LIN-LABEL: d_to_u32: -; SSE_32_LIN: # %bb.0: -; SSE_32_LIN-NEXT: subl $20, %esp -; SSE_32_LIN-NEXT: fldl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE_32_LIN-NEXT: addl $20, %esp -; SSE_32_LIN-NEXT: retl -; -; X87_WIN-LABEL: d_to_u32: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: fldl 8(%ebp) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: d_to_u32: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: fldl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-LABEL: d_to_u32: +; X86-AVX512: # %bb.0: +; X86-AVX512-NEXT: vcvttsd2usi {{[0-9]+}}(%esp), %eax +; X86-AVX512-NEXT: retl +; +; X64-AVX512-LABEL: d_to_u32: +; X64-AVX512: # %bb.0: +; X64-AVX512-NEXT: vcvttsd2usi %xmm0, %eax +; X64-AVX512-NEXT: retq +; +; X86-SSE3-WIN-LABEL: d_to_u32: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE3-WIN-NEXT: movsd %xmm0, (%esp) +; X86-SSE3-WIN-NEXT: fldl (%esp) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: d_to_u32: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE3-LIN-NEXT: movsd %xmm0, (%esp) +; X86-SSE3-LIN-NEXT: fldl (%esp) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE-LABEL: d_to_u32: +; X64-SSE: # %bb.0: +; X64-SSE-NEXT: cvttsd2si %xmm0, %rax +; X64-SSE-NEXT: # kill: def $eax killed $eax killed $rax +; X64-SSE-NEXT: retq +; +; X86-SSE2-LABEL: d_to_u32: +; X86-SSE2: # %bb.0: +; X86-SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE2-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero +; X86-SSE2-NEXT: movapd %xmm0, %xmm2 +; X86-SSE2-NEXT: subsd %xmm1, %xmm2 +; X86-SSE2-NEXT: cvttsd2si %xmm2, %ecx +; X86-SSE2-NEXT: xorl $-2147483648, %ecx # imm = 0x80000000 +; X86-SSE2-NEXT: cvttsd2si %xmm0, %eax +; X86-SSE2-NEXT: ucomisd %xmm0, %xmm1 +; X86-SSE2-NEXT: cmovbel %ecx, %eax +; X86-SSE2-NEXT: retl +; +; X86-SSE1-WIN-LABEL: d_to_u32: +; X86-SSE1-WIN: # %bb.0: +; X86-SSE1-WIN-NEXT: pushl %ebp +; X86-SSE1-WIN-NEXT: movl %esp, %ebp +; X86-SSE1-WIN-NEXT: andl $-8, %esp +; X86-SSE1-WIN-NEXT: subl $16, %esp +; X86-SSE1-WIN-NEXT: fldl 8(%ebp) +; X86-SSE1-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE1-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE1-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE1-WIN-NEXT: movl %ebp, %esp +; X86-SSE1-WIN-NEXT: popl %ebp +; X86-SSE1-WIN-NEXT: retl +; +; X86-SSE1-LIN-LABEL: d_to_u32: +; X86-SSE1-LIN: # %bb.0: +; X86-SSE1-LIN-NEXT: subl $20, %esp +; X86-SSE1-LIN-NEXT: fldl {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE1-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE1-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE1-LIN-NEXT: addl $20, %esp +; X86-SSE1-LIN-NEXT: retl +; +; X87-WIN-LABEL: d_to_u32: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: fldl 8(%ebp) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: d_to_u32: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: fldl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptoui double %a to i32 ret i32 %r } define i32 @d_to_s32(double %a) nounwind { -; AVX512_32-LABEL: d_to_s32: -; AVX512_32: # %bb.0: -; AVX512_32-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax -; AVX512_32-NEXT: retl -; -; AVX512_64-LABEL: d_to_s32: -; AVX512_64: # %bb.0: -; AVX512_64-NEXT: vcvttsd2si %xmm0, %eax -; AVX512_64-NEXT: retq -; -; SSE3_32-LABEL: d_to_s32: -; SSE3_32: # %bb.0: -; SSE3_32-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax -; SSE3_32-NEXT: retl -; -; SSE3_64-LABEL: d_to_s32: -; SSE3_64: # %bb.0: -; SSE3_64-NEXT: cvttsd2si %xmm0, %eax -; SSE3_64-NEXT: retq -; -; SSE2_32-LABEL: d_to_s32: -; SSE2_32: # %bb.0: -; SSE2_32-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax -; SSE2_32-NEXT: retl -; -; SSE2_64-LABEL: d_to_s32: -; SSE2_64: # %bb.0: -; SSE2_64-NEXT: cvttsd2si %xmm0, %eax -; SSE2_64-NEXT: retq -; -; SSE_32-LABEL: d_to_s32: -; SSE_32: # %bb.0: -; SSE_32-NEXT: subl $8, %esp -; SSE_32-NEXT: fldl {{[0-9]+}}(%esp) -; SSE_32-NEXT: fnstcw (%esp) -; SSE_32-NEXT: movzwl (%esp), %eax -; SSE_32-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE_32-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE_32-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32-NEXT: fistpl {{[0-9]+}}(%esp) -; SSE_32-NEXT: fldcw (%esp) -; SSE_32-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE_32-NEXT: addl $8, %esp -; SSE_32-NEXT: retl +; X86-AVX512-LABEL: d_to_s32: +; X86-AVX512: # %bb.0: +; X86-AVX512-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax +; X86-AVX512-NEXT: retl +; +; X64-AVX512-LABEL: d_to_s32: +; X64-AVX512: # %bb.0: +; X64-AVX512-NEXT: vcvttsd2si %xmm0, %eax +; X64-AVX512-NEXT: retq +; +; X86-SSE3-LABEL: d_to_s32: +; X86-SSE3: # %bb.0: +; X86-SSE3-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax +; X86-SSE3-NEXT: retl +; +; X64-SSE-LABEL: d_to_s32: +; X64-SSE: # %bb.0: +; X64-SSE-NEXT: cvttsd2si %xmm0, %eax +; X64-SSE-NEXT: retq +; +; X86-SSE2-LABEL: d_to_s32: +; X86-SSE2: # %bb.0: +; X86-SSE2-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax +; X86-SSE2-NEXT: retl +; +; X86-SSE1-LABEL: d_to_s32: +; X86-SSE1: # %bb.0: +; X86-SSE1-NEXT: subl $8, %esp +; X86-SSE1-NEXT: fldl {{[0-9]+}}(%esp) +; X86-SSE1-NEXT: fnstcw (%esp) +; X86-SSE1-NEXT: movzwl (%esp), %eax +; X86-SSE1-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE1-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE1-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-NEXT: fistpl {{[0-9]+}}(%esp) +; X86-SSE1-NEXT: fldcw (%esp) +; X86-SSE1-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE1-NEXT: addl $8, %esp +; X86-SSE1-NEXT: retl ; ; X87-LABEL: d_to_s32: ; X87: # %bb.0: @@ -391,323 +359,323 @@ define i32 @d_to_s32(double %a) nounwind { } define i32 @x_to_u32(x86_fp80 %a) nounwind { -; AVX512_32_WIN-LABEL: x_to_u32: -; AVX512_32_WIN: # %bb.0: -; AVX512_32_WIN-NEXT: pushl %ebp -; AVX512_32_WIN-NEXT: movl %esp, %ebp -; AVX512_32_WIN-NEXT: andl $-8, %esp -; AVX512_32_WIN-NEXT: subl $8, %esp -; AVX512_32_WIN-NEXT: fldt 8(%ebp) -; AVX512_32_WIN-NEXT: fisttpll (%esp) -; AVX512_32_WIN-NEXT: movl (%esp), %eax -; AVX512_32_WIN-NEXT: movl %ebp, %esp -; AVX512_32_WIN-NEXT: popl %ebp -; AVX512_32_WIN-NEXT: retl -; -; AVX512_32_LIN-LABEL: x_to_u32: -; AVX512_32_LIN: # %bb.0: -; AVX512_32_LIN-NEXT: subl $12, %esp -; AVX512_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; AVX512_32_LIN-NEXT: fisttpll (%esp) -; AVX512_32_LIN-NEXT: movl (%esp), %eax -; AVX512_32_LIN-NEXT: addl $12, %esp -; AVX512_32_LIN-NEXT: retl -; -; AVX512_64_WIN-LABEL: x_to_u32: -; AVX512_64_WIN: # %bb.0: -; AVX512_64_WIN-NEXT: pushq %rax -; AVX512_64_WIN-NEXT: fldt (%rcx) -; AVX512_64_WIN-NEXT: fisttpll (%rsp) -; AVX512_64_WIN-NEXT: movl (%rsp), %eax -; AVX512_64_WIN-NEXT: popq %rcx -; AVX512_64_WIN-NEXT: retq -; -; AVX512_64_LIN-LABEL: x_to_u32: -; AVX512_64_LIN: # %bb.0: -; AVX512_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; AVX512_64_LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) -; AVX512_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax -; AVX512_64_LIN-NEXT: retq -; -; SSE3_32_WIN-LABEL: x_to_u32: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: fldt 8(%ebp) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: x_to_u32: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64_WIN-LABEL: x_to_u32: -; SSE3_64_WIN: # %bb.0: -; SSE3_64_WIN-NEXT: pushq %rax -; SSE3_64_WIN-NEXT: fldt (%rcx) -; SSE3_64_WIN-NEXT: fisttpll (%rsp) -; SSE3_64_WIN-NEXT: movl (%rsp), %eax -; SSE3_64_WIN-NEXT: popq %rcx -; SSE3_64_WIN-NEXT: retq -; -; SSE3_64_LIN-LABEL: x_to_u32: -; SSE3_64_LIN: # %bb.0: -; SSE3_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; SSE3_64_LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) -; SSE3_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax -; SSE3_64_LIN-NEXT: retq -; -; SSE2_32_WIN-LABEL: x_to_u32: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl %ebp -; SSE2_32_WIN-NEXT: movl %esp, %ebp -; SSE2_32_WIN-NEXT: andl $-8, %esp -; SSE2_32_WIN-NEXT: subl $16, %esp -; SSE2_32_WIN-NEXT: fldt 8(%ebp) -; SSE2_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: movl %ebp, %esp -; SSE2_32_WIN-NEXT: popl %ebp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: x_to_u32: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $20, %esp -; SSE2_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: addl $20, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64_WIN-LABEL: x_to_u32: -; SSE2_64_WIN: # %bb.0: -; SSE2_64_WIN-NEXT: subq $16, %rsp -; SSE2_64_WIN-NEXT: fldt (%rcx) -; SSE2_64_WIN-NEXT: fnstcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: movzwl {{[0-9]+}}(%rsp), %eax -; SSE2_64_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_64_WIN-NEXT: movw %ax, {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fistpll {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax -; SSE2_64_WIN-NEXT: addq $16, %rsp -; SSE2_64_WIN-NEXT: retq -; -; SSE2_64_LIN-LABEL: x_to_u32: -; SSE2_64_LIN: # %bb.0: -; SSE2_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; SSE2_64_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_64_LIN-NEXT: movw %ax, -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fistpll -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax -; SSE2_64_LIN-NEXT: retq -; -; SSE_32_WIN-LABEL: x_to_u32: -; SSE_32_WIN: # %bb.0: -; SSE_32_WIN-NEXT: pushl %ebp -; SSE_32_WIN-NEXT: movl %esp, %ebp -; SSE_32_WIN-NEXT: andl $-8, %esp -; SSE_32_WIN-NEXT: subl $16, %esp -; SSE_32_WIN-NEXT: fldt 8(%ebp) -; SSE_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE_32_WIN-NEXT: movl %ebp, %esp -; SSE_32_WIN-NEXT: popl %ebp -; SSE_32_WIN-NEXT: retl -; -; SSE_32_LIN-LABEL: x_to_u32: -; SSE_32_LIN: # %bb.0: -; SSE_32_LIN-NEXT: subl $20, %esp -; SSE_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE_32_LIN-NEXT: addl $20, %esp -; SSE_32_LIN-NEXT: retl -; -; X87_WIN-LABEL: x_to_u32: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: fldt 8(%ebp) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: x_to_u32: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-WIN-LABEL: x_to_u32: +; X86-AVX512-WIN: # %bb.0: +; X86-AVX512-WIN-NEXT: pushl %ebp +; X86-AVX512-WIN-NEXT: movl %esp, %ebp +; X86-AVX512-WIN-NEXT: andl $-8, %esp +; X86-AVX512-WIN-NEXT: subl $8, %esp +; X86-AVX512-WIN-NEXT: fldt 8(%ebp) +; X86-AVX512-WIN-NEXT: fisttpll (%esp) +; X86-AVX512-WIN-NEXT: movl (%esp), %eax +; X86-AVX512-WIN-NEXT: movl %ebp, %esp +; X86-AVX512-WIN-NEXT: popl %ebp +; X86-AVX512-WIN-NEXT: retl +; +; X86-AVX512-LIN-LABEL: x_to_u32: +; X86-AVX512-LIN: # %bb.0: +; X86-AVX512-LIN-NEXT: subl $12, %esp +; X86-AVX512-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-AVX512-LIN-NEXT: fisttpll (%esp) +; X86-AVX512-LIN-NEXT: movl (%esp), %eax +; X86-AVX512-LIN-NEXT: addl $12, %esp +; X86-AVX512-LIN-NEXT: retl +; +; X64-AVX512-WIN-LABEL: x_to_u32: +; X64-AVX512-WIN: # %bb.0: +; X64-AVX512-WIN-NEXT: pushq %rax +; X64-AVX512-WIN-NEXT: fldt (%rcx) +; X64-AVX512-WIN-NEXT: fisttpll (%rsp) +; X64-AVX512-WIN-NEXT: movl (%rsp), %eax +; X64-AVX512-WIN-NEXT: popq %rcx +; X64-AVX512-WIN-NEXT: retq +; +; X64-AVX512-LIN-LABEL: x_to_u32: +; X64-AVX512-LIN: # %bb.0: +; X64-AVX512-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-AVX512-LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) +; X64-AVX512-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax +; X64-AVX512-LIN-NEXT: retq +; +; X86-SSE3-WIN-LABEL: x_to_u32: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: fldt 8(%ebp) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: x_to_u32: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE3-WIN-LABEL: x_to_u32: +; X64-SSE3-WIN: # %bb.0: +; X64-SSE3-WIN-NEXT: pushq %rax +; X64-SSE3-WIN-NEXT: fldt (%rcx) +; X64-SSE3-WIN-NEXT: fisttpll (%rsp) +; X64-SSE3-WIN-NEXT: movl (%rsp), %eax +; X64-SSE3-WIN-NEXT: popq %rcx +; X64-SSE3-WIN-NEXT: retq +; +; X64-SSE3-LIN-LABEL: x_to_u32: +; X64-SSE3-LIN: # %bb.0: +; X64-SSE3-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-SSE3-LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) +; X64-SSE3-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax +; X64-SSE3-LIN-NEXT: retq +; +; X86-SSE2-WIN-LABEL: x_to_u32: +; X86-SSE2-WIN: # %bb.0: +; X86-SSE2-WIN-NEXT: pushl %ebp +; X86-SSE2-WIN-NEXT: movl %esp, %ebp +; X86-SSE2-WIN-NEXT: andl $-8, %esp +; X86-SSE2-WIN-NEXT: subl $16, %esp +; X86-SSE2-WIN-NEXT: fldt 8(%ebp) +; X86-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: movl %ebp, %esp +; X86-SSE2-WIN-NEXT: popl %ebp +; X86-SSE2-WIN-NEXT: retl +; +; X86-SSE2-LIN-LABEL: x_to_u32: +; X86-SSE2-LIN: # %bb.0: +; X86-SSE2-LIN-NEXT: subl $20, %esp +; X86-SSE2-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: addl $20, %esp +; X86-SSE2-LIN-NEXT: retl +; +; X64-SSE2-WIN-LABEL: x_to_u32: +; X64-SSE2-WIN: # %bb.0: +; X64-SSE2-WIN-NEXT: subq $16, %rsp +; X64-SSE2-WIN-NEXT: fldt (%rcx) +; X64-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%rsp), %eax +; X64-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X64-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax +; X64-SSE2-WIN-NEXT: addq $16, %rsp +; X64-SSE2-WIN-NEXT: retq +; +; X64-SSE2-LIN-LABEL: x_to_u32: +; X64-SSE2-LIN: # %bb.0: +; X64-SSE2-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax +; X64-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X64-SSE2-LIN-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fistpll -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax +; X64-SSE2-LIN-NEXT: retq +; +; X86-SSE1-WIN-LABEL: x_to_u32: +; X86-SSE1-WIN: # %bb.0: +; X86-SSE1-WIN-NEXT: pushl %ebp +; X86-SSE1-WIN-NEXT: movl %esp, %ebp +; X86-SSE1-WIN-NEXT: andl $-8, %esp +; X86-SSE1-WIN-NEXT: subl $16, %esp +; X86-SSE1-WIN-NEXT: fldt 8(%ebp) +; X86-SSE1-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE1-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE1-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE1-WIN-NEXT: movl %ebp, %esp +; X86-SSE1-WIN-NEXT: popl %ebp +; X86-SSE1-WIN-NEXT: retl +; +; X86-SSE1-LIN-LABEL: x_to_u32: +; X86-SSE1-LIN: # %bb.0: +; X86-SSE1-LIN-NEXT: subl $20, %esp +; X86-SSE1-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE1-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE1-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE1-LIN-NEXT: addl $20, %esp +; X86-SSE1-LIN-NEXT: retl +; +; X87-WIN-LABEL: x_to_u32: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: fldt 8(%ebp) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: x_to_u32: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptoui x86_fp80 %a to i32 ret i32 %r } define i32 @x_to_s32(x86_fp80 %a) nounwind { -; AVX512_32-LABEL: x_to_s32: -; AVX512_32: # %bb.0: -; AVX512_32-NEXT: pushl %eax -; AVX512_32-NEXT: fldt {{[0-9]+}}(%esp) -; AVX512_32-NEXT: fisttpl (%esp) -; AVX512_32-NEXT: movl (%esp), %eax -; AVX512_32-NEXT: popl %ecx -; AVX512_32-NEXT: retl -; -; AVX512_64_WIN-LABEL: x_to_s32: -; AVX512_64_WIN: # %bb.0: -; AVX512_64_WIN-NEXT: pushq %rax -; AVX512_64_WIN-NEXT: fldt (%rcx) -; AVX512_64_WIN-NEXT: fisttpl {{[0-9]+}}(%rsp) -; AVX512_64_WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax -; AVX512_64_WIN-NEXT: popq %rcx -; AVX512_64_WIN-NEXT: retq -; -; AVX512_64_LIN-LABEL: x_to_s32: -; AVX512_64_LIN: # %bb.0: -; AVX512_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; AVX512_64_LIN-NEXT: fisttpl -{{[0-9]+}}(%rsp) -; AVX512_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax -; AVX512_64_LIN-NEXT: retq -; -; SSE3_32-LABEL: x_to_s32: -; SSE3_32: # %bb.0: -; SSE3_32-NEXT: pushl %eax -; SSE3_32-NEXT: fldt {{[0-9]+}}(%esp) -; SSE3_32-NEXT: fisttpl (%esp) -; SSE3_32-NEXT: movl (%esp), %eax -; SSE3_32-NEXT: popl %ecx -; SSE3_32-NEXT: retl -; -; SSE3_64_WIN-LABEL: x_to_s32: -; SSE3_64_WIN: # %bb.0: -; SSE3_64_WIN-NEXT: pushq %rax -; SSE3_64_WIN-NEXT: fldt (%rcx) -; SSE3_64_WIN-NEXT: fisttpl {{[0-9]+}}(%rsp) -; SSE3_64_WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax -; SSE3_64_WIN-NEXT: popq %rcx -; SSE3_64_WIN-NEXT: retq -; -; SSE3_64_LIN-LABEL: x_to_s32: -; SSE3_64_LIN: # %bb.0: -; SSE3_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; SSE3_64_LIN-NEXT: fisttpl -{{[0-9]+}}(%rsp) -; SSE3_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax -; SSE3_64_LIN-NEXT: retq -; -; SSE2_32-LABEL: x_to_s32: -; SSE2_32: # %bb.0: -; SSE2_32-NEXT: subl $8, %esp -; SSE2_32-NEXT: fldt {{[0-9]+}}(%esp) -; SSE2_32-NEXT: fnstcw (%esp) -; SSE2_32-NEXT: movzwl (%esp), %eax -; SSE2_32-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32-NEXT: fistpl {{[0-9]+}}(%esp) -; SSE2_32-NEXT: fldcw (%esp) -; SSE2_32-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32-NEXT: addl $8, %esp -; SSE2_32-NEXT: retl -; -; SSE2_64_WIN-LABEL: x_to_s32: -; SSE2_64_WIN: # %bb.0: -; SSE2_64_WIN-NEXT: pushq %rax -; SSE2_64_WIN-NEXT: fldt (%rcx) -; SSE2_64_WIN-NEXT: fnstcw (%rsp) -; SSE2_64_WIN-NEXT: movzwl (%rsp), %eax -; SSE2_64_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_64_WIN-NEXT: movw %ax, {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fistpl {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fldcw (%rsp) -; SSE2_64_WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax -; SSE2_64_WIN-NEXT: popq %rcx -; SSE2_64_WIN-NEXT: retq -; -; SSE2_64_LIN-LABEL: x_to_s32: -; SSE2_64_LIN: # %bb.0: -; SSE2_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; SSE2_64_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_64_LIN-NEXT: movw %ax, -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fistpl -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax -; SSE2_64_LIN-NEXT: retq -; -; SSE_32-LABEL: x_to_s32: -; SSE_32: # %bb.0: -; SSE_32-NEXT: subl $8, %esp -; SSE_32-NEXT: fldt {{[0-9]+}}(%esp) -; SSE_32-NEXT: fnstcw (%esp) -; SSE_32-NEXT: movzwl (%esp), %eax -; SSE_32-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE_32-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE_32-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE_32-NEXT: fistpl {{[0-9]+}}(%esp) -; SSE_32-NEXT: fldcw (%esp) -; SSE_32-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE_32-NEXT: addl $8, %esp -; SSE_32-NEXT: retl +; X86-AVX512-LABEL: x_to_s32: +; X86-AVX512: # %bb.0: +; X86-AVX512-NEXT: pushl %eax +; X86-AVX512-NEXT: fldt {{[0-9]+}}(%esp) +; X86-AVX512-NEXT: fisttpl (%esp) +; X86-AVX512-NEXT: movl (%esp), %eax +; X86-AVX512-NEXT: popl %ecx +; X86-AVX512-NEXT: retl +; +; X64-AVX512-WIN-LABEL: x_to_s32: +; X64-AVX512-WIN: # %bb.0: +; X64-AVX512-WIN-NEXT: pushq %rax +; X64-AVX512-WIN-NEXT: fldt (%rcx) +; X64-AVX512-WIN-NEXT: fisttpl {{[0-9]+}}(%rsp) +; X64-AVX512-WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax +; X64-AVX512-WIN-NEXT: popq %rcx +; X64-AVX512-WIN-NEXT: retq +; +; X64-AVX512-LIN-LABEL: x_to_s32: +; X64-AVX512-LIN: # %bb.0: +; X64-AVX512-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-AVX512-LIN-NEXT: fisttpl -{{[0-9]+}}(%rsp) +; X64-AVX512-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax +; X64-AVX512-LIN-NEXT: retq +; +; X86-SSE3-LABEL: x_to_s32: +; X86-SSE3: # %bb.0: +; X86-SSE3-NEXT: pushl %eax +; X86-SSE3-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE3-NEXT: fisttpl (%esp) +; X86-SSE3-NEXT: movl (%esp), %eax +; X86-SSE3-NEXT: popl %ecx +; X86-SSE3-NEXT: retl +; +; X64-SSE3-WIN-LABEL: x_to_s32: +; X64-SSE3-WIN: # %bb.0: +; X64-SSE3-WIN-NEXT: pushq %rax +; X64-SSE3-WIN-NEXT: fldt (%rcx) +; X64-SSE3-WIN-NEXT: fisttpl {{[0-9]+}}(%rsp) +; X64-SSE3-WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax +; X64-SSE3-WIN-NEXT: popq %rcx +; X64-SSE3-WIN-NEXT: retq +; +; X64-SSE3-LIN-LABEL: x_to_s32: +; X64-SSE3-LIN: # %bb.0: +; X64-SSE3-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-SSE3-LIN-NEXT: fisttpl -{{[0-9]+}}(%rsp) +; X64-SSE3-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax +; X64-SSE3-LIN-NEXT: retq +; +; X86-SSE2-LABEL: x_to_s32: +; X86-SSE2: # %bb.0: +; X86-SSE2-NEXT: subl $8, %esp +; X86-SSE2-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE2-NEXT: fnstcw (%esp) +; X86-SSE2-NEXT: movzwl (%esp), %eax +; X86-SSE2-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-NEXT: fistpl {{[0-9]+}}(%esp) +; X86-SSE2-NEXT: fldcw (%esp) +; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-NEXT: addl $8, %esp +; X86-SSE2-NEXT: retl +; +; X64-SSE2-WIN-LABEL: x_to_s32: +; X64-SSE2-WIN: # %bb.0: +; X64-SSE2-WIN-NEXT: pushq %rax +; X64-SSE2-WIN-NEXT: fldt (%rcx) +; X64-SSE2-WIN-NEXT: fnstcw (%rsp) +; X64-SSE2-WIN-NEXT: movzwl (%rsp), %eax +; X64-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X64-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fistpl {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fldcw (%rsp) +; X64-SSE2-WIN-NEXT: movl {{[0-9]+}}(%rsp), %eax +; X64-SSE2-WIN-NEXT: popq %rcx +; X64-SSE2-WIN-NEXT: retq +; +; X64-SSE2-LIN-LABEL: x_to_s32: +; X64-SSE2-LIN: # %bb.0: +; X64-SSE2-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax +; X64-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X64-SSE2-LIN-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fistpl -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: movl -{{[0-9]+}}(%rsp), %eax +; X64-SSE2-LIN-NEXT: retq +; +; X86-SSE1-LABEL: x_to_s32: +; X86-SSE1: # %bb.0: +; X86-SSE1-NEXT: subl $8, %esp +; X86-SSE1-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE1-NEXT: fnstcw (%esp) +; X86-SSE1-NEXT: movzwl (%esp), %eax +; X86-SSE1-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE1-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE1-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE1-NEXT: fistpl {{[0-9]+}}(%esp) +; X86-SSE1-NEXT: fldcw (%esp) +; X86-SSE1-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE1-NEXT: addl $8, %esp +; X86-SSE1-NEXT: retl ; ; X87-LABEL: x_to_s32: ; X87: # %bb.0: @@ -728,297 +696,185 @@ define i32 @x_to_s32(x86_fp80 %a) nounwind { } define i32 @t_to_u32(fp128 %a) nounwind { -; AVX512_32_WIN-LABEL: t_to_u32: -; AVX512_32_WIN: # %bb.0: -; AVX512_32_WIN-NEXT: subl $16, %esp -; AVX512_32_WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0 -; AVX512_32_WIN-NEXT: vmovups %xmm0, (%esp) -; AVX512_32_WIN-NEXT: calll ___fixunstfsi -; AVX512_32_WIN-NEXT: addl $16, %esp -; AVX512_32_WIN-NEXT: retl -; -; AVX512_32_LIN-LABEL: t_to_u32: -; AVX512_32_LIN: # %bb.0: -; AVX512_32_LIN-NEXT: subl $28, %esp -; AVX512_32_LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0 -; AVX512_32_LIN-NEXT: vmovups %xmm0, (%esp) -; AVX512_32_LIN-NEXT: calll __fixunstfsi -; AVX512_32_LIN-NEXT: addl $28, %esp -; AVX512_32_LIN-NEXT: retl -; -; AVX512_64_WIN-LABEL: t_to_u32: -; AVX512_64_WIN: # %bb.0: -; AVX512_64_WIN-NEXT: subq $40, %rsp -; AVX512_64_WIN-NEXT: callq __fixunstfsi -; AVX512_64_WIN-NEXT: addq $40, %rsp -; AVX512_64_WIN-NEXT: retq -; -; AVX512_64_LIN-LABEL: t_to_u32: -; AVX512_64_LIN: # %bb.0: -; AVX512_64_LIN-NEXT: pushq %rax -; AVX512_64_LIN-NEXT: callq __fixunstfsi -; AVX512_64_LIN-NEXT: popq %rcx -; AVX512_64_LIN-NEXT: retq -; -; SSE3_32_WIN-LABEL: t_to_u32: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: calll ___fixunstfsi -; SSE3_32_WIN-NEXT: addl $16, %esp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: t_to_u32: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: calll __fixunstfsi -; SSE3_32_LIN-NEXT: addl $28, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64_WIN-LABEL: t_to_u32: -; SSE3_64_WIN: # %bb.0: -; SSE3_64_WIN-NEXT: subq $40, %rsp -; SSE3_64_WIN-NEXT: callq __fixunstfsi -; SSE3_64_WIN-NEXT: addq $40, %rsp -; SSE3_64_WIN-NEXT: retq -; -; SSE3_64_LIN-LABEL: t_to_u32: -; SSE3_64_LIN: # %bb.0: -; SSE3_64_LIN-NEXT: pushq %rax -; SSE3_64_LIN-NEXT: callq __fixunstfsi -; SSE3_64_LIN-NEXT: popq %rcx -; SSE3_64_LIN-NEXT: retq -; -; SSE2_32_WIN-LABEL: t_to_u32: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: calll ___fixunstfsi -; SSE2_32_WIN-NEXT: addl $16, %esp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: t_to_u32: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $12, %esp -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: calll __fixunstfsi -; SSE2_32_LIN-NEXT: addl $28, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64_WIN-LABEL: t_to_u32: -; SSE2_64_WIN: # %bb.0: -; SSE2_64_WIN-NEXT: subq $40, %rsp -; SSE2_64_WIN-NEXT: callq __fixunstfsi -; SSE2_64_WIN-NEXT: addq $40, %rsp -; SSE2_64_WIN-NEXT: retq -; -; SSE2_64_LIN-LABEL: t_to_u32: -; SSE2_64_LIN: # %bb.0: -; SSE2_64_LIN-NEXT: pushq %rax -; SSE2_64_LIN-NEXT: callq __fixunstfsi -; SSE2_64_LIN-NEXT: popq %rcx -; SSE2_64_LIN-NEXT: retq -; -; SSE_32_WIN-LABEL: t_to_u32: -; SSE_32_WIN: # %bb.0: -; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: calll ___fixunstfsi -; SSE_32_WIN-NEXT: addl $16, %esp -; SSE_32_WIN-NEXT: retl -; -; SSE_32_LIN-LABEL: t_to_u32: -; SSE_32_LIN: # %bb.0: -; SSE_32_LIN-NEXT: subl $12, %esp -; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: calll __fixunstfsi -; SSE_32_LIN-NEXT: addl $28, %esp -; SSE_32_LIN-NEXT: retl -; -; X87_WIN-LABEL: t_to_u32: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: calll ___fixunstfsi -; X87_WIN-NEXT: addl $16, %esp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: t_to_u32: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $12, %esp -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: calll __fixunstfsi -; X87_LIN-NEXT: addl $28, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-WIN-LABEL: t_to_u32: +; X86-AVX512-WIN: # %bb.0: +; X86-AVX512-WIN-NEXT: subl $16, %esp +; X86-AVX512-WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0 +; X86-AVX512-WIN-NEXT: vmovups %xmm0, (%esp) +; X86-AVX512-WIN-NEXT: calll ___fixunstfsi +; X86-AVX512-WIN-NEXT: addl $16, %esp +; X86-AVX512-WIN-NEXT: retl +; +; X86-AVX512-LIN-LABEL: t_to_u32: +; X86-AVX512-LIN: # %bb.0: +; X86-AVX512-LIN-NEXT: subl $28, %esp +; X86-AVX512-LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0 +; X86-AVX512-LIN-NEXT: vmovups %xmm0, (%esp) +; X86-AVX512-LIN-NEXT: calll __fixunstfsi +; X86-AVX512-LIN-NEXT: addl $28, %esp +; X86-AVX512-LIN-NEXT: retl +; +; X64-AVX512-WIN-LABEL: t_to_u32: +; X64-AVX512-WIN: # %bb.0: +; X64-AVX512-WIN-NEXT: subq $40, %rsp +; X64-AVX512-WIN-NEXT: callq __fixunstfsi +; X64-AVX512-WIN-NEXT: addq $40, %rsp +; X64-AVX512-WIN-NEXT: retq +; +; X64-AVX512-LIN-LABEL: t_to_u32: +; X64-AVX512-LIN: # %bb.0: +; X64-AVX512-LIN-NEXT: pushq %rax +; X64-AVX512-LIN-NEXT: callq __fixunstfsi +; X64-AVX512-LIN-NEXT: popq %rcx +; X64-AVX512-LIN-NEXT: retq +; +; X86-SSE-WIN-LABEL: t_to_u32: +; X86-SSE-WIN: # %bb.0: +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: calll ___fixunstfsi +; X86-SSE-WIN-NEXT: addl $16, %esp +; X86-SSE-WIN-NEXT: retl +; +; X86-SSE-LIN-LABEL: t_to_u32: +; X86-SSE-LIN: # %bb.0: +; X86-SSE-LIN-NEXT: subl $12, %esp +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: calll __fixunstfsi +; X86-SSE-LIN-NEXT: addl $28, %esp +; X86-SSE-LIN-NEXT: retl +; +; X64-SSE-WIN-LABEL: t_to_u32: +; X64-SSE-WIN: # %bb.0: +; X64-SSE-WIN-NEXT: subq $40, %rsp +; X64-SSE-WIN-NEXT: callq __fixunstfsi +; X64-SSE-WIN-NEXT: addq $40, %rsp +; X64-SSE-WIN-NEXT: retq +; +; X64-SSE-LIN-LABEL: t_to_u32: +; X64-SSE-LIN: # %bb.0: +; X64-SSE-LIN-NEXT: pushq %rax +; X64-SSE-LIN-NEXT: callq __fixunstfsi +; X64-SSE-LIN-NEXT: popq %rcx +; X64-SSE-LIN-NEXT: retq +; +; X87-WIN-LABEL: t_to_u32: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: calll ___fixunstfsi +; X87-WIN-NEXT: addl $16, %esp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: t_to_u32: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $12, %esp +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: calll __fixunstfsi +; X87-LIN-NEXT: addl $28, %esp +; X87-LIN-NEXT: retl %r = fptoui fp128 %a to i32 ret i32 %r } define i32 @t_to_s32(fp128 %a) nounwind { -; AVX512_32_WIN-LABEL: t_to_s32: -; AVX512_32_WIN: # %bb.0: -; AVX512_32_WIN-NEXT: subl $16, %esp -; AVX512_32_WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0 -; AVX512_32_WIN-NEXT: vmovups %xmm0, (%esp) -; AVX512_32_WIN-NEXT: calll ___fixtfsi -; AVX512_32_WIN-NEXT: addl $16, %esp -; AVX512_32_WIN-NEXT: retl -; -; AVX512_32_LIN-LABEL: t_to_s32: -; AVX512_32_LIN: # %bb.0: -; AVX512_32_LIN-NEXT: subl $28, %esp -; AVX512_32_LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0 -; AVX512_32_LIN-NEXT: vmovups %xmm0, (%esp) -; AVX512_32_LIN-NEXT: calll __fixtfsi -; AVX512_32_LIN-NEXT: addl $28, %esp -; AVX512_32_LIN-NEXT: retl -; -; AVX512_64_WIN-LABEL: t_to_s32: -; AVX512_64_WIN: # %bb.0: -; AVX512_64_WIN-NEXT: subq $40, %rsp -; AVX512_64_WIN-NEXT: callq __fixtfsi -; AVX512_64_WIN-NEXT: addq $40, %rsp -; AVX512_64_WIN-NEXT: retq -; -; AVX512_64_LIN-LABEL: t_to_s32: -; AVX512_64_LIN: # %bb.0: -; AVX512_64_LIN-NEXT: pushq %rax -; AVX512_64_LIN-NEXT: callq __fixtfsi -; AVX512_64_LIN-NEXT: popq %rcx -; AVX512_64_LIN-NEXT: retq -; -; SSE3_32_WIN-LABEL: t_to_s32: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: calll ___fixtfsi -; SSE3_32_WIN-NEXT: addl $16, %esp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: t_to_s32: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: calll __fixtfsi -; SSE3_32_LIN-NEXT: addl $28, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64_WIN-LABEL: t_to_s32: -; SSE3_64_WIN: # %bb.0: -; SSE3_64_WIN-NEXT: subq $40, %rsp -; SSE3_64_WIN-NEXT: callq __fixtfsi -; SSE3_64_WIN-NEXT: addq $40, %rsp -; SSE3_64_WIN-NEXT: retq -; -; SSE3_64_LIN-LABEL: t_to_s32: -; SSE3_64_LIN: # %bb.0: -; SSE3_64_LIN-NEXT: pushq %rax -; SSE3_64_LIN-NEXT: callq __fixtfsi -; SSE3_64_LIN-NEXT: popq %rcx -; SSE3_64_LIN-NEXT: retq -; -; SSE2_32_WIN-LABEL: t_to_s32: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: calll ___fixtfsi -; SSE2_32_WIN-NEXT: addl $16, %esp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: t_to_s32: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $12, %esp -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: calll __fixtfsi -; SSE2_32_LIN-NEXT: addl $28, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64_WIN-LABEL: t_to_s32: -; SSE2_64_WIN: # %bb.0: -; SSE2_64_WIN-NEXT: subq $40, %rsp -; SSE2_64_WIN-NEXT: callq __fixtfsi -; SSE2_64_WIN-NEXT: addq $40, %rsp -; SSE2_64_WIN-NEXT: retq -; -; SSE2_64_LIN-LABEL: t_to_s32: -; SSE2_64_LIN: # %bb.0: -; SSE2_64_LIN-NEXT: pushq %rax -; SSE2_64_LIN-NEXT: callq __fixtfsi -; SSE2_64_LIN-NEXT: popq %rcx -; SSE2_64_LIN-NEXT: retq -; -; SSE_32_WIN-LABEL: t_to_s32: -; SSE_32_WIN: # %bb.0: -; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_WIN-NEXT: calll ___fixtfsi -; SSE_32_WIN-NEXT: addl $16, %esp -; SSE_32_WIN-NEXT: retl -; -; SSE_32_LIN-LABEL: t_to_s32: -; SSE_32_LIN: # %bb.0: -; SSE_32_LIN-NEXT: subl $12, %esp -; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE_32_LIN-NEXT: calll __fixtfsi -; SSE_32_LIN-NEXT: addl $28, %esp -; SSE_32_LIN-NEXT: retl -; -; X87_WIN-LABEL: t_to_s32: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: calll ___fixtfsi -; X87_WIN-NEXT: addl $16, %esp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: t_to_s32: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $12, %esp -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: calll __fixtfsi -; X87_LIN-NEXT: addl $28, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-WIN-LABEL: t_to_s32: +; X86-AVX512-WIN: # %bb.0: +; X86-AVX512-WIN-NEXT: subl $16, %esp +; X86-AVX512-WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0 +; X86-AVX512-WIN-NEXT: vmovups %xmm0, (%esp) +; X86-AVX512-WIN-NEXT: calll ___fixtfsi +; X86-AVX512-WIN-NEXT: addl $16, %esp +; X86-AVX512-WIN-NEXT: retl +; +; X86-AVX512-LIN-LABEL: t_to_s32: +; X86-AVX512-LIN: # %bb.0: +; X86-AVX512-LIN-NEXT: subl $28, %esp +; X86-AVX512-LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0 +; X86-AVX512-LIN-NEXT: vmovups %xmm0, (%esp) +; X86-AVX512-LIN-NEXT: calll __fixtfsi +; X86-AVX512-LIN-NEXT: addl $28, %esp +; X86-AVX512-LIN-NEXT: retl +; +; X64-AVX512-WIN-LABEL: t_to_s32: +; X64-AVX512-WIN: # %bb.0: +; X64-AVX512-WIN-NEXT: subq $40, %rsp +; X64-AVX512-WIN-NEXT: callq __fixtfsi +; X64-AVX512-WIN-NEXT: addq $40, %rsp +; X64-AVX512-WIN-NEXT: retq +; +; X64-AVX512-LIN-LABEL: t_to_s32: +; X64-AVX512-LIN: # %bb.0: +; X64-AVX512-LIN-NEXT: pushq %rax +; X64-AVX512-LIN-NEXT: callq __fixtfsi +; X64-AVX512-LIN-NEXT: popq %rcx +; X64-AVX512-LIN-NEXT: retq +; +; X86-SSE-WIN-LABEL: t_to_s32: +; X86-SSE-WIN: # %bb.0: +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: calll ___fixtfsi +; X86-SSE-WIN-NEXT: addl $16, %esp +; X86-SSE-WIN-NEXT: retl +; +; X86-SSE-LIN-LABEL: t_to_s32: +; X86-SSE-LIN: # %bb.0: +; X86-SSE-LIN-NEXT: subl $12, %esp +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: calll __fixtfsi +; X86-SSE-LIN-NEXT: addl $28, %esp +; X86-SSE-LIN-NEXT: retl +; +; X64-SSE-WIN-LABEL: t_to_s32: +; X64-SSE-WIN: # %bb.0: +; X64-SSE-WIN-NEXT: subq $40, %rsp +; X64-SSE-WIN-NEXT: callq __fixtfsi +; X64-SSE-WIN-NEXT: addq $40, %rsp +; X64-SSE-WIN-NEXT: retq +; +; X64-SSE-LIN-LABEL: t_to_s32: +; X64-SSE-LIN: # %bb.0: +; X64-SSE-LIN-NEXT: pushq %rax +; X64-SSE-LIN-NEXT: callq __fixtfsi +; X64-SSE-LIN-NEXT: popq %rcx +; X64-SSE-LIN-NEXT: retq +; +; X87-WIN-LABEL: t_to_s32: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: calll ___fixtfsi +; X87-WIN-NEXT: addl $16, %esp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: t_to_s32: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $12, %esp +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: calll __fixtfsi +; X87-LIN-NEXT: addl $28, %esp +; X87-LIN-NEXT: retl %r = fptosi fp128 %a to i32 ret i32 %r } diff --git a/llvm/test/CodeGen/X86/scalar-fp-to-i64.ll b/llvm/test/CodeGen/X86/scalar-fp-to-i64.ll index 30e4996..2405292 100644 --- a/llvm/test/CodeGen/X86/scalar-fp-to-i64.ll +++ b/llvm/test/CodeGen/X86/scalar-fp-to-i64.ll @@ -1,26 +1,26 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512DQVL_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512DQVL_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512DQVL_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512DQVL_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512DQ_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512DQ_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512DQ_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512DQ_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_WIN,AVX512F_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_32,AVX512_32_LIN,AVX512F_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X64,AVX512_64,AVX512_64_WIN,AVX512F_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X32,AVX512_64,AVX512_64_LIN,AVX512F_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X32,SSE3_32,SSE3_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X32,SSE3_32,SSE3_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,SSE3_64,SSE3_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,SSE3_64,SSE3_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X32,SSE2_32,SSE2_32_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X32,SSE2_32,SSE2_32_LIN -; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,SSE2_64,SSE2_64_WIN -; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,SSE2_64,SSE2_64_LIN -; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X32,X87,X87_WIN -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X32,X87,X87_LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512DQVL,X86-AVX512-WIN,X86-AVX512DQVL-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512DQVL,X86-AVX512-LIN,X86-AVX512DQVL-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X64,X64-AVX512,X64-AVX512DQVL,X64-AVX512-WIN,X64-AVX512DQVL-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq,+avx512vl | FileCheck %s --check-prefixes=CHECK,X86,X64-AVX512,X64-AVX512DQVL,X64-AVX512-LIN,X64-AVX512DQVL-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512DQ,X86-AVX512-WIN,X86-AVX512DQ-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512DQ,X86-AVX512-LIN,X86-AVX512DQ-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X64,X64-AVX512,X64-AVX512DQ,X64-AVX512-WIN,X64-AVX512DQ-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f,+avx512dq | FileCheck %s --check-prefixes=CHECK,X86,X64-AVX512,X64-AVX512DQ,X64-AVX512-LIN,X64-AVX512DQ-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512F,X86-AVX512-WIN,X86-AVX512F-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X86,X86-AVX512,X86-AVX512F,X86-AVX512-LIN,X86-AVX512F-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X64,X64-AVX512,X64-AVX512F,X64-AVX512-WIN,X64-AVX512F-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK,X86,X64-AVX512,X64-AVX512F,X64-AVX512-LIN,X64-AVX512F-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE3,X86-SSE-WIN,X86-SSE3-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE3,X86-SSE-LIN,X86-SSE3-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,X64-SSE,X64-SSE3,X64-SSE-WIN,X64-SSE3-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse3 | FileCheck %s --check-prefixes=CHECK,X64,X64-SSE,X64-SSE3,X64-SSE-LIN,X64-SSE3-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE2,X86-SSE-WIN,X86-SSE2-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X86,X86-SSE,X86-SSE2,X86-SSE-LIN,X86-SSE2-LIN +; RUN: llc < %s -mtriple=x86_64-pc-windows-msvc -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,X64-SSE,X64-SSE2,X64-SSE-WIN,X64-SSE2-WIN +; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=+sse2 | FileCheck %s --check-prefixes=CHECK,X64,X64-SSE,X64-SSE2,X64-SSE-LIN,X64-SSE2-LIN +; RUN: llc < %s -mtriple=i386-pc-windows-msvc -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X86,X87,X87-WIN +; RUN: llc < %s -mtriple=i386-unknown-linux-gnu -mattr=-sse | FileCheck %s --check-prefixes=CHECK,X86,X87,X87-LIN ; Check that scalar FP conversions to signed and unsigned int64 are using ; reasonable sequences, across platforms and target switches. @@ -39,1735 +39,1561 @@ ; SSE2 (cvtts[ds]2si) and vanilla X87 (fnstcw+fist, 32-bit only). define i64 @f_to_u64(float %a) nounwind { -; AVX512DQVL_32_WIN-LABEL: f_to_u64: -; AVX512DQVL_32_WIN: # %bb.0: -; AVX512DQVL_32_WIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512DQVL_32_WIN-NEXT: vcvttps2uqq %xmm0, %xmm0 -; AVX512DQVL_32_WIN-NEXT: vmovd %xmm0, %eax -; AVX512DQVL_32_WIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQVL_32_WIN-NEXT: retl -; -; AVX512DQVL_32_LIN-LABEL: f_to_u64: -; AVX512DQVL_32_LIN: # %bb.0: -; AVX512DQVL_32_LIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512DQVL_32_LIN-NEXT: vcvttps2uqq %xmm0, %xmm0 -; AVX512DQVL_32_LIN-NEXT: vmovd %xmm0, %eax -; AVX512DQVL_32_LIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQVL_32_LIN-NEXT: retl -; -; AVX512_64-LABEL: f_to_u64: -; AVX512_64: # %bb.0: -; AVX512_64-NEXT: vcvttss2usi %xmm0, %rax -; AVX512_64-NEXT: retq -; -; AVX512DQ_32_WIN-LABEL: f_to_u64: -; AVX512DQ_32_WIN: # %bb.0: -; AVX512DQ_32_WIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512DQ_32_WIN-NEXT: vcvttps2uqq %ymm0, %zmm0 -; AVX512DQ_32_WIN-NEXT: vmovd %xmm0, %eax -; AVX512DQ_32_WIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQ_32_WIN-NEXT: vzeroupper -; AVX512DQ_32_WIN-NEXT: retl -; -; AVX512DQ_32_LIN-LABEL: f_to_u64: -; AVX512DQ_32_LIN: # %bb.0: -; AVX512DQ_32_LIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512DQ_32_LIN-NEXT: vcvttps2uqq %ymm0, %zmm0 -; AVX512DQ_32_LIN-NEXT: vmovd %xmm0, %eax -; AVX512DQ_32_LIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQ_32_LIN-NEXT: vzeroupper -; AVX512DQ_32_LIN-NEXT: retl -; -; AVX512F_32_WIN-LABEL: f_to_u64: -; AVX512F_32_WIN: # %bb.0: -; AVX512F_32_WIN-NEXT: pushl %ebp -; AVX512F_32_WIN-NEXT: movl %esp, %ebp -; AVX512F_32_WIN-NEXT: andl $-8, %esp -; AVX512F_32_WIN-NEXT: subl $8, %esp -; AVX512F_32_WIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512F_32_WIN-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; AVX512F_32_WIN-NEXT: vcmpltss %xmm1, %xmm0, %k1 -; AVX512F_32_WIN-NEXT: vxorps %xmm2, %xmm2, %xmm2 -; AVX512F_32_WIN-NEXT: xorl %edx, %edx -; AVX512F_32_WIN-NEXT: vucomiss %xmm0, %xmm1 -; AVX512F_32_WIN-NEXT: vmovss %xmm2, %xmm1, %xmm1 {%k1} -; AVX512F_32_WIN-NEXT: vsubss %xmm1, %xmm0, %xmm0 -; AVX512F_32_WIN-NEXT: vmovss %xmm0, (%esp) -; AVX512F_32_WIN-NEXT: flds (%esp) -; AVX512F_32_WIN-NEXT: fisttpll (%esp) -; AVX512F_32_WIN-NEXT: setbe %dl -; AVX512F_32_WIN-NEXT: shll $31, %edx -; AVX512F_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; AVX512F_32_WIN-NEXT: movl (%esp), %eax -; AVX512F_32_WIN-NEXT: movl %ebp, %esp -; AVX512F_32_WIN-NEXT: popl %ebp -; AVX512F_32_WIN-NEXT: retl -; -; AVX512F_32_LIN-LABEL: f_to_u64: -; AVX512F_32_LIN: # %bb.0: -; AVX512F_32_LIN-NEXT: subl $12, %esp -; AVX512F_32_LIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512F_32_LIN-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; AVX512F_32_LIN-NEXT: vcmpltss %xmm1, %xmm0, %k1 -; AVX512F_32_LIN-NEXT: vxorps %xmm2, %xmm2, %xmm2 -; AVX512F_32_LIN-NEXT: xorl %edx, %edx -; AVX512F_32_LIN-NEXT: vucomiss %xmm0, %xmm1 -; AVX512F_32_LIN-NEXT: vmovss %xmm2, %xmm1, %xmm1 {%k1} -; AVX512F_32_LIN-NEXT: vsubss %xmm1, %xmm0, %xmm0 -; AVX512F_32_LIN-NEXT: vmovss %xmm0, (%esp) -; AVX512F_32_LIN-NEXT: flds (%esp) -; AVX512F_32_LIN-NEXT: fisttpll (%esp) -; AVX512F_32_LIN-NEXT: setbe %dl -; AVX512F_32_LIN-NEXT: shll $31, %edx -; AVX512F_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; AVX512F_32_LIN-NEXT: movl (%esp), %eax -; AVX512F_32_LIN-NEXT: addl $12, %esp -; AVX512F_32_LIN-NEXT: retl -; -; SSE3_32_WIN-LABEL: f_to_u64: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE3_32_WIN-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; SSE3_32_WIN-NEXT: movaps %xmm0, %xmm2 -; SSE3_32_WIN-NEXT: xorl %edx, %edx -; SSE3_32_WIN-NEXT: ucomiss %xmm0, %xmm1 -; SSE3_32_WIN-NEXT: cmpltss %xmm1, %xmm0 -; SSE3_32_WIN-NEXT: andnps %xmm1, %xmm0 -; SSE3_32_WIN-NEXT: subss %xmm0, %xmm2 -; SSE3_32_WIN-NEXT: movss %xmm2, (%esp) -; SSE3_32_WIN-NEXT: flds (%esp) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: setbe %dl -; SSE3_32_WIN-NEXT: shll $31, %edx -; SSE3_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: f_to_u64: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE3_32_LIN-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; SSE3_32_LIN-NEXT: movaps %xmm0, %xmm2 -; SSE3_32_LIN-NEXT: xorl %edx, %edx -; SSE3_32_LIN-NEXT: ucomiss %xmm0, %xmm1 -; SSE3_32_LIN-NEXT: cmpltss %xmm1, %xmm0 -; SSE3_32_LIN-NEXT: andnps %xmm1, %xmm0 -; SSE3_32_LIN-NEXT: subss %xmm0, %xmm2 -; SSE3_32_LIN-NEXT: movss %xmm2, (%esp) -; SSE3_32_LIN-NEXT: flds (%esp) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: setbe %dl -; SSE3_32_LIN-NEXT: shll $31, %edx -; SSE3_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64-LABEL: f_to_u64: -; SSE3_64: # %bb.0: -; SSE3_64-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; SSE3_64-NEXT: movaps %xmm0, %xmm2 -; SSE3_64-NEXT: subss %xmm1, %xmm2 -; SSE3_64-NEXT: cvttss2si %xmm2, %rax -; SSE3_64-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000 -; SSE3_64-NEXT: xorq %rax, %rcx -; SSE3_64-NEXT: cvttss2si %xmm0, %rax -; SSE3_64-NEXT: ucomiss %xmm1, %xmm0 -; SSE3_64-NEXT: cmovaeq %rcx, %rax -; SSE3_64-NEXT: retq -; -; SSE2_32_WIN-LABEL: f_to_u64: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl %ebp -; SSE2_32_WIN-NEXT: movl %esp, %ebp -; SSE2_32_WIN-NEXT: andl $-8, %esp -; SSE2_32_WIN-NEXT: subl $16, %esp -; SSE2_32_WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE2_32_WIN-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; SSE2_32_WIN-NEXT: movaps %xmm0, %xmm2 -; SSE2_32_WIN-NEXT: cmpltss %xmm1, %xmm2 -; SSE2_32_WIN-NEXT: andnps %xmm1, %xmm2 -; SSE2_32_WIN-NEXT: movaps %xmm0, %xmm3 -; SSE2_32_WIN-NEXT: subss %xmm2, %xmm3 -; SSE2_32_WIN-NEXT: movss %xmm3, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: flds {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: xorl %edx, %edx -; SSE2_32_WIN-NEXT: ucomiss %xmm0, %xmm1 -; SSE2_32_WIN-NEXT: setbe %dl -; SSE2_32_WIN-NEXT: shll $31, %edx -; SSE2_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: movl %ebp, %esp -; SSE2_32_WIN-NEXT: popl %ebp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: f_to_u64: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $20, %esp -; SSE2_32_LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE2_32_LIN-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; SSE2_32_LIN-NEXT: movaps %xmm0, %xmm2 -; SSE2_32_LIN-NEXT: cmpltss %xmm1, %xmm2 -; SSE2_32_LIN-NEXT: andnps %xmm1, %xmm2 -; SSE2_32_LIN-NEXT: movaps %xmm0, %xmm3 -; SSE2_32_LIN-NEXT: subss %xmm2, %xmm3 -; SSE2_32_LIN-NEXT: movss %xmm3, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: flds {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: xorl %edx, %edx -; SSE2_32_LIN-NEXT: ucomiss %xmm0, %xmm1 -; SSE2_32_LIN-NEXT: setbe %dl -; SSE2_32_LIN-NEXT: shll $31, %edx -; SSE2_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: addl $20, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64-LABEL: f_to_u64: -; SSE2_64: # %bb.0: -; SSE2_64-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; SSE2_64-NEXT: movaps %xmm0, %xmm2 -; SSE2_64-NEXT: subss %xmm1, %xmm2 -; SSE2_64-NEXT: cvttss2si %xmm2, %rax -; SSE2_64-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000 -; SSE2_64-NEXT: xorq %rax, %rcx -; SSE2_64-NEXT: cvttss2si %xmm0, %rax -; SSE2_64-NEXT: ucomiss %xmm1, %xmm0 -; SSE2_64-NEXT: cmovaeq %rcx, %rax -; SSE2_64-NEXT: retq -; -; X87_WIN-LABEL: f_to_u64: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: flds 8(%ebp) -; X87_WIN-NEXT: flds __real@5f000000 -; X87_WIN-NEXT: fucom %st(1) -; X87_WIN-NEXT: fnstsw %ax -; X87_WIN-NEXT: xorl %edx, %edx -; X87_WIN-NEXT: # kill: def $ah killed $ah killed $ax -; X87_WIN-NEXT: sahf -; X87_WIN-NEXT: setbe %al -; X87_WIN-NEXT: fldz -; X87_WIN-NEXT: ja LBB0_2 -; X87_WIN-NEXT: # %bb.1: -; X87_WIN-NEXT: fstp %st(0) -; X87_WIN-NEXT: fldz -; X87_WIN-NEXT: fxch %st(1) -; X87_WIN-NEXT: LBB0_2: -; X87_WIN-NEXT: fstp %st(1) -; X87_WIN-NEXT: fsubrp %st, %st(1) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx -; X87_WIN-NEXT: orl $3072, %ecx # imm = 0xC00 -; X87_WIN-NEXT: movw %cx, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movb %al, %dl -; X87_WIN-NEXT: shll $31, %edx -; X87_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: f_to_u64: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: flds {{[0-9]+}}(%esp) -; X87_LIN-NEXT: flds {{\.LCPI.*}} -; X87_LIN-NEXT: fucom %st(1) -; X87_LIN-NEXT: fnstsw %ax -; X87_LIN-NEXT: xorl %edx, %edx -; X87_LIN-NEXT: # kill: def $ah killed $ah killed $ax -; X87_LIN-NEXT: sahf -; X87_LIN-NEXT: setbe %al -; X87_LIN-NEXT: fldz -; X87_LIN-NEXT: ja .LBB0_2 -; X87_LIN-NEXT: # %bb.1: -; X87_LIN-NEXT: fstp %st(0) -; X87_LIN-NEXT: fldz -; X87_LIN-NEXT: fxch %st(1) -; X87_LIN-NEXT: .LBB0_2: -; X87_LIN-NEXT: fstp %st(1) -; X87_LIN-NEXT: fsubrp %st, %st(1) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx -; X87_LIN-NEXT: orl $3072, %ecx # imm = 0xC00 -; X87_LIN-NEXT: movw %cx, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movb %al, %dl -; X87_LIN-NEXT: shll $31, %edx -; X87_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512DQVL-LABEL: f_to_u64: +; X86-AVX512DQVL: # %bb.0: +; X86-AVX512DQVL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-AVX512DQVL-NEXT: vcvttps2uqq %xmm0, %xmm0 +; X86-AVX512DQVL-NEXT: vmovd %xmm0, %eax +; X86-AVX512DQVL-NEXT: vpextrd $1, %xmm0, %edx +; X86-AVX512DQVL-NEXT: retl +; +; X64-AVX512-LABEL: f_to_u64: +; X64-AVX512: # %bb.0: +; X64-AVX512-NEXT: vcvttss2usi %xmm0, %rax +; X64-AVX512-NEXT: retq +; +; X86-AVX512DQ-LABEL: f_to_u64: +; X86-AVX512DQ: # %bb.0: +; X86-AVX512DQ-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-AVX512DQ-NEXT: vcvttps2uqq %ymm0, %zmm0 +; X86-AVX512DQ-NEXT: vmovd %xmm0, %eax +; X86-AVX512DQ-NEXT: vpextrd $1, %xmm0, %edx +; X86-AVX512DQ-NEXT: vzeroupper +; X86-AVX512DQ-NEXT: retl +; +; X86-AVX512F-WIN-LABEL: f_to_u64: +; X86-AVX512F-WIN: # %bb.0: +; X86-AVX512F-WIN-NEXT: pushl %ebp +; X86-AVX512F-WIN-NEXT: movl %esp, %ebp +; X86-AVX512F-WIN-NEXT: andl $-8, %esp +; X86-AVX512F-WIN-NEXT: subl $8, %esp +; X86-AVX512F-WIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-AVX512F-WIN-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-AVX512F-WIN-NEXT: vcmpltss %xmm1, %xmm0, %k1 +; X86-AVX512F-WIN-NEXT: vxorps %xmm2, %xmm2, %xmm2 +; X86-AVX512F-WIN-NEXT: xorl %edx, %edx +; X86-AVX512F-WIN-NEXT: vucomiss %xmm0, %xmm1 +; X86-AVX512F-WIN-NEXT: vmovss %xmm2, %xmm1, %xmm1 {%k1} +; X86-AVX512F-WIN-NEXT: vsubss %xmm1, %xmm0, %xmm0 +; X86-AVX512F-WIN-NEXT: vmovss %xmm0, (%esp) +; X86-AVX512F-WIN-NEXT: flds (%esp) +; X86-AVX512F-WIN-NEXT: fisttpll (%esp) +; X86-AVX512F-WIN-NEXT: setbe %dl +; X86-AVX512F-WIN-NEXT: shll $31, %edx +; X86-AVX512F-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-AVX512F-WIN-NEXT: movl (%esp), %eax +; X86-AVX512F-WIN-NEXT: movl %ebp, %esp +; X86-AVX512F-WIN-NEXT: popl %ebp +; X86-AVX512F-WIN-NEXT: retl +; +; X86-AVX512F-LIN-LABEL: f_to_u64: +; X86-AVX512F-LIN: # %bb.0: +; X86-AVX512F-LIN-NEXT: subl $12, %esp +; X86-AVX512F-LIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-AVX512F-LIN-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-AVX512F-LIN-NEXT: vcmpltss %xmm1, %xmm0, %k1 +; X86-AVX512F-LIN-NEXT: vxorps %xmm2, %xmm2, %xmm2 +; X86-AVX512F-LIN-NEXT: xorl %edx, %edx +; X86-AVX512F-LIN-NEXT: vucomiss %xmm0, %xmm1 +; X86-AVX512F-LIN-NEXT: vmovss %xmm2, %xmm1, %xmm1 {%k1} +; X86-AVX512F-LIN-NEXT: vsubss %xmm1, %xmm0, %xmm0 +; X86-AVX512F-LIN-NEXT: vmovss %xmm0, (%esp) +; X86-AVX512F-LIN-NEXT: flds (%esp) +; X86-AVX512F-LIN-NEXT: fisttpll (%esp) +; X86-AVX512F-LIN-NEXT: setbe %dl +; X86-AVX512F-LIN-NEXT: shll $31, %edx +; X86-AVX512F-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-AVX512F-LIN-NEXT: movl (%esp), %eax +; X86-AVX512F-LIN-NEXT: addl $12, %esp +; X86-AVX512F-LIN-NEXT: retl +; +; X86-SSE3-WIN-LABEL: f_to_u64: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE3-WIN-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-SSE3-WIN-NEXT: movaps %xmm0, %xmm2 +; X86-SSE3-WIN-NEXT: xorl %edx, %edx +; X86-SSE3-WIN-NEXT: ucomiss %xmm0, %xmm1 +; X86-SSE3-WIN-NEXT: cmpltss %xmm1, %xmm0 +; X86-SSE3-WIN-NEXT: andnps %xmm1, %xmm0 +; X86-SSE3-WIN-NEXT: subss %xmm0, %xmm2 +; X86-SSE3-WIN-NEXT: movss %xmm2, (%esp) +; X86-SSE3-WIN-NEXT: flds (%esp) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: setbe %dl +; X86-SSE3-WIN-NEXT: shll $31, %edx +; X86-SSE3-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: f_to_u64: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE3-LIN-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-SSE3-LIN-NEXT: movaps %xmm0, %xmm2 +; X86-SSE3-LIN-NEXT: xorl %edx, %edx +; X86-SSE3-LIN-NEXT: ucomiss %xmm0, %xmm1 +; X86-SSE3-LIN-NEXT: cmpltss %xmm1, %xmm0 +; X86-SSE3-LIN-NEXT: andnps %xmm1, %xmm0 +; X86-SSE3-LIN-NEXT: subss %xmm0, %xmm2 +; X86-SSE3-LIN-NEXT: movss %xmm2, (%esp) +; X86-SSE3-LIN-NEXT: flds (%esp) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: setbe %dl +; X86-SSE3-LIN-NEXT: shll $31, %edx +; X86-SSE3-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE-LABEL: f_to_u64: +; X64-SSE: # %bb.0: +; X64-SSE-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X64-SSE-NEXT: movaps %xmm0, %xmm2 +; X64-SSE-NEXT: subss %xmm1, %xmm2 +; X64-SSE-NEXT: cvttss2si %xmm2, %rax +; X64-SSE-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000 +; X64-SSE-NEXT: xorq %rax, %rcx +; X64-SSE-NEXT: cvttss2si %xmm0, %rax +; X64-SSE-NEXT: ucomiss %xmm1, %xmm0 +; X64-SSE-NEXT: cmovaeq %rcx, %rax +; X64-SSE-NEXT: retq +; +; X86-SSE2-WIN-LABEL: f_to_u64: +; X86-SSE2-WIN: # %bb.0: +; X86-SSE2-WIN-NEXT: pushl %ebp +; X86-SSE2-WIN-NEXT: movl %esp, %ebp +; X86-SSE2-WIN-NEXT: andl $-8, %esp +; X86-SSE2-WIN-NEXT: subl $16, %esp +; X86-SSE2-WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE2-WIN-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-SSE2-WIN-NEXT: movaps %xmm0, %xmm2 +; X86-SSE2-WIN-NEXT: cmpltss %xmm1, %xmm2 +; X86-SSE2-WIN-NEXT: andnps %xmm1, %xmm2 +; X86-SSE2-WIN-NEXT: movaps %xmm0, %xmm3 +; X86-SSE2-WIN-NEXT: subss %xmm2, %xmm3 +; X86-SSE2-WIN-NEXT: movss %xmm3, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: flds {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: xorl %edx, %edx +; X86-SSE2-WIN-NEXT: ucomiss %xmm0, %xmm1 +; X86-SSE2-WIN-NEXT: setbe %dl +; X86-SSE2-WIN-NEXT: shll $31, %edx +; X86-SSE2-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: movl %ebp, %esp +; X86-SSE2-WIN-NEXT: popl %ebp +; X86-SSE2-WIN-NEXT: retl +; +; X86-SSE2-LIN-LABEL: f_to_u64: +; X86-SSE2-LIN: # %bb.0: +; X86-SSE2-LIN-NEXT: subl $20, %esp +; X86-SSE2-LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE2-LIN-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero +; X86-SSE2-LIN-NEXT: movaps %xmm0, %xmm2 +; X86-SSE2-LIN-NEXT: cmpltss %xmm1, %xmm2 +; X86-SSE2-LIN-NEXT: andnps %xmm1, %xmm2 +; X86-SSE2-LIN-NEXT: movaps %xmm0, %xmm3 +; X86-SSE2-LIN-NEXT: subss %xmm2, %xmm3 +; X86-SSE2-LIN-NEXT: movss %xmm3, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: flds {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: xorl %edx, %edx +; X86-SSE2-LIN-NEXT: ucomiss %xmm0, %xmm1 +; X86-SSE2-LIN-NEXT: setbe %dl +; X86-SSE2-LIN-NEXT: shll $31, %edx +; X86-SSE2-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: addl $20, %esp +; X86-SSE2-LIN-NEXT: retl +; +; X87-WIN-LABEL: f_to_u64: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: flds 8(%ebp) +; X87-WIN-NEXT: flds __real@5f000000 +; X87-WIN-NEXT: fucom %st(1) +; X87-WIN-NEXT: fnstsw %ax +; X87-WIN-NEXT: xorl %edx, %edx +; X87-WIN-NEXT: # kill: def $ah killed $ah killed $ax +; X87-WIN-NEXT: sahf +; X87-WIN-NEXT: setbe %al +; X87-WIN-NEXT: fldz +; X87-WIN-NEXT: ja LBB0_2 +; X87-WIN-NEXT: # %bb.1: +; X87-WIN-NEXT: fstp %st(0) +; X87-WIN-NEXT: fldz +; X87-WIN-NEXT: fxch %st(1) +; X87-WIN-NEXT: LBB0_2: +; X87-WIN-NEXT: fstp %st(1) +; X87-WIN-NEXT: fsubrp %st, %st(1) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx +; X87-WIN-NEXT: orl $3072, %ecx # imm = 0xC00 +; X87-WIN-NEXT: movw %cx, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movb %al, %dl +; X87-WIN-NEXT: shll $31, %edx +; X87-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: f_to_u64: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: flds {{[0-9]+}}(%esp) +; X87-LIN-NEXT: flds {{\.LCPI.*}} +; X87-LIN-NEXT: fucom %st(1) +; X87-LIN-NEXT: fnstsw %ax +; X87-LIN-NEXT: xorl %edx, %edx +; X87-LIN-NEXT: # kill: def $ah killed $ah killed $ax +; X87-LIN-NEXT: sahf +; X87-LIN-NEXT: setbe %al +; X87-LIN-NEXT: fldz +; X87-LIN-NEXT: ja .LBB0_2 +; X87-LIN-NEXT: # %bb.1: +; X87-LIN-NEXT: fstp %st(0) +; X87-LIN-NEXT: fldz +; X87-LIN-NEXT: fxch %st(1) +; X87-LIN-NEXT: .LBB0_2: +; X87-LIN-NEXT: fstp %st(1) +; X87-LIN-NEXT: fsubrp %st, %st(1) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx +; X87-LIN-NEXT: orl $3072, %ecx # imm = 0xC00 +; X87-LIN-NEXT: movw %cx, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movb %al, %dl +; X87-LIN-NEXT: shll $31, %edx +; X87-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptoui float %a to i64 ret i64 %r } define i64 @f_to_s64(float %a) nounwind { -; AVX512DQVL_32_WIN-LABEL: f_to_s64: -; AVX512DQVL_32_WIN: # %bb.0: -; AVX512DQVL_32_WIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512DQVL_32_WIN-NEXT: vcvttps2qq %xmm0, %xmm0 -; AVX512DQVL_32_WIN-NEXT: vmovd %xmm0, %eax -; AVX512DQVL_32_WIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQVL_32_WIN-NEXT: retl -; -; AVX512DQVL_32_LIN-LABEL: f_to_s64: -; AVX512DQVL_32_LIN: # %bb.0: -; AVX512DQVL_32_LIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512DQVL_32_LIN-NEXT: vcvttps2qq %xmm0, %xmm0 -; AVX512DQVL_32_LIN-NEXT: vmovd %xmm0, %eax -; AVX512DQVL_32_LIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQVL_32_LIN-NEXT: retl -; -; AVX512_64-LABEL: f_to_s64: -; AVX512_64: # %bb.0: -; AVX512_64-NEXT: vcvttss2si %xmm0, %rax -; AVX512_64-NEXT: retq -; -; AVX512DQ_32_WIN-LABEL: f_to_s64: -; AVX512DQ_32_WIN: # %bb.0: -; AVX512DQ_32_WIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512DQ_32_WIN-NEXT: vcvttps2qq %ymm0, %zmm0 -; AVX512DQ_32_WIN-NEXT: vmovd %xmm0, %eax -; AVX512DQ_32_WIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQ_32_WIN-NEXT: vzeroupper -; AVX512DQ_32_WIN-NEXT: retl -; -; AVX512DQ_32_LIN-LABEL: f_to_s64: -; AVX512DQ_32_LIN: # %bb.0: -; AVX512DQ_32_LIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512DQ_32_LIN-NEXT: vcvttps2qq %ymm0, %zmm0 -; AVX512DQ_32_LIN-NEXT: vmovd %xmm0, %eax -; AVX512DQ_32_LIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQ_32_LIN-NEXT: vzeroupper -; AVX512DQ_32_LIN-NEXT: retl -; -; AVX512F_32_WIN-LABEL: f_to_s64: -; AVX512F_32_WIN: # %bb.0: -; AVX512F_32_WIN-NEXT: pushl %ebp -; AVX512F_32_WIN-NEXT: movl %esp, %ebp -; AVX512F_32_WIN-NEXT: andl $-8, %esp -; AVX512F_32_WIN-NEXT: subl $8, %esp -; AVX512F_32_WIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512F_32_WIN-NEXT: vmovss %xmm0, (%esp) -; AVX512F_32_WIN-NEXT: flds (%esp) -; AVX512F_32_WIN-NEXT: fisttpll (%esp) -; AVX512F_32_WIN-NEXT: movl (%esp), %eax -; AVX512F_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; AVX512F_32_WIN-NEXT: movl %ebp, %esp -; AVX512F_32_WIN-NEXT: popl %ebp -; AVX512F_32_WIN-NEXT: retl -; -; AVX512F_32_LIN-LABEL: f_to_s64: -; AVX512F_32_LIN: # %bb.0: -; AVX512F_32_LIN-NEXT: subl $12, %esp -; AVX512F_32_LIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; AVX512F_32_LIN-NEXT: vmovss %xmm0, (%esp) -; AVX512F_32_LIN-NEXT: flds (%esp) -; AVX512F_32_LIN-NEXT: fisttpll (%esp) -; AVX512F_32_LIN-NEXT: movl (%esp), %eax -; AVX512F_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; AVX512F_32_LIN-NEXT: addl $12, %esp -; AVX512F_32_LIN-NEXT: retl -; -; SSE3_32_WIN-LABEL: f_to_s64: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE3_32_WIN-NEXT: movss %xmm0, (%esp) -; SSE3_32_WIN-NEXT: flds (%esp) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: f_to_s64: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE3_32_LIN-NEXT: movss %xmm0, (%esp) -; SSE3_32_LIN-NEXT: flds (%esp) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64-LABEL: f_to_s64: -; SSE3_64: # %bb.0: -; SSE3_64-NEXT: cvttss2si %xmm0, %rax -; SSE3_64-NEXT: retq -; -; SSE2_32_WIN-LABEL: f_to_s64: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl %ebp -; SSE2_32_WIN-NEXT: movl %esp, %ebp -; SSE2_32_WIN-NEXT: andl $-8, %esp -; SSE2_32_WIN-NEXT: subl $16, %esp -; SSE2_32_WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE2_32_WIN-NEXT: movss %xmm0, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: flds {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE2_32_WIN-NEXT: movl %ebp, %esp -; SSE2_32_WIN-NEXT: popl %ebp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: f_to_s64: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $20, %esp -; SSE2_32_LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero -; SSE2_32_LIN-NEXT: movss %xmm0, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: flds {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE2_32_LIN-NEXT: addl $20, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64-LABEL: f_to_s64: -; SSE2_64: # %bb.0: -; SSE2_64-NEXT: cvttss2si %xmm0, %rax -; SSE2_64-NEXT: retq -; -; X87_WIN-LABEL: f_to_s64: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: flds 8(%ebp) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: f_to_s64: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: flds {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512DQVL-LABEL: f_to_s64: +; X86-AVX512DQVL: # %bb.0: +; X86-AVX512DQVL-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-AVX512DQVL-NEXT: vcvttps2qq %xmm0, %xmm0 +; X86-AVX512DQVL-NEXT: vmovd %xmm0, %eax +; X86-AVX512DQVL-NEXT: vpextrd $1, %xmm0, %edx +; X86-AVX512DQVL-NEXT: retl +; +; X64-AVX512-LABEL: f_to_s64: +; X64-AVX512: # %bb.0: +; X64-AVX512-NEXT: vcvttss2si %xmm0, %rax +; X64-AVX512-NEXT: retq +; +; X86-AVX512DQ-LABEL: f_to_s64: +; X86-AVX512DQ: # %bb.0: +; X86-AVX512DQ-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-AVX512DQ-NEXT: vcvttps2qq %ymm0, %zmm0 +; X86-AVX512DQ-NEXT: vmovd %xmm0, %eax +; X86-AVX512DQ-NEXT: vpextrd $1, %xmm0, %edx +; X86-AVX512DQ-NEXT: vzeroupper +; X86-AVX512DQ-NEXT: retl +; +; X86-AVX512F-WIN-LABEL: f_to_s64: +; X86-AVX512F-WIN: # %bb.0: +; X86-AVX512F-WIN-NEXT: pushl %ebp +; X86-AVX512F-WIN-NEXT: movl %esp, %ebp +; X86-AVX512F-WIN-NEXT: andl $-8, %esp +; X86-AVX512F-WIN-NEXT: subl $8, %esp +; X86-AVX512F-WIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-AVX512F-WIN-NEXT: vmovss %xmm0, (%esp) +; X86-AVX512F-WIN-NEXT: flds (%esp) +; X86-AVX512F-WIN-NEXT: fisttpll (%esp) +; X86-AVX512F-WIN-NEXT: movl (%esp), %eax +; X86-AVX512F-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX512F-WIN-NEXT: movl %ebp, %esp +; X86-AVX512F-WIN-NEXT: popl %ebp +; X86-AVX512F-WIN-NEXT: retl +; +; X86-AVX512F-LIN-LABEL: f_to_s64: +; X86-AVX512F-LIN: # %bb.0: +; X86-AVX512F-LIN-NEXT: subl $12, %esp +; X86-AVX512F-LIN-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-AVX512F-LIN-NEXT: vmovss %xmm0, (%esp) +; X86-AVX512F-LIN-NEXT: flds (%esp) +; X86-AVX512F-LIN-NEXT: fisttpll (%esp) +; X86-AVX512F-LIN-NEXT: movl (%esp), %eax +; X86-AVX512F-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX512F-LIN-NEXT: addl $12, %esp +; X86-AVX512F-LIN-NEXT: retl +; +; X86-SSE3-WIN-LABEL: f_to_s64: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE3-WIN-NEXT: movss %xmm0, (%esp) +; X86-SSE3-WIN-NEXT: flds (%esp) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: f_to_s64: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE3-LIN-NEXT: movss %xmm0, (%esp) +; X86-SSE3-LIN-NEXT: flds (%esp) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE-LABEL: f_to_s64: +; X64-SSE: # %bb.0: +; X64-SSE-NEXT: cvttss2si %xmm0, %rax +; X64-SSE-NEXT: retq +; +; X86-SSE2-WIN-LABEL: f_to_s64: +; X86-SSE2-WIN: # %bb.0: +; X86-SSE2-WIN-NEXT: pushl %ebp +; X86-SSE2-WIN-NEXT: movl %esp, %ebp +; X86-SSE2-WIN-NEXT: andl $-8, %esp +; X86-SSE2-WIN-NEXT: subl $16, %esp +; X86-SSE2-WIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE2-WIN-NEXT: movss %xmm0, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: flds {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE2-WIN-NEXT: movl %ebp, %esp +; X86-SSE2-WIN-NEXT: popl %ebp +; X86-SSE2-WIN-NEXT: retl +; +; X86-SSE2-LIN-LABEL: f_to_s64: +; X86-SSE2-LIN: # %bb.0: +; X86-SSE2-LIN-NEXT: subl $20, %esp +; X86-SSE2-LIN-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero +; X86-SSE2-LIN-NEXT: movss %xmm0, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: flds {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE2-LIN-NEXT: addl $20, %esp +; X86-SSE2-LIN-NEXT: retl +; +; X87-WIN-LABEL: f_to_s64: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: flds 8(%ebp) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: f_to_s64: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: flds {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptosi float %a to i64 ret i64 %r } define i64 @d_to_u64(double %a) nounwind { -; AVX512DQVL_32_WIN-LABEL: d_to_u64: -; AVX512DQVL_32_WIN: # %bb.0: -; AVX512DQVL_32_WIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512DQVL_32_WIN-NEXT: vcvttpd2uqq %xmm0, %xmm0 -; AVX512DQVL_32_WIN-NEXT: vmovd %xmm0, %eax -; AVX512DQVL_32_WIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQVL_32_WIN-NEXT: retl -; -; AVX512DQVL_32_LIN-LABEL: d_to_u64: -; AVX512DQVL_32_LIN: # %bb.0: -; AVX512DQVL_32_LIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512DQVL_32_LIN-NEXT: vcvttpd2uqq %xmm0, %xmm0 -; AVX512DQVL_32_LIN-NEXT: vmovd %xmm0, %eax -; AVX512DQVL_32_LIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQVL_32_LIN-NEXT: retl -; -; AVX512_64-LABEL: d_to_u64: -; AVX512_64: # %bb.0: -; AVX512_64-NEXT: vcvttsd2usi %xmm0, %rax -; AVX512_64-NEXT: retq -; -; AVX512DQ_32_WIN-LABEL: d_to_u64: -; AVX512DQ_32_WIN: # %bb.0: -; AVX512DQ_32_WIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512DQ_32_WIN-NEXT: vcvttpd2uqq %zmm0, %zmm0 -; AVX512DQ_32_WIN-NEXT: vmovd %xmm0, %eax -; AVX512DQ_32_WIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQ_32_WIN-NEXT: vzeroupper -; AVX512DQ_32_WIN-NEXT: retl -; -; AVX512DQ_32_LIN-LABEL: d_to_u64: -; AVX512DQ_32_LIN: # %bb.0: -; AVX512DQ_32_LIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512DQ_32_LIN-NEXT: vcvttpd2uqq %zmm0, %zmm0 -; AVX512DQ_32_LIN-NEXT: vmovd %xmm0, %eax -; AVX512DQ_32_LIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQ_32_LIN-NEXT: vzeroupper -; AVX512DQ_32_LIN-NEXT: retl -; -; AVX512F_32_WIN-LABEL: d_to_u64: -; AVX512F_32_WIN: # %bb.0: -; AVX512F_32_WIN-NEXT: pushl %ebp -; AVX512F_32_WIN-NEXT: movl %esp, %ebp -; AVX512F_32_WIN-NEXT: andl $-8, %esp -; AVX512F_32_WIN-NEXT: subl $8, %esp -; AVX512F_32_WIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512F_32_WIN-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero -; AVX512F_32_WIN-NEXT: vcmpltsd %xmm1, %xmm0, %k1 -; AVX512F_32_WIN-NEXT: vxorpd %xmm2, %xmm2, %xmm2 -; AVX512F_32_WIN-NEXT: xorl %edx, %edx -; AVX512F_32_WIN-NEXT: vucomisd %xmm0, %xmm1 -; AVX512F_32_WIN-NEXT: vmovsd %xmm2, %xmm1, %xmm1 {%k1} -; AVX512F_32_WIN-NEXT: vsubsd %xmm1, %xmm0, %xmm0 -; AVX512F_32_WIN-NEXT: vmovsd %xmm0, (%esp) -; AVX512F_32_WIN-NEXT: fldl (%esp) -; AVX512F_32_WIN-NEXT: fisttpll (%esp) -; AVX512F_32_WIN-NEXT: setbe %dl -; AVX512F_32_WIN-NEXT: shll $31, %edx -; AVX512F_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; AVX512F_32_WIN-NEXT: movl (%esp), %eax -; AVX512F_32_WIN-NEXT: movl %ebp, %esp -; AVX512F_32_WIN-NEXT: popl %ebp -; AVX512F_32_WIN-NEXT: retl -; -; AVX512F_32_LIN-LABEL: d_to_u64: -; AVX512F_32_LIN: # %bb.0: -; AVX512F_32_LIN-NEXT: subl $12, %esp -; AVX512F_32_LIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512F_32_LIN-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero -; AVX512F_32_LIN-NEXT: vcmpltsd %xmm1, %xmm0, %k1 -; AVX512F_32_LIN-NEXT: vxorpd %xmm2, %xmm2, %xmm2 -; AVX512F_32_LIN-NEXT: xorl %edx, %edx -; AVX512F_32_LIN-NEXT: vucomisd %xmm0, %xmm1 -; AVX512F_32_LIN-NEXT: vmovsd %xmm2, %xmm1, %xmm1 {%k1} -; AVX512F_32_LIN-NEXT: vsubsd %xmm1, %xmm0, %xmm0 -; AVX512F_32_LIN-NEXT: vmovsd %xmm0, (%esp) -; AVX512F_32_LIN-NEXT: fldl (%esp) -; AVX512F_32_LIN-NEXT: fisttpll (%esp) -; AVX512F_32_LIN-NEXT: setbe %dl -; AVX512F_32_LIN-NEXT: shll $31, %edx -; AVX512F_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; AVX512F_32_LIN-NEXT: movl (%esp), %eax -; AVX512F_32_LIN-NEXT: addl $12, %esp -; AVX512F_32_LIN-NEXT: retl -; -; SSE3_32_WIN-LABEL: d_to_u64: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE3_32_WIN-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero -; SSE3_32_WIN-NEXT: movapd %xmm0, %xmm2 -; SSE3_32_WIN-NEXT: xorl %edx, %edx -; SSE3_32_WIN-NEXT: ucomisd %xmm0, %xmm1 -; SSE3_32_WIN-NEXT: cmpltsd %xmm1, %xmm0 -; SSE3_32_WIN-NEXT: andnpd %xmm1, %xmm0 -; SSE3_32_WIN-NEXT: subsd %xmm0, %xmm2 -; SSE3_32_WIN-NEXT: movsd %xmm2, (%esp) -; SSE3_32_WIN-NEXT: fldl (%esp) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: setbe %dl -; SSE3_32_WIN-NEXT: shll $31, %edx -; SSE3_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: d_to_u64: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE3_32_LIN-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero -; SSE3_32_LIN-NEXT: movapd %xmm0, %xmm2 -; SSE3_32_LIN-NEXT: xorl %edx, %edx -; SSE3_32_LIN-NEXT: ucomisd %xmm0, %xmm1 -; SSE3_32_LIN-NEXT: cmpltsd %xmm1, %xmm0 -; SSE3_32_LIN-NEXT: andnpd %xmm1, %xmm0 -; SSE3_32_LIN-NEXT: subsd %xmm0, %xmm2 -; SSE3_32_LIN-NEXT: movsd %xmm2, (%esp) -; SSE3_32_LIN-NEXT: fldl (%esp) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: setbe %dl -; SSE3_32_LIN-NEXT: shll $31, %edx -; SSE3_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64-LABEL: d_to_u64: -; SSE3_64: # %bb.0: -; SSE3_64-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero -; SSE3_64-NEXT: movapd %xmm0, %xmm2 -; SSE3_64-NEXT: subsd %xmm1, %xmm2 -; SSE3_64-NEXT: cvttsd2si %xmm2, %rax -; SSE3_64-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000 -; SSE3_64-NEXT: xorq %rax, %rcx -; SSE3_64-NEXT: cvttsd2si %xmm0, %rax -; SSE3_64-NEXT: ucomisd %xmm1, %xmm0 -; SSE3_64-NEXT: cmovaeq %rcx, %rax -; SSE3_64-NEXT: retq -; -; SSE2_32_WIN-LABEL: d_to_u64: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl %ebp -; SSE2_32_WIN-NEXT: movl %esp, %ebp -; SSE2_32_WIN-NEXT: andl $-8, %esp -; SSE2_32_WIN-NEXT: subl $16, %esp -; SSE2_32_WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE2_32_WIN-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero -; SSE2_32_WIN-NEXT: movapd %xmm0, %xmm2 -; SSE2_32_WIN-NEXT: cmpltsd %xmm1, %xmm2 -; SSE2_32_WIN-NEXT: andnpd %xmm1, %xmm2 -; SSE2_32_WIN-NEXT: movapd %xmm0, %xmm3 -; SSE2_32_WIN-NEXT: subsd %xmm2, %xmm3 -; SSE2_32_WIN-NEXT: movsd %xmm3, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: xorl %edx, %edx -; SSE2_32_WIN-NEXT: ucomisd %xmm0, %xmm1 -; SSE2_32_WIN-NEXT: setbe %dl -; SSE2_32_WIN-NEXT: shll $31, %edx -; SSE2_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: movl %ebp, %esp -; SSE2_32_WIN-NEXT: popl %ebp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: d_to_u64: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $20, %esp -; SSE2_32_LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE2_32_LIN-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero -; SSE2_32_LIN-NEXT: movapd %xmm0, %xmm2 -; SSE2_32_LIN-NEXT: cmpltsd %xmm1, %xmm2 -; SSE2_32_LIN-NEXT: andnpd %xmm1, %xmm2 -; SSE2_32_LIN-NEXT: movapd %xmm0, %xmm3 -; SSE2_32_LIN-NEXT: subsd %xmm2, %xmm3 -; SSE2_32_LIN-NEXT: movsd %xmm3, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: xorl %edx, %edx -; SSE2_32_LIN-NEXT: ucomisd %xmm0, %xmm1 -; SSE2_32_LIN-NEXT: setbe %dl -; SSE2_32_LIN-NEXT: shll $31, %edx -; SSE2_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: addl $20, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64-LABEL: d_to_u64: -; SSE2_64: # %bb.0: -; SSE2_64-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero -; SSE2_64-NEXT: movapd %xmm0, %xmm2 -; SSE2_64-NEXT: subsd %xmm1, %xmm2 -; SSE2_64-NEXT: cvttsd2si %xmm2, %rax -; SSE2_64-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000 -; SSE2_64-NEXT: xorq %rax, %rcx -; SSE2_64-NEXT: cvttsd2si %xmm0, %rax -; SSE2_64-NEXT: ucomisd %xmm1, %xmm0 -; SSE2_64-NEXT: cmovaeq %rcx, %rax -; SSE2_64-NEXT: retq -; -; X87_WIN-LABEL: d_to_u64: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: fldl 8(%ebp) -; X87_WIN-NEXT: flds __real@5f000000 -; X87_WIN-NEXT: fucom %st(1) -; X87_WIN-NEXT: fnstsw %ax -; X87_WIN-NEXT: xorl %edx, %edx -; X87_WIN-NEXT: # kill: def $ah killed $ah killed $ax -; X87_WIN-NEXT: sahf -; X87_WIN-NEXT: setbe %al -; X87_WIN-NEXT: fldz -; X87_WIN-NEXT: ja LBB2_2 -; X87_WIN-NEXT: # %bb.1: -; X87_WIN-NEXT: fstp %st(0) -; X87_WIN-NEXT: fldz -; X87_WIN-NEXT: fxch %st(1) -; X87_WIN-NEXT: LBB2_2: -; X87_WIN-NEXT: fstp %st(1) -; X87_WIN-NEXT: fsubrp %st, %st(1) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx -; X87_WIN-NEXT: orl $3072, %ecx # imm = 0xC00 -; X87_WIN-NEXT: movw %cx, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movb %al, %dl -; X87_WIN-NEXT: shll $31, %edx -; X87_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: d_to_u64: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: fldl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: flds {{\.LCPI.*}} -; X87_LIN-NEXT: fucom %st(1) -; X87_LIN-NEXT: fnstsw %ax -; X87_LIN-NEXT: xorl %edx, %edx -; X87_LIN-NEXT: # kill: def $ah killed $ah killed $ax -; X87_LIN-NEXT: sahf -; X87_LIN-NEXT: setbe %al -; X87_LIN-NEXT: fldz -; X87_LIN-NEXT: ja .LBB2_2 -; X87_LIN-NEXT: # %bb.1: -; X87_LIN-NEXT: fstp %st(0) -; X87_LIN-NEXT: fldz -; X87_LIN-NEXT: fxch %st(1) -; X87_LIN-NEXT: .LBB2_2: -; X87_LIN-NEXT: fstp %st(1) -; X87_LIN-NEXT: fsubrp %st, %st(1) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx -; X87_LIN-NEXT: orl $3072, %ecx # imm = 0xC00 -; X87_LIN-NEXT: movw %cx, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movb %al, %dl -; X87_LIN-NEXT: shll $31, %edx -; X87_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512DQVL-LABEL: d_to_u64: +; X86-AVX512DQVL: # %bb.0: +; X86-AVX512DQVL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; X86-AVX512DQVL-NEXT: vcvttpd2uqq %xmm0, %xmm0 +; X86-AVX512DQVL-NEXT: vmovd %xmm0, %eax +; X86-AVX512DQVL-NEXT: vpextrd $1, %xmm0, %edx +; X86-AVX512DQVL-NEXT: retl +; +; X64-AVX512-LABEL: d_to_u64: +; X64-AVX512: # %bb.0: +; X64-AVX512-NEXT: vcvttsd2usi %xmm0, %rax +; X64-AVX512-NEXT: retq +; +; X86-AVX512DQ-LABEL: d_to_u64: +; X86-AVX512DQ: # %bb.0: +; X86-AVX512DQ-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; X86-AVX512DQ-NEXT: vcvttpd2uqq %zmm0, %zmm0 +; X86-AVX512DQ-NEXT: vmovd %xmm0, %eax +; X86-AVX512DQ-NEXT: vpextrd $1, %xmm0, %edx +; X86-AVX512DQ-NEXT: vzeroupper +; X86-AVX512DQ-NEXT: retl +; +; X86-AVX512F-WIN-LABEL: d_to_u64: +; X86-AVX512F-WIN: # %bb.0: +; X86-AVX512F-WIN-NEXT: pushl %ebp +; X86-AVX512F-WIN-NEXT: movl %esp, %ebp +; X86-AVX512F-WIN-NEXT: andl $-8, %esp +; X86-AVX512F-WIN-NEXT: subl $8, %esp +; X86-AVX512F-WIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; X86-AVX512F-WIN-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero +; X86-AVX512F-WIN-NEXT: vcmpltsd %xmm1, %xmm0, %k1 +; X86-AVX512F-WIN-NEXT: vxorpd %xmm2, %xmm2, %xmm2 +; X86-AVX512F-WIN-NEXT: xorl %edx, %edx +; X86-AVX512F-WIN-NEXT: vucomisd %xmm0, %xmm1 +; X86-AVX512F-WIN-NEXT: vmovsd %xmm2, %xmm1, %xmm1 {%k1} +; X86-AVX512F-WIN-NEXT: vsubsd %xmm1, %xmm0, %xmm0 +; X86-AVX512F-WIN-NEXT: vmovsd %xmm0, (%esp) +; X86-AVX512F-WIN-NEXT: fldl (%esp) +; X86-AVX512F-WIN-NEXT: fisttpll (%esp) +; X86-AVX512F-WIN-NEXT: setbe %dl +; X86-AVX512F-WIN-NEXT: shll $31, %edx +; X86-AVX512F-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-AVX512F-WIN-NEXT: movl (%esp), %eax +; X86-AVX512F-WIN-NEXT: movl %ebp, %esp +; X86-AVX512F-WIN-NEXT: popl %ebp +; X86-AVX512F-WIN-NEXT: retl +; +; X86-AVX512F-LIN-LABEL: d_to_u64: +; X86-AVX512F-LIN: # %bb.0: +; X86-AVX512F-LIN-NEXT: subl $12, %esp +; X86-AVX512F-LIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; X86-AVX512F-LIN-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero +; X86-AVX512F-LIN-NEXT: vcmpltsd %xmm1, %xmm0, %k1 +; X86-AVX512F-LIN-NEXT: vxorpd %xmm2, %xmm2, %xmm2 +; X86-AVX512F-LIN-NEXT: xorl %edx, %edx +; X86-AVX512F-LIN-NEXT: vucomisd %xmm0, %xmm1 +; X86-AVX512F-LIN-NEXT: vmovsd %xmm2, %xmm1, %xmm1 {%k1} +; X86-AVX512F-LIN-NEXT: vsubsd %xmm1, %xmm0, %xmm0 +; X86-AVX512F-LIN-NEXT: vmovsd %xmm0, (%esp) +; X86-AVX512F-LIN-NEXT: fldl (%esp) +; X86-AVX512F-LIN-NEXT: fisttpll (%esp) +; X86-AVX512F-LIN-NEXT: setbe %dl +; X86-AVX512F-LIN-NEXT: shll $31, %edx +; X86-AVX512F-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-AVX512F-LIN-NEXT: movl (%esp), %eax +; X86-AVX512F-LIN-NEXT: addl $12, %esp +; X86-AVX512F-LIN-NEXT: retl +; +; X86-SSE3-WIN-LABEL: d_to_u64: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE3-WIN-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero +; X86-SSE3-WIN-NEXT: movapd %xmm0, %xmm2 +; X86-SSE3-WIN-NEXT: xorl %edx, %edx +; X86-SSE3-WIN-NEXT: ucomisd %xmm0, %xmm1 +; X86-SSE3-WIN-NEXT: cmpltsd %xmm1, %xmm0 +; X86-SSE3-WIN-NEXT: andnpd %xmm1, %xmm0 +; X86-SSE3-WIN-NEXT: subsd %xmm0, %xmm2 +; X86-SSE3-WIN-NEXT: movsd %xmm2, (%esp) +; X86-SSE3-WIN-NEXT: fldl (%esp) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: setbe %dl +; X86-SSE3-WIN-NEXT: shll $31, %edx +; X86-SSE3-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: d_to_u64: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE3-LIN-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero +; X86-SSE3-LIN-NEXT: movapd %xmm0, %xmm2 +; X86-SSE3-LIN-NEXT: xorl %edx, %edx +; X86-SSE3-LIN-NEXT: ucomisd %xmm0, %xmm1 +; X86-SSE3-LIN-NEXT: cmpltsd %xmm1, %xmm0 +; X86-SSE3-LIN-NEXT: andnpd %xmm1, %xmm0 +; X86-SSE3-LIN-NEXT: subsd %xmm0, %xmm2 +; X86-SSE3-LIN-NEXT: movsd %xmm2, (%esp) +; X86-SSE3-LIN-NEXT: fldl (%esp) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: setbe %dl +; X86-SSE3-LIN-NEXT: shll $31, %edx +; X86-SSE3-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE-LABEL: d_to_u64: +; X64-SSE: # %bb.0: +; X64-SSE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero +; X64-SSE-NEXT: movapd %xmm0, %xmm2 +; X64-SSE-NEXT: subsd %xmm1, %xmm2 +; X64-SSE-NEXT: cvttsd2si %xmm2, %rax +; X64-SSE-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000 +; X64-SSE-NEXT: xorq %rax, %rcx +; X64-SSE-NEXT: cvttsd2si %xmm0, %rax +; X64-SSE-NEXT: ucomisd %xmm1, %xmm0 +; X64-SSE-NEXT: cmovaeq %rcx, %rax +; X64-SSE-NEXT: retq +; +; X86-SSE2-WIN-LABEL: d_to_u64: +; X86-SSE2-WIN: # %bb.0: +; X86-SSE2-WIN-NEXT: pushl %ebp +; X86-SSE2-WIN-NEXT: movl %esp, %ebp +; X86-SSE2-WIN-NEXT: andl $-8, %esp +; X86-SSE2-WIN-NEXT: subl $16, %esp +; X86-SSE2-WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE2-WIN-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero +; X86-SSE2-WIN-NEXT: movapd %xmm0, %xmm2 +; X86-SSE2-WIN-NEXT: cmpltsd %xmm1, %xmm2 +; X86-SSE2-WIN-NEXT: andnpd %xmm1, %xmm2 +; X86-SSE2-WIN-NEXT: movapd %xmm0, %xmm3 +; X86-SSE2-WIN-NEXT: subsd %xmm2, %xmm3 +; X86-SSE2-WIN-NEXT: movsd %xmm3, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldl {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: xorl %edx, %edx +; X86-SSE2-WIN-NEXT: ucomisd %xmm0, %xmm1 +; X86-SSE2-WIN-NEXT: setbe %dl +; X86-SSE2-WIN-NEXT: shll $31, %edx +; X86-SSE2-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: movl %ebp, %esp +; X86-SSE2-WIN-NEXT: popl %ebp +; X86-SSE2-WIN-NEXT: retl +; +; X86-SSE2-LIN-LABEL: d_to_u64: +; X86-SSE2-LIN: # %bb.0: +; X86-SSE2-LIN-NEXT: subl $20, %esp +; X86-SSE2-LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE2-LIN-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero +; X86-SSE2-LIN-NEXT: movapd %xmm0, %xmm2 +; X86-SSE2-LIN-NEXT: cmpltsd %xmm1, %xmm2 +; X86-SSE2-LIN-NEXT: andnpd %xmm1, %xmm2 +; X86-SSE2-LIN-NEXT: movapd %xmm0, %xmm3 +; X86-SSE2-LIN-NEXT: subsd %xmm2, %xmm3 +; X86-SSE2-LIN-NEXT: movsd %xmm3, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldl {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: xorl %edx, %edx +; X86-SSE2-LIN-NEXT: ucomisd %xmm0, %xmm1 +; X86-SSE2-LIN-NEXT: setbe %dl +; X86-SSE2-LIN-NEXT: shll $31, %edx +; X86-SSE2-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: addl $20, %esp +; X86-SSE2-LIN-NEXT: retl +; +; X87-WIN-LABEL: d_to_u64: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: fldl 8(%ebp) +; X87-WIN-NEXT: flds __real@5f000000 +; X87-WIN-NEXT: fucom %st(1) +; X87-WIN-NEXT: fnstsw %ax +; X87-WIN-NEXT: xorl %edx, %edx +; X87-WIN-NEXT: # kill: def $ah killed $ah killed $ax +; X87-WIN-NEXT: sahf +; X87-WIN-NEXT: setbe %al +; X87-WIN-NEXT: fldz +; X87-WIN-NEXT: ja LBB2_2 +; X87-WIN-NEXT: # %bb.1: +; X87-WIN-NEXT: fstp %st(0) +; X87-WIN-NEXT: fldz +; X87-WIN-NEXT: fxch %st(1) +; X87-WIN-NEXT: LBB2_2: +; X87-WIN-NEXT: fstp %st(1) +; X87-WIN-NEXT: fsubrp %st, %st(1) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx +; X87-WIN-NEXT: orl $3072, %ecx # imm = 0xC00 +; X87-WIN-NEXT: movw %cx, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movb %al, %dl +; X87-WIN-NEXT: shll $31, %edx +; X87-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: d_to_u64: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: fldl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: flds {{\.LCPI.*}} +; X87-LIN-NEXT: fucom %st(1) +; X87-LIN-NEXT: fnstsw %ax +; X87-LIN-NEXT: xorl %edx, %edx +; X87-LIN-NEXT: # kill: def $ah killed $ah killed $ax +; X87-LIN-NEXT: sahf +; X87-LIN-NEXT: setbe %al +; X87-LIN-NEXT: fldz +; X87-LIN-NEXT: ja .LBB2_2 +; X87-LIN-NEXT: # %bb.1: +; X87-LIN-NEXT: fstp %st(0) +; X87-LIN-NEXT: fldz +; X87-LIN-NEXT: fxch %st(1) +; X87-LIN-NEXT: .LBB2_2: +; X87-LIN-NEXT: fstp %st(1) +; X87-LIN-NEXT: fsubrp %st, %st(1) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx +; X87-LIN-NEXT: orl $3072, %ecx # imm = 0xC00 +; X87-LIN-NEXT: movw %cx, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movb %al, %dl +; X87-LIN-NEXT: shll $31, %edx +; X87-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptoui double %a to i64 ret i64 %r } define i64 @d_to_s64(double %a) nounwind { -; AVX512DQVL_32_WIN-LABEL: d_to_s64: -; AVX512DQVL_32_WIN: # %bb.0: -; AVX512DQVL_32_WIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512DQVL_32_WIN-NEXT: vcvttpd2qq %xmm0, %xmm0 -; AVX512DQVL_32_WIN-NEXT: vmovd %xmm0, %eax -; AVX512DQVL_32_WIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQVL_32_WIN-NEXT: retl -; -; AVX512DQVL_32_LIN-LABEL: d_to_s64: -; AVX512DQVL_32_LIN: # %bb.0: -; AVX512DQVL_32_LIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512DQVL_32_LIN-NEXT: vcvttpd2qq %xmm0, %xmm0 -; AVX512DQVL_32_LIN-NEXT: vmovd %xmm0, %eax -; AVX512DQVL_32_LIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQVL_32_LIN-NEXT: retl -; -; AVX512_64-LABEL: d_to_s64: -; AVX512_64: # %bb.0: -; AVX512_64-NEXT: vcvttsd2si %xmm0, %rax -; AVX512_64-NEXT: retq -; -; AVX512DQ_32_WIN-LABEL: d_to_s64: -; AVX512DQ_32_WIN: # %bb.0: -; AVX512DQ_32_WIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512DQ_32_WIN-NEXT: vcvttpd2qq %zmm0, %zmm0 -; AVX512DQ_32_WIN-NEXT: vmovd %xmm0, %eax -; AVX512DQ_32_WIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQ_32_WIN-NEXT: vzeroupper -; AVX512DQ_32_WIN-NEXT: retl -; -; AVX512DQ_32_LIN-LABEL: d_to_s64: -; AVX512DQ_32_LIN: # %bb.0: -; AVX512DQ_32_LIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512DQ_32_LIN-NEXT: vcvttpd2qq %zmm0, %zmm0 -; AVX512DQ_32_LIN-NEXT: vmovd %xmm0, %eax -; AVX512DQ_32_LIN-NEXT: vpextrd $1, %xmm0, %edx -; AVX512DQ_32_LIN-NEXT: vzeroupper -; AVX512DQ_32_LIN-NEXT: retl -; -; AVX512F_32_WIN-LABEL: d_to_s64: -; AVX512F_32_WIN: # %bb.0: -; AVX512F_32_WIN-NEXT: pushl %ebp -; AVX512F_32_WIN-NEXT: movl %esp, %ebp -; AVX512F_32_WIN-NEXT: andl $-8, %esp -; AVX512F_32_WIN-NEXT: subl $8, %esp -; AVX512F_32_WIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512F_32_WIN-NEXT: vmovsd %xmm0, (%esp) -; AVX512F_32_WIN-NEXT: fldl (%esp) -; AVX512F_32_WIN-NEXT: fisttpll (%esp) -; AVX512F_32_WIN-NEXT: movl (%esp), %eax -; AVX512F_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; AVX512F_32_WIN-NEXT: movl %ebp, %esp -; AVX512F_32_WIN-NEXT: popl %ebp -; AVX512F_32_WIN-NEXT: retl -; -; AVX512F_32_LIN-LABEL: d_to_s64: -; AVX512F_32_LIN: # %bb.0: -; AVX512F_32_LIN-NEXT: subl $12, %esp -; AVX512F_32_LIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero -; AVX512F_32_LIN-NEXT: vmovsd %xmm0, (%esp) -; AVX512F_32_LIN-NEXT: fldl (%esp) -; AVX512F_32_LIN-NEXT: fisttpll (%esp) -; AVX512F_32_LIN-NEXT: movl (%esp), %eax -; AVX512F_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; AVX512F_32_LIN-NEXT: addl $12, %esp -; AVX512F_32_LIN-NEXT: retl -; -; SSE3_32_WIN-LABEL: d_to_s64: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE3_32_WIN-NEXT: movsd %xmm0, (%esp) -; SSE3_32_WIN-NEXT: fldl (%esp) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: d_to_s64: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE3_32_LIN-NEXT: movsd %xmm0, (%esp) -; SSE3_32_LIN-NEXT: fldl (%esp) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64-LABEL: d_to_s64: -; SSE3_64: # %bb.0: -; SSE3_64-NEXT: cvttsd2si %xmm0, %rax -; SSE3_64-NEXT: retq -; -; SSE2_32_WIN-LABEL: d_to_s64: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl %ebp -; SSE2_32_WIN-NEXT: movl %esp, %ebp -; SSE2_32_WIN-NEXT: andl $-8, %esp -; SSE2_32_WIN-NEXT: subl $16, %esp -; SSE2_32_WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE2_32_WIN-NEXT: movsd %xmm0, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE2_32_WIN-NEXT: movl %ebp, %esp -; SSE2_32_WIN-NEXT: popl %ebp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: d_to_s64: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $20, %esp -; SSE2_32_LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero -; SSE2_32_LIN-NEXT: movsd %xmm0, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE2_32_LIN-NEXT: addl $20, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64-LABEL: d_to_s64: -; SSE2_64: # %bb.0: -; SSE2_64-NEXT: cvttsd2si %xmm0, %rax -; SSE2_64-NEXT: retq -; -; X87_WIN-LABEL: d_to_s64: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: fldl 8(%ebp) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: d_to_s64: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: fldl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512DQVL-LABEL: d_to_s64: +; X86-AVX512DQVL: # %bb.0: +; X86-AVX512DQVL-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; X86-AVX512DQVL-NEXT: vcvttpd2qq %xmm0, %xmm0 +; X86-AVX512DQVL-NEXT: vmovd %xmm0, %eax +; X86-AVX512DQVL-NEXT: vpextrd $1, %xmm0, %edx +; X86-AVX512DQVL-NEXT: retl +; +; X64-AVX512-LABEL: d_to_s64: +; X64-AVX512: # %bb.0: +; X64-AVX512-NEXT: vcvttsd2si %xmm0, %rax +; X64-AVX512-NEXT: retq +; +; X86-AVX512DQ-LABEL: d_to_s64: +; X86-AVX512DQ: # %bb.0: +; X86-AVX512DQ-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; X86-AVX512DQ-NEXT: vcvttpd2qq %zmm0, %zmm0 +; X86-AVX512DQ-NEXT: vmovd %xmm0, %eax +; X86-AVX512DQ-NEXT: vpextrd $1, %xmm0, %edx +; X86-AVX512DQ-NEXT: vzeroupper +; X86-AVX512DQ-NEXT: retl +; +; X86-AVX512F-WIN-LABEL: d_to_s64: +; X86-AVX512F-WIN: # %bb.0: +; X86-AVX512F-WIN-NEXT: pushl %ebp +; X86-AVX512F-WIN-NEXT: movl %esp, %ebp +; X86-AVX512F-WIN-NEXT: andl $-8, %esp +; X86-AVX512F-WIN-NEXT: subl $8, %esp +; X86-AVX512F-WIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; X86-AVX512F-WIN-NEXT: vmovsd %xmm0, (%esp) +; X86-AVX512F-WIN-NEXT: fldl (%esp) +; X86-AVX512F-WIN-NEXT: fisttpll (%esp) +; X86-AVX512F-WIN-NEXT: movl (%esp), %eax +; X86-AVX512F-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX512F-WIN-NEXT: movl %ebp, %esp +; X86-AVX512F-WIN-NEXT: popl %ebp +; X86-AVX512F-WIN-NEXT: retl +; +; X86-AVX512F-LIN-LABEL: d_to_s64: +; X86-AVX512F-LIN: # %bb.0: +; X86-AVX512F-LIN-NEXT: subl $12, %esp +; X86-AVX512F-LIN-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero +; X86-AVX512F-LIN-NEXT: vmovsd %xmm0, (%esp) +; X86-AVX512F-LIN-NEXT: fldl (%esp) +; X86-AVX512F-LIN-NEXT: fisttpll (%esp) +; X86-AVX512F-LIN-NEXT: movl (%esp), %eax +; X86-AVX512F-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX512F-LIN-NEXT: addl $12, %esp +; X86-AVX512F-LIN-NEXT: retl +; +; X86-SSE3-WIN-LABEL: d_to_s64: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE3-WIN-NEXT: movsd %xmm0, (%esp) +; X86-SSE3-WIN-NEXT: fldl (%esp) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: d_to_s64: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE3-LIN-NEXT: movsd %xmm0, (%esp) +; X86-SSE3-LIN-NEXT: fldl (%esp) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE-LABEL: d_to_s64: +; X64-SSE: # %bb.0: +; X64-SSE-NEXT: cvttsd2si %xmm0, %rax +; X64-SSE-NEXT: retq +; +; X86-SSE2-WIN-LABEL: d_to_s64: +; X86-SSE2-WIN: # %bb.0: +; X86-SSE2-WIN-NEXT: pushl %ebp +; X86-SSE2-WIN-NEXT: movl %esp, %ebp +; X86-SSE2-WIN-NEXT: andl $-8, %esp +; X86-SSE2-WIN-NEXT: subl $16, %esp +; X86-SSE2-WIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE2-WIN-NEXT: movsd %xmm0, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldl {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE2-WIN-NEXT: movl %ebp, %esp +; X86-SSE2-WIN-NEXT: popl %ebp +; X86-SSE2-WIN-NEXT: retl +; +; X86-SSE2-LIN-LABEL: d_to_s64: +; X86-SSE2-LIN: # %bb.0: +; X86-SSE2-LIN-NEXT: subl $20, %esp +; X86-SSE2-LIN-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero +; X86-SSE2-LIN-NEXT: movsd %xmm0, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldl {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE2-LIN-NEXT: addl $20, %esp +; X86-SSE2-LIN-NEXT: retl +; +; X87-WIN-LABEL: d_to_s64: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: fldl 8(%ebp) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: d_to_s64: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: fldl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptosi double %a to i64 ret i64 %r } define i64 @x_to_u64(x86_fp80 %a) nounwind { -; AVX512_32_WIN-LABEL: x_to_u64: -; AVX512_32_WIN: # %bb.0: -; AVX512_32_WIN-NEXT: pushl %ebp -; AVX512_32_WIN-NEXT: movl %esp, %ebp -; AVX512_32_WIN-NEXT: andl $-8, %esp -; AVX512_32_WIN-NEXT: subl $8, %esp -; AVX512_32_WIN-NEXT: fldt 8(%ebp) -; AVX512_32_WIN-NEXT: flds __real@5f000000 -; AVX512_32_WIN-NEXT: xorl %edx, %edx -; AVX512_32_WIN-NEXT: fucomi %st(1), %st -; AVX512_32_WIN-NEXT: fldz -; AVX512_32_WIN-NEXT: fxch %st(1) -; AVX512_32_WIN-NEXT: fcmovnbe %st(1), %st -; AVX512_32_WIN-NEXT: fstp %st(1) -; AVX512_32_WIN-NEXT: fsubrp %st, %st(1) -; AVX512_32_WIN-NEXT: fisttpll (%esp) -; AVX512_32_WIN-NEXT: setbe %dl -; AVX512_32_WIN-NEXT: shll $31, %edx -; AVX512_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; AVX512_32_WIN-NEXT: movl (%esp), %eax -; AVX512_32_WIN-NEXT: movl %ebp, %esp -; AVX512_32_WIN-NEXT: popl %ebp -; AVX512_32_WIN-NEXT: retl -; -; AVX512_32_LIN-LABEL: x_to_u64: -; AVX512_32_LIN: # %bb.0: -; AVX512_32_LIN-NEXT: subl $12, %esp -; AVX512_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; AVX512_32_LIN-NEXT: flds {{\.LCPI.*}} -; AVX512_32_LIN-NEXT: xorl %edx, %edx -; AVX512_32_LIN-NEXT: fucomi %st(1), %st -; AVX512_32_LIN-NEXT: fldz -; AVX512_32_LIN-NEXT: fxch %st(1) -; AVX512_32_LIN-NEXT: fcmovnbe %st(1), %st -; AVX512_32_LIN-NEXT: fstp %st(1) -; AVX512_32_LIN-NEXT: fsubrp %st, %st(1) -; AVX512_32_LIN-NEXT: fisttpll (%esp) -; AVX512_32_LIN-NEXT: setbe %dl -; AVX512_32_LIN-NEXT: shll $31, %edx -; AVX512_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; AVX512_32_LIN-NEXT: movl (%esp), %eax -; AVX512_32_LIN-NEXT: addl $12, %esp -; AVX512_32_LIN-NEXT: retl -; -; AVX512_64_WIN-LABEL: x_to_u64: -; AVX512_64_WIN: # %bb.0: -; AVX512_64_WIN-NEXT: pushq %rax -; AVX512_64_WIN-NEXT: fldt (%rcx) -; AVX512_64_WIN-NEXT: flds __real@{{.*}}(%rip) -; AVX512_64_WIN-NEXT: xorl %eax, %eax -; AVX512_64_WIN-NEXT: fucomi %st(1), %st -; AVX512_64_WIN-NEXT: fldz -; AVX512_64_WIN-NEXT: fxch %st(1) -; AVX512_64_WIN-NEXT: fcmovnbe %st(1), %st -; AVX512_64_WIN-NEXT: fstp %st(1) -; AVX512_64_WIN-NEXT: fsubrp %st, %st(1) -; AVX512_64_WIN-NEXT: fisttpll (%rsp) -; AVX512_64_WIN-NEXT: setbe %al -; AVX512_64_WIN-NEXT: shlq $63, %rax -; AVX512_64_WIN-NEXT: xorq (%rsp), %rax -; AVX512_64_WIN-NEXT: popq %rcx -; AVX512_64_WIN-NEXT: retq -; -; AVX512_64_LIN-LABEL: x_to_u64: -; AVX512_64_LIN: # %bb.0: -; AVX512_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; AVX512_64_LIN-NEXT: flds {{.*}}(%rip) -; AVX512_64_LIN-NEXT: xorl %eax, %eax -; AVX512_64_LIN-NEXT: fucomi %st(1), %st -; AVX512_64_LIN-NEXT: fldz -; AVX512_64_LIN-NEXT: fxch %st(1) -; AVX512_64_LIN-NEXT: fcmovnbe %st(1), %st -; AVX512_64_LIN-NEXT: fstp %st(1) -; AVX512_64_LIN-NEXT: fsubrp %st, %st(1) -; AVX512_64_LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) -; AVX512_64_LIN-NEXT: setbe %al -; AVX512_64_LIN-NEXT: shlq $63, %rax -; AVX512_64_LIN-NEXT: xorq -{{[0-9]+}}(%rsp), %rax -; AVX512_64_LIN-NEXT: retq -; -; SSE3_32_WIN-LABEL: x_to_u64: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: fldt 8(%ebp) -; SSE3_32_WIN-NEXT: flds __real@5f000000 -; SSE3_32_WIN-NEXT: xorl %edx, %edx -; SSE3_32_WIN-NEXT: fucomi %st(1), %st -; SSE3_32_WIN-NEXT: fldz -; SSE3_32_WIN-NEXT: fxch %st(1) -; SSE3_32_WIN-NEXT: fcmovnbe %st(1), %st -; SSE3_32_WIN-NEXT: fstp %st(1) -; SSE3_32_WIN-NEXT: fsubrp %st, %st(1) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: setbe %dl -; SSE3_32_WIN-NEXT: shll $31, %edx -; SSE3_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: x_to_u64: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: flds {{\.LCPI.*}} -; SSE3_32_LIN-NEXT: xorl %edx, %edx -; SSE3_32_LIN-NEXT: fucomi %st(1), %st -; SSE3_32_LIN-NEXT: fldz -; SSE3_32_LIN-NEXT: fxch %st(1) -; SSE3_32_LIN-NEXT: fcmovnbe %st(1), %st -; SSE3_32_LIN-NEXT: fstp %st(1) -; SSE3_32_LIN-NEXT: fsubrp %st, %st(1) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: setbe %dl -; SSE3_32_LIN-NEXT: shll $31, %edx -; SSE3_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64_WIN-LABEL: x_to_u64: -; SSE3_64_WIN: # %bb.0: -; SSE3_64_WIN-NEXT: pushq %rax -; SSE3_64_WIN-NEXT: fldt (%rcx) -; SSE3_64_WIN-NEXT: flds __real@{{.*}}(%rip) -; SSE3_64_WIN-NEXT: xorl %eax, %eax -; SSE3_64_WIN-NEXT: fucomi %st(1), %st -; SSE3_64_WIN-NEXT: fldz -; SSE3_64_WIN-NEXT: fxch %st(1) -; SSE3_64_WIN-NEXT: fcmovnbe %st(1), %st -; SSE3_64_WIN-NEXT: fstp %st(1) -; SSE3_64_WIN-NEXT: fsubrp %st, %st(1) -; SSE3_64_WIN-NEXT: fisttpll (%rsp) -; SSE3_64_WIN-NEXT: setbe %al -; SSE3_64_WIN-NEXT: shlq $63, %rax -; SSE3_64_WIN-NEXT: xorq (%rsp), %rax -; SSE3_64_WIN-NEXT: popq %rcx -; SSE3_64_WIN-NEXT: retq -; -; SSE3_64_LIN-LABEL: x_to_u64: -; SSE3_64_LIN: # %bb.0: -; SSE3_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; SSE3_64_LIN-NEXT: flds {{.*}}(%rip) -; SSE3_64_LIN-NEXT: xorl %eax, %eax -; SSE3_64_LIN-NEXT: fucomi %st(1), %st -; SSE3_64_LIN-NEXT: fldz -; SSE3_64_LIN-NEXT: fxch %st(1) -; SSE3_64_LIN-NEXT: fcmovnbe %st(1), %st -; SSE3_64_LIN-NEXT: fstp %st(1) -; SSE3_64_LIN-NEXT: fsubrp %st, %st(1) -; SSE3_64_LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) -; SSE3_64_LIN-NEXT: setbe %al -; SSE3_64_LIN-NEXT: shlq $63, %rax -; SSE3_64_LIN-NEXT: xorq -{{[0-9]+}}(%rsp), %rax -; SSE3_64_LIN-NEXT: retq -; -; SSE2_32_WIN-LABEL: x_to_u64: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl %ebp -; SSE2_32_WIN-NEXT: movl %esp, %ebp -; SSE2_32_WIN-NEXT: andl $-8, %esp -; SSE2_32_WIN-NEXT: subl $16, %esp -; SSE2_32_WIN-NEXT: fldt 8(%ebp) -; SSE2_32_WIN-NEXT: flds __real@5f000000 -; SSE2_32_WIN-NEXT: xorl %edx, %edx -; SSE2_32_WIN-NEXT: fucomi %st(1), %st -; SSE2_32_WIN-NEXT: setbe %dl -; SSE2_32_WIN-NEXT: fldz -; SSE2_32_WIN-NEXT: fxch %st(1) -; SSE2_32_WIN-NEXT: fcmovnbe %st(1), %st -; SSE2_32_WIN-NEXT: fstp %st(1) -; SSE2_32_WIN-NEXT: fsubrp %st, %st(1) -; SSE2_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: shll $31, %edx -; SSE2_32_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: movl %ebp, %esp -; SSE2_32_WIN-NEXT: popl %ebp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: x_to_u64: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $20, %esp -; SSE2_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: flds {{\.LCPI.*}} -; SSE2_32_LIN-NEXT: xorl %edx, %edx -; SSE2_32_LIN-NEXT: fucomi %st(1), %st -; SSE2_32_LIN-NEXT: setbe %dl -; SSE2_32_LIN-NEXT: fldz -; SSE2_32_LIN-NEXT: fxch %st(1) -; SSE2_32_LIN-NEXT: fcmovnbe %st(1), %st -; SSE2_32_LIN-NEXT: fstp %st(1) -; SSE2_32_LIN-NEXT: fsubrp %st, %st(1) -; SSE2_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: shll $31, %edx -; SSE2_32_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: addl $20, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64_WIN-LABEL: x_to_u64: -; SSE2_64_WIN: # %bb.0: -; SSE2_64_WIN-NEXT: subq $16, %rsp -; SSE2_64_WIN-NEXT: fldt (%rcx) -; SSE2_64_WIN-NEXT: flds __real@{{.*}}(%rip) -; SSE2_64_WIN-NEXT: xorl %eax, %eax -; SSE2_64_WIN-NEXT: fucomi %st(1), %st -; SSE2_64_WIN-NEXT: setbe %al -; SSE2_64_WIN-NEXT: fldz -; SSE2_64_WIN-NEXT: fxch %st(1) -; SSE2_64_WIN-NEXT: fcmovnbe %st(1), %st -; SSE2_64_WIN-NEXT: fstp %st(1) -; SSE2_64_WIN-NEXT: fsubrp %st, %st(1) -; SSE2_64_WIN-NEXT: fnstcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: movzwl {{[0-9]+}}(%rsp), %ecx -; SSE2_64_WIN-NEXT: orl $3072, %ecx # imm = 0xC00 -; SSE2_64_WIN-NEXT: movw %cx, {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fistpll {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: shlq $63, %rax -; SSE2_64_WIN-NEXT: xorq {{[0-9]+}}(%rsp), %rax -; SSE2_64_WIN-NEXT: addq $16, %rsp -; SSE2_64_WIN-NEXT: retq -; -; SSE2_64_LIN-LABEL: x_to_u64: -; SSE2_64_LIN: # %bb.0: -; SSE2_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: flds {{.*}}(%rip) -; SSE2_64_LIN-NEXT: xorl %eax, %eax -; SSE2_64_LIN-NEXT: fucomi %st(1), %st -; SSE2_64_LIN-NEXT: setbe %al -; SSE2_64_LIN-NEXT: fldz -; SSE2_64_LIN-NEXT: fxch %st(1) -; SSE2_64_LIN-NEXT: fcmovnbe %st(1), %st -; SSE2_64_LIN-NEXT: fstp %st(1) -; SSE2_64_LIN-NEXT: fsubrp %st, %st(1) -; SSE2_64_LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %ecx -; SSE2_64_LIN-NEXT: orl $3072, %ecx # imm = 0xC00 -; SSE2_64_LIN-NEXT: movw %cx, -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fistpll -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: shlq $63, %rax -; SSE2_64_LIN-NEXT: xorq -{{[0-9]+}}(%rsp), %rax -; SSE2_64_LIN-NEXT: retq -; -; X87_WIN-LABEL: x_to_u64: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: fldt 8(%ebp) -; X87_WIN-NEXT: flds __real@5f000000 -; X87_WIN-NEXT: fucom %st(1) -; X87_WIN-NEXT: fnstsw %ax -; X87_WIN-NEXT: xorl %edx, %edx -; X87_WIN-NEXT: # kill: def $ah killed $ah killed $ax -; X87_WIN-NEXT: sahf -; X87_WIN-NEXT: setbe %al -; X87_WIN-NEXT: fldz -; X87_WIN-NEXT: ja LBB4_2 -; X87_WIN-NEXT: # %bb.1: -; X87_WIN-NEXT: fstp %st(0) -; X87_WIN-NEXT: fldz -; X87_WIN-NEXT: fxch %st(1) -; X87_WIN-NEXT: LBB4_2: -; X87_WIN-NEXT: fstp %st(1) -; X87_WIN-NEXT: fsubrp %st, %st(1) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx -; X87_WIN-NEXT: orl $3072, %ecx # imm = 0xC00 -; X87_WIN-NEXT: movw %cx, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movb %al, %dl -; X87_WIN-NEXT: shll $31, %edx -; X87_WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: x_to_u64: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; X87_LIN-NEXT: flds {{\.LCPI.*}} -; X87_LIN-NEXT: fucom %st(1) -; X87_LIN-NEXT: fnstsw %ax -; X87_LIN-NEXT: xorl %edx, %edx -; X87_LIN-NEXT: # kill: def $ah killed $ah killed $ax -; X87_LIN-NEXT: sahf -; X87_LIN-NEXT: setbe %al -; X87_LIN-NEXT: fldz -; X87_LIN-NEXT: ja .LBB4_2 -; X87_LIN-NEXT: # %bb.1: -; X87_LIN-NEXT: fstp %st(0) -; X87_LIN-NEXT: fldz -; X87_LIN-NEXT: fxch %st(1) -; X87_LIN-NEXT: .LBB4_2: -; X87_LIN-NEXT: fstp %st(1) -; X87_LIN-NEXT: fsubrp %st, %st(1) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx -; X87_LIN-NEXT: orl $3072, %ecx # imm = 0xC00 -; X87_LIN-NEXT: movw %cx, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movb %al, %dl -; X87_LIN-NEXT: shll $31, %edx -; X87_LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-WIN-LABEL: x_to_u64: +; X86-AVX512-WIN: # %bb.0: +; X86-AVX512-WIN-NEXT: pushl %ebp +; X86-AVX512-WIN-NEXT: movl %esp, %ebp +; X86-AVX512-WIN-NEXT: andl $-8, %esp +; X86-AVX512-WIN-NEXT: subl $8, %esp +; X86-AVX512-WIN-NEXT: fldt 8(%ebp) +; X86-AVX512-WIN-NEXT: flds __real@5f000000 +; X86-AVX512-WIN-NEXT: xorl %edx, %edx +; X86-AVX512-WIN-NEXT: fucomi %st(1), %st +; X86-AVX512-WIN-NEXT: fldz +; X86-AVX512-WIN-NEXT: fxch %st(1) +; X86-AVX512-WIN-NEXT: fcmovnbe %st(1), %st +; X86-AVX512-WIN-NEXT: fstp %st(1) +; X86-AVX512-WIN-NEXT: fsubrp %st, %st(1) +; X86-AVX512-WIN-NEXT: fisttpll (%esp) +; X86-AVX512-WIN-NEXT: setbe %dl +; X86-AVX512-WIN-NEXT: shll $31, %edx +; X86-AVX512-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-AVX512-WIN-NEXT: movl (%esp), %eax +; X86-AVX512-WIN-NEXT: movl %ebp, %esp +; X86-AVX512-WIN-NEXT: popl %ebp +; X86-AVX512-WIN-NEXT: retl +; +; X86-AVX512-LIN-LABEL: x_to_u64: +; X86-AVX512-LIN: # %bb.0: +; X86-AVX512-LIN-NEXT: subl $12, %esp +; X86-AVX512-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-AVX512-LIN-NEXT: flds {{\.LCPI.*}} +; X86-AVX512-LIN-NEXT: xorl %edx, %edx +; X86-AVX512-LIN-NEXT: fucomi %st(1), %st +; X86-AVX512-LIN-NEXT: fldz +; X86-AVX512-LIN-NEXT: fxch %st(1) +; X86-AVX512-LIN-NEXT: fcmovnbe %st(1), %st +; X86-AVX512-LIN-NEXT: fstp %st(1) +; X86-AVX512-LIN-NEXT: fsubrp %st, %st(1) +; X86-AVX512-LIN-NEXT: fisttpll (%esp) +; X86-AVX512-LIN-NEXT: setbe %dl +; X86-AVX512-LIN-NEXT: shll $31, %edx +; X86-AVX512-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-AVX512-LIN-NEXT: movl (%esp), %eax +; X86-AVX512-LIN-NEXT: addl $12, %esp +; X86-AVX512-LIN-NEXT: retl +; +; X64-AVX512-WIN-LABEL: x_to_u64: +; X64-AVX512-WIN: # %bb.0: +; X64-AVX512-WIN-NEXT: pushq %rax +; X64-AVX512-WIN-NEXT: fldt (%rcx) +; X64-AVX512-WIN-NEXT: flds __real@{{.*}}(%rip) +; X64-AVX512-WIN-NEXT: xorl %eax, %eax +; X64-AVX512-WIN-NEXT: fucomi %st(1), %st +; X64-AVX512-WIN-NEXT: fldz +; X64-AVX512-WIN-NEXT: fxch %st(1) +; X64-AVX512-WIN-NEXT: fcmovnbe %st(1), %st +; X64-AVX512-WIN-NEXT: fstp %st(1) +; X64-AVX512-WIN-NEXT: fsubrp %st, %st(1) +; X64-AVX512-WIN-NEXT: fisttpll (%rsp) +; X64-AVX512-WIN-NEXT: setbe %al +; X64-AVX512-WIN-NEXT: shlq $63, %rax +; X64-AVX512-WIN-NEXT: xorq (%rsp), %rax +; X64-AVX512-WIN-NEXT: popq %rcx +; X64-AVX512-WIN-NEXT: retq +; +; X64-AVX512-LIN-LABEL: x_to_u64: +; X64-AVX512-LIN: # %bb.0: +; X64-AVX512-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-AVX512-LIN-NEXT: flds {{.*}}(%rip) +; X64-AVX512-LIN-NEXT: xorl %eax, %eax +; X64-AVX512-LIN-NEXT: fucomi %st(1), %st +; X64-AVX512-LIN-NEXT: fldz +; X64-AVX512-LIN-NEXT: fxch %st(1) +; X64-AVX512-LIN-NEXT: fcmovnbe %st(1), %st +; X64-AVX512-LIN-NEXT: fstp %st(1) +; X64-AVX512-LIN-NEXT: fsubrp %st, %st(1) +; X64-AVX512-LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) +; X64-AVX512-LIN-NEXT: setbe %al +; X64-AVX512-LIN-NEXT: shlq $63, %rax +; X64-AVX512-LIN-NEXT: xorq -{{[0-9]+}}(%rsp), %rax +; X64-AVX512-LIN-NEXT: retq +; +; X86-SSE3-WIN-LABEL: x_to_u64: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: fldt 8(%ebp) +; X86-SSE3-WIN-NEXT: flds __real@5f000000 +; X86-SSE3-WIN-NEXT: xorl %edx, %edx +; X86-SSE3-WIN-NEXT: fucomi %st(1), %st +; X86-SSE3-WIN-NEXT: fldz +; X86-SSE3-WIN-NEXT: fxch %st(1) +; X86-SSE3-WIN-NEXT: fcmovnbe %st(1), %st +; X86-SSE3-WIN-NEXT: fstp %st(1) +; X86-SSE3-WIN-NEXT: fsubrp %st, %st(1) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: setbe %dl +; X86-SSE3-WIN-NEXT: shll $31, %edx +; X86-SSE3-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: x_to_u64: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE3-LIN-NEXT: flds {{\.LCPI.*}} +; X86-SSE3-LIN-NEXT: xorl %edx, %edx +; X86-SSE3-LIN-NEXT: fucomi %st(1), %st +; X86-SSE3-LIN-NEXT: fldz +; X86-SSE3-LIN-NEXT: fxch %st(1) +; X86-SSE3-LIN-NEXT: fcmovnbe %st(1), %st +; X86-SSE3-LIN-NEXT: fstp %st(1) +; X86-SSE3-LIN-NEXT: fsubrp %st, %st(1) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: setbe %dl +; X86-SSE3-LIN-NEXT: shll $31, %edx +; X86-SSE3-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE3-WIN-LABEL: x_to_u64: +; X64-SSE3-WIN: # %bb.0: +; X64-SSE3-WIN-NEXT: pushq %rax +; X64-SSE3-WIN-NEXT: fldt (%rcx) +; X64-SSE3-WIN-NEXT: flds __real@{{.*}}(%rip) +; X64-SSE3-WIN-NEXT: xorl %eax, %eax +; X64-SSE3-WIN-NEXT: fucomi %st(1), %st +; X64-SSE3-WIN-NEXT: fldz +; X64-SSE3-WIN-NEXT: fxch %st(1) +; X64-SSE3-WIN-NEXT: fcmovnbe %st(1), %st +; X64-SSE3-WIN-NEXT: fstp %st(1) +; X64-SSE3-WIN-NEXT: fsubrp %st, %st(1) +; X64-SSE3-WIN-NEXT: fisttpll (%rsp) +; X64-SSE3-WIN-NEXT: setbe %al +; X64-SSE3-WIN-NEXT: shlq $63, %rax +; X64-SSE3-WIN-NEXT: xorq (%rsp), %rax +; X64-SSE3-WIN-NEXT: popq %rcx +; X64-SSE3-WIN-NEXT: retq +; +; X64-SSE3-LIN-LABEL: x_to_u64: +; X64-SSE3-LIN: # %bb.0: +; X64-SSE3-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-SSE3-LIN-NEXT: flds {{.*}}(%rip) +; X64-SSE3-LIN-NEXT: xorl %eax, %eax +; X64-SSE3-LIN-NEXT: fucomi %st(1), %st +; X64-SSE3-LIN-NEXT: fldz +; X64-SSE3-LIN-NEXT: fxch %st(1) +; X64-SSE3-LIN-NEXT: fcmovnbe %st(1), %st +; X64-SSE3-LIN-NEXT: fstp %st(1) +; X64-SSE3-LIN-NEXT: fsubrp %st, %st(1) +; X64-SSE3-LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) +; X64-SSE3-LIN-NEXT: setbe %al +; X64-SSE3-LIN-NEXT: shlq $63, %rax +; X64-SSE3-LIN-NEXT: xorq -{{[0-9]+}}(%rsp), %rax +; X64-SSE3-LIN-NEXT: retq +; +; X86-SSE2-WIN-LABEL: x_to_u64: +; X86-SSE2-WIN: # %bb.0: +; X86-SSE2-WIN-NEXT: pushl %ebp +; X86-SSE2-WIN-NEXT: movl %esp, %ebp +; X86-SSE2-WIN-NEXT: andl $-8, %esp +; X86-SSE2-WIN-NEXT: subl $16, %esp +; X86-SSE2-WIN-NEXT: fldt 8(%ebp) +; X86-SSE2-WIN-NEXT: flds __real@5f000000 +; X86-SSE2-WIN-NEXT: xorl %edx, %edx +; X86-SSE2-WIN-NEXT: fucomi %st(1), %st +; X86-SSE2-WIN-NEXT: setbe %dl +; X86-SSE2-WIN-NEXT: fldz +; X86-SSE2-WIN-NEXT: fxch %st(1) +; X86-SSE2-WIN-NEXT: fcmovnbe %st(1), %st +; X86-SSE2-WIN-NEXT: fstp %st(1) +; X86-SSE2-WIN-NEXT: fsubrp %st, %st(1) +; X86-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: shll $31, %edx +; X86-SSE2-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: movl %ebp, %esp +; X86-SSE2-WIN-NEXT: popl %ebp +; X86-SSE2-WIN-NEXT: retl +; +; X86-SSE2-LIN-LABEL: x_to_u64: +; X86-SSE2-LIN: # %bb.0: +; X86-SSE2-LIN-NEXT: subl $20, %esp +; X86-SSE2-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: flds {{\.LCPI.*}} +; X86-SSE2-LIN-NEXT: xorl %edx, %edx +; X86-SSE2-LIN-NEXT: fucomi %st(1), %st +; X86-SSE2-LIN-NEXT: setbe %dl +; X86-SSE2-LIN-NEXT: fldz +; X86-SSE2-LIN-NEXT: fxch %st(1) +; X86-SSE2-LIN-NEXT: fcmovnbe %st(1), %st +; X86-SSE2-LIN-NEXT: fstp %st(1) +; X86-SSE2-LIN-NEXT: fsubrp %st, %st(1) +; X86-SSE2-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: shll $31, %edx +; X86-SSE2-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: addl $20, %esp +; X86-SSE2-LIN-NEXT: retl +; +; X64-SSE2-WIN-LABEL: x_to_u64: +; X64-SSE2-WIN: # %bb.0: +; X64-SSE2-WIN-NEXT: subq $16, %rsp +; X64-SSE2-WIN-NEXT: fldt (%rcx) +; X64-SSE2-WIN-NEXT: flds __real@{{.*}}(%rip) +; X64-SSE2-WIN-NEXT: xorl %eax, %eax +; X64-SSE2-WIN-NEXT: fucomi %st(1), %st +; X64-SSE2-WIN-NEXT: setbe %al +; X64-SSE2-WIN-NEXT: fldz +; X64-SSE2-WIN-NEXT: fxch %st(1) +; X64-SSE2-WIN-NEXT: fcmovnbe %st(1), %st +; X64-SSE2-WIN-NEXT: fstp %st(1) +; X64-SSE2-WIN-NEXT: fsubrp %st, %st(1) +; X64-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%rsp), %ecx +; X64-SSE2-WIN-NEXT: orl $3072, %ecx # imm = 0xC00 +; X64-SSE2-WIN-NEXT: movw %cx, {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: shlq $63, %rax +; X64-SSE2-WIN-NEXT: xorq {{[0-9]+}}(%rsp), %rax +; X64-SSE2-WIN-NEXT: addq $16, %rsp +; X64-SSE2-WIN-NEXT: retq +; +; X64-SSE2-LIN-LABEL: x_to_u64: +; X64-SSE2-LIN: # %bb.0: +; X64-SSE2-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: flds {{.*}}(%rip) +; X64-SSE2-LIN-NEXT: xorl %eax, %eax +; X64-SSE2-LIN-NEXT: fucomi %st(1), %st +; X64-SSE2-LIN-NEXT: setbe %al +; X64-SSE2-LIN-NEXT: fldz +; X64-SSE2-LIN-NEXT: fxch %st(1) +; X64-SSE2-LIN-NEXT: fcmovnbe %st(1), %st +; X64-SSE2-LIN-NEXT: fstp %st(1) +; X64-SSE2-LIN-NEXT: fsubrp %st, %st(1) +; X64-SSE2-LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %ecx +; X64-SSE2-LIN-NEXT: orl $3072, %ecx # imm = 0xC00 +; X64-SSE2-LIN-NEXT: movw %cx, -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fistpll -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: shlq $63, %rax +; X64-SSE2-LIN-NEXT: xorq -{{[0-9]+}}(%rsp), %rax +; X64-SSE2-LIN-NEXT: retq +; +; X87-WIN-LABEL: x_to_u64: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: fldt 8(%ebp) +; X87-WIN-NEXT: flds __real@5f000000 +; X87-WIN-NEXT: fucom %st(1) +; X87-WIN-NEXT: fnstsw %ax +; X87-WIN-NEXT: xorl %edx, %edx +; X87-WIN-NEXT: # kill: def $ah killed $ah killed $ax +; X87-WIN-NEXT: sahf +; X87-WIN-NEXT: setbe %al +; X87-WIN-NEXT: fldz +; X87-WIN-NEXT: ja LBB4_2 +; X87-WIN-NEXT: # %bb.1: +; X87-WIN-NEXT: fstp %st(0) +; X87-WIN-NEXT: fldz +; X87-WIN-NEXT: fxch %st(1) +; X87-WIN-NEXT: LBB4_2: +; X87-WIN-NEXT: fstp %st(1) +; X87-WIN-NEXT: fsubrp %st, %st(1) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx +; X87-WIN-NEXT: orl $3072, %ecx # imm = 0xC00 +; X87-WIN-NEXT: movw %cx, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movb %al, %dl +; X87-WIN-NEXT: shll $31, %edx +; X87-WIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: x_to_u64: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X87-LIN-NEXT: flds {{\.LCPI.*}} +; X87-LIN-NEXT: fucom %st(1) +; X87-LIN-NEXT: fnstsw %ax +; X87-LIN-NEXT: xorl %edx, %edx +; X87-LIN-NEXT: # kill: def $ah killed $ah killed $ax +; X87-LIN-NEXT: sahf +; X87-LIN-NEXT: setbe %al +; X87-LIN-NEXT: fldz +; X87-LIN-NEXT: ja .LBB4_2 +; X87-LIN-NEXT: # %bb.1: +; X87-LIN-NEXT: fstp %st(0) +; X87-LIN-NEXT: fldz +; X87-LIN-NEXT: fxch %st(1) +; X87-LIN-NEXT: .LBB4_2: +; X87-LIN-NEXT: fstp %st(1) +; X87-LIN-NEXT: fsubrp %st, %st(1) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %ecx +; X87-LIN-NEXT: orl $3072, %ecx # imm = 0xC00 +; X87-LIN-NEXT: movw %cx, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movb %al, %dl +; X87-LIN-NEXT: shll $31, %edx +; X87-LIN-NEXT: xorl {{[0-9]+}}(%esp), %edx +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptoui x86_fp80 %a to i64 ret i64 %r } define i64 @x_to_s64(x86_fp80 %a) nounwind { -; AVX512_32_WIN-LABEL: x_to_s64: -; AVX512_32_WIN: # %bb.0: -; AVX512_32_WIN-NEXT: pushl %ebp -; AVX512_32_WIN-NEXT: movl %esp, %ebp -; AVX512_32_WIN-NEXT: andl $-8, %esp -; AVX512_32_WIN-NEXT: subl $8, %esp -; AVX512_32_WIN-NEXT: fldt 8(%ebp) -; AVX512_32_WIN-NEXT: fisttpll (%esp) -; AVX512_32_WIN-NEXT: movl (%esp), %eax -; AVX512_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; AVX512_32_WIN-NEXT: movl %ebp, %esp -; AVX512_32_WIN-NEXT: popl %ebp -; AVX512_32_WIN-NEXT: retl -; -; AVX512_32_LIN-LABEL: x_to_s64: -; AVX512_32_LIN: # %bb.0: -; AVX512_32_LIN-NEXT: subl $12, %esp -; AVX512_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; AVX512_32_LIN-NEXT: fisttpll (%esp) -; AVX512_32_LIN-NEXT: movl (%esp), %eax -; AVX512_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; AVX512_32_LIN-NEXT: addl $12, %esp -; AVX512_32_LIN-NEXT: retl -; -; AVX512_64_WIN-LABEL: x_to_s64: -; AVX512_64_WIN: # %bb.0: -; AVX512_64_WIN-NEXT: pushq %rax -; AVX512_64_WIN-NEXT: fldt (%rcx) -; AVX512_64_WIN-NEXT: fisttpll (%rsp) -; AVX512_64_WIN-NEXT: movq (%rsp), %rax -; AVX512_64_WIN-NEXT: popq %rcx -; AVX512_64_WIN-NEXT: retq -; -; AVX512_64_LIN-LABEL: x_to_s64: -; AVX512_64_LIN: # %bb.0: -; AVX512_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; AVX512_64_LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) -; AVX512_64_LIN-NEXT: movq -{{[0-9]+}}(%rsp), %rax -; AVX512_64_LIN-NEXT: retq -; -; SSE3_32_WIN-LABEL: x_to_s64: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl %ebp -; SSE3_32_WIN-NEXT: movl %esp, %ebp -; SSE3_32_WIN-NEXT: andl $-8, %esp -; SSE3_32_WIN-NEXT: subl $8, %esp -; SSE3_32_WIN-NEXT: fldt 8(%ebp) -; SSE3_32_WIN-NEXT: fisttpll (%esp) -; SSE3_32_WIN-NEXT: movl (%esp), %eax -; SSE3_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE3_32_WIN-NEXT: movl %ebp, %esp -; SSE3_32_WIN-NEXT: popl %ebp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: x_to_s64: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: fisttpll (%esp) -; SSE3_32_LIN-NEXT: movl (%esp), %eax -; SSE3_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE3_32_LIN-NEXT: addl $12, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64_WIN-LABEL: x_to_s64: -; SSE3_64_WIN: # %bb.0: -; SSE3_64_WIN-NEXT: pushq %rax -; SSE3_64_WIN-NEXT: fldt (%rcx) -; SSE3_64_WIN-NEXT: fisttpll (%rsp) -; SSE3_64_WIN-NEXT: movq (%rsp), %rax -; SSE3_64_WIN-NEXT: popq %rcx -; SSE3_64_WIN-NEXT: retq -; -; SSE3_64_LIN-LABEL: x_to_s64: -; SSE3_64_LIN: # %bb.0: -; SSE3_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; SSE3_64_LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) -; SSE3_64_LIN-NEXT: movq -{{[0-9]+}}(%rsp), %rax -; SSE3_64_LIN-NEXT: retq -; -; SSE2_32_WIN-LABEL: x_to_s64: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl %ebp -; SSE2_32_WIN-NEXT: movl %esp, %ebp -; SSE2_32_WIN-NEXT: andl $-8, %esp -; SSE2_32_WIN-NEXT: subl $16, %esp -; SSE2_32_WIN-NEXT: fldt 8(%ebp) -; SSE2_32_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE2_32_WIN-NEXT: movl %ebp, %esp -; SSE2_32_WIN-NEXT: popl %ebp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: x_to_s64: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $20, %esp -; SSE2_32_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_32_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; SSE2_32_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; SSE2_32_LIN-NEXT: addl $20, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64_WIN-LABEL: x_to_s64: -; SSE2_64_WIN: # %bb.0: -; SSE2_64_WIN-NEXT: subq $16, %rsp -; SSE2_64_WIN-NEXT: fldt (%rcx) -; SSE2_64_WIN-NEXT: fnstcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: movzwl {{[0-9]+}}(%rsp), %eax -; SSE2_64_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_64_WIN-NEXT: movw %ax, {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fistpll {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: fldcw {{[0-9]+}}(%rsp) -; SSE2_64_WIN-NEXT: movq {{[0-9]+}}(%rsp), %rax -; SSE2_64_WIN-NEXT: addq $16, %rsp -; SSE2_64_WIN-NEXT: retq -; -; SSE2_64_LIN-LABEL: x_to_s64: -; SSE2_64_LIN: # %bb.0: -; SSE2_64_LIN-NEXT: fldt {{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax -; SSE2_64_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; SSE2_64_LIN-NEXT: movw %ax, -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fistpll -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) -; SSE2_64_LIN-NEXT: movq -{{[0-9]+}}(%rsp), %rax -; SSE2_64_LIN-NEXT: retq -; -; X87_WIN-LABEL: x_to_s64: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl %ebp -; X87_WIN-NEXT: movl %esp, %ebp -; X87_WIN-NEXT: andl $-8, %esp -; X87_WIN-NEXT: subl $16, %esp -; X87_WIN-NEXT: fldt 8(%ebp) -; X87_WIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_WIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_WIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; X87_WIN-NEXT: movl %ebp, %esp -; X87_WIN-NEXT: popl %ebp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: x_to_s64: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $20, %esp -; X87_LIN-NEXT: fldt {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fnstcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: orl $3072, %eax # imm = 0xC00 -; X87_LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fistpll {{[0-9]+}}(%esp) -; X87_LIN-NEXT: fldcw {{[0-9]+}}(%esp) -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %eax -; X87_LIN-NEXT: movl {{[0-9]+}}(%esp), %edx -; X87_LIN-NEXT: addl $20, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-WIN-LABEL: x_to_s64: +; X86-AVX512-WIN: # %bb.0: +; X86-AVX512-WIN-NEXT: pushl %ebp +; X86-AVX512-WIN-NEXT: movl %esp, %ebp +; X86-AVX512-WIN-NEXT: andl $-8, %esp +; X86-AVX512-WIN-NEXT: subl $8, %esp +; X86-AVX512-WIN-NEXT: fldt 8(%ebp) +; X86-AVX512-WIN-NEXT: fisttpll (%esp) +; X86-AVX512-WIN-NEXT: movl (%esp), %eax +; X86-AVX512-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX512-WIN-NEXT: movl %ebp, %esp +; X86-AVX512-WIN-NEXT: popl %ebp +; X86-AVX512-WIN-NEXT: retl +; +; X86-AVX512-LIN-LABEL: x_to_s64: +; X86-AVX512-LIN: # %bb.0: +; X86-AVX512-LIN-NEXT: subl $12, %esp +; X86-AVX512-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-AVX512-LIN-NEXT: fisttpll (%esp) +; X86-AVX512-LIN-NEXT: movl (%esp), %eax +; X86-AVX512-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-AVX512-LIN-NEXT: addl $12, %esp +; X86-AVX512-LIN-NEXT: retl +; +; X64-AVX512-WIN-LABEL: x_to_s64: +; X64-AVX512-WIN: # %bb.0: +; X64-AVX512-WIN-NEXT: pushq %rax +; X64-AVX512-WIN-NEXT: fldt (%rcx) +; X64-AVX512-WIN-NEXT: fisttpll (%rsp) +; X64-AVX512-WIN-NEXT: movq (%rsp), %rax +; X64-AVX512-WIN-NEXT: popq %rcx +; X64-AVX512-WIN-NEXT: retq +; +; X64-AVX512-LIN-LABEL: x_to_s64: +; X64-AVX512-LIN: # %bb.0: +; X64-AVX512-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-AVX512-LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) +; X64-AVX512-LIN-NEXT: movq -{{[0-9]+}}(%rsp), %rax +; X64-AVX512-LIN-NEXT: retq +; +; X86-SSE3-WIN-LABEL: x_to_s64: +; X86-SSE3-WIN: # %bb.0: +; X86-SSE3-WIN-NEXT: pushl %ebp +; X86-SSE3-WIN-NEXT: movl %esp, %ebp +; X86-SSE3-WIN-NEXT: andl $-8, %esp +; X86-SSE3-WIN-NEXT: subl $8, %esp +; X86-SSE3-WIN-NEXT: fldt 8(%ebp) +; X86-SSE3-WIN-NEXT: fisttpll (%esp) +; X86-SSE3-WIN-NEXT: movl (%esp), %eax +; X86-SSE3-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE3-WIN-NEXT: movl %ebp, %esp +; X86-SSE3-WIN-NEXT: popl %ebp +; X86-SSE3-WIN-NEXT: retl +; +; X86-SSE3-LIN-LABEL: x_to_s64: +; X86-SSE3-LIN: # %bb.0: +; X86-SSE3-LIN-NEXT: subl $12, %esp +; X86-SSE3-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE3-LIN-NEXT: fisttpll (%esp) +; X86-SSE3-LIN-NEXT: movl (%esp), %eax +; X86-SSE3-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE3-LIN-NEXT: addl $12, %esp +; X86-SSE3-LIN-NEXT: retl +; +; X64-SSE3-WIN-LABEL: x_to_s64: +; X64-SSE3-WIN: # %bb.0: +; X64-SSE3-WIN-NEXT: pushq %rax +; X64-SSE3-WIN-NEXT: fldt (%rcx) +; X64-SSE3-WIN-NEXT: fisttpll (%rsp) +; X64-SSE3-WIN-NEXT: movq (%rsp), %rax +; X64-SSE3-WIN-NEXT: popq %rcx +; X64-SSE3-WIN-NEXT: retq +; +; X64-SSE3-LIN-LABEL: x_to_s64: +; X64-SSE3-LIN: # %bb.0: +; X64-SSE3-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-SSE3-LIN-NEXT: fisttpll -{{[0-9]+}}(%rsp) +; X64-SSE3-LIN-NEXT: movq -{{[0-9]+}}(%rsp), %rax +; X64-SSE3-LIN-NEXT: retq +; +; X86-SSE2-WIN-LABEL: x_to_s64: +; X86-SSE2-WIN: # %bb.0: +; X86-SSE2-WIN-NEXT: pushl %ebp +; X86-SSE2-WIN-NEXT: movl %esp, %ebp +; X86-SSE2-WIN-NEXT: andl $-8, %esp +; X86-SSE2-WIN-NEXT: subl $16, %esp +; X86-SSE2-WIN-NEXT: fldt 8(%ebp) +; X86-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE2-WIN-NEXT: movl %ebp, %esp +; X86-SSE2-WIN-NEXT: popl %ebp +; X86-SSE2-WIN-NEXT: retl +; +; X86-SSE2-LIN-LABEL: x_to_s64: +; X86-SSE2-LIN: # %bb.0: +; X86-SSE2-LIN-NEXT: subl $20, %esp +; X86-SSE2-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X86-SSE2-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X86-SSE2-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X86-SSE2-LIN-NEXT: addl $20, %esp +; X86-SSE2-LIN-NEXT: retl +; +; X64-SSE2-WIN-LABEL: x_to_s64: +; X64-SSE2-WIN: # %bb.0: +; X64-SSE2-WIN-NEXT: subq $16, %rsp +; X64-SSE2-WIN-NEXT: fldt (%rcx) +; X64-SSE2-WIN-NEXT: fnstcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: movzwl {{[0-9]+}}(%rsp), %eax +; X64-SSE2-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X64-SSE2-WIN-NEXT: movw %ax, {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fistpll {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: fldcw {{[0-9]+}}(%rsp) +; X64-SSE2-WIN-NEXT: movq {{[0-9]+}}(%rsp), %rax +; X64-SSE2-WIN-NEXT: addq $16, %rsp +; X64-SSE2-WIN-NEXT: retq +; +; X64-SSE2-LIN-LABEL: x_to_s64: +; X64-SSE2-LIN: # %bb.0: +; X64-SSE2-LIN-NEXT: fldt {{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fnstcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: movzwl -{{[0-9]+}}(%rsp), %eax +; X64-SSE2-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X64-SSE2-LIN-NEXT: movw %ax, -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fistpll -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: fldcw -{{[0-9]+}}(%rsp) +; X64-SSE2-LIN-NEXT: movq -{{[0-9]+}}(%rsp), %rax +; X64-SSE2-LIN-NEXT: retq +; +; X87-WIN-LABEL: x_to_s64: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl %ebp +; X87-WIN-NEXT: movl %esp, %ebp +; X87-WIN-NEXT: andl $-8, %esp +; X87-WIN-NEXT: subl $16, %esp +; X87-WIN-NEXT: fldt 8(%ebp) +; X87-WIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-WIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-WIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-WIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X87-WIN-NEXT: movl %ebp, %esp +; X87-WIN-NEXT: popl %ebp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: x_to_s64: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $20, %esp +; X87-LIN-NEXT: fldt {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fnstcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movzwl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: orl $3072, %eax # imm = 0xC00 +; X87-LIN-NEXT: movw %ax, {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fistpll {{[0-9]+}}(%esp) +; X87-LIN-NEXT: fldcw {{[0-9]+}}(%esp) +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %eax +; X87-LIN-NEXT: movl {{[0-9]+}}(%esp), %edx +; X87-LIN-NEXT: addl $20, %esp +; X87-LIN-NEXT: retl %r = fptosi x86_fp80 %a to i64 ret i64 %r } define i64 @t_to_u64(fp128 %a) nounwind { -; AVX512_32_WIN-LABEL: t_to_u64: -; AVX512_32_WIN: # %bb.0: -; AVX512_32_WIN-NEXT: subl $16, %esp -; AVX512_32_WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0 -; AVX512_32_WIN-NEXT: vmovups %xmm0, (%esp) -; AVX512_32_WIN-NEXT: calll ___fixunstfdi -; AVX512_32_WIN-NEXT: addl $16, %esp -; AVX512_32_WIN-NEXT: retl -; -; AVX512_32_LIN-LABEL: t_to_u64: -; AVX512_32_LIN: # %bb.0: -; AVX512_32_LIN-NEXT: subl $28, %esp -; AVX512_32_LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0 -; AVX512_32_LIN-NEXT: vmovups %xmm0, (%esp) -; AVX512_32_LIN-NEXT: calll __fixunstfdi -; AVX512_32_LIN-NEXT: addl $28, %esp -; AVX512_32_LIN-NEXT: retl -; -; AVX512_64_WIN-LABEL: t_to_u64: -; AVX512_64_WIN: # %bb.0: -; AVX512_64_WIN-NEXT: subq $40, %rsp -; AVX512_64_WIN-NEXT: callq __fixunstfdi -; AVX512_64_WIN-NEXT: addq $40, %rsp -; AVX512_64_WIN-NEXT: retq -; -; AVX512_64_LIN-LABEL: t_to_u64: -; AVX512_64_LIN: # %bb.0: -; AVX512_64_LIN-NEXT: pushq %rax -; AVX512_64_LIN-NEXT: callq __fixunstfdi -; AVX512_64_LIN-NEXT: popq %rcx -; AVX512_64_LIN-NEXT: retq -; -; SSE3_32_WIN-LABEL: t_to_u64: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: calll ___fixunstfdi -; SSE3_32_WIN-NEXT: addl $16, %esp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: t_to_u64: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: calll __fixunstfdi -; SSE3_32_LIN-NEXT: addl $28, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64_WIN-LABEL: t_to_u64: -; SSE3_64_WIN: # %bb.0: -; SSE3_64_WIN-NEXT: subq $40, %rsp -; SSE3_64_WIN-NEXT: callq __fixunstfdi -; SSE3_64_WIN-NEXT: addq $40, %rsp -; SSE3_64_WIN-NEXT: retq -; -; SSE3_64_LIN-LABEL: t_to_u64: -; SSE3_64_LIN: # %bb.0: -; SSE3_64_LIN-NEXT: pushq %rax -; SSE3_64_LIN-NEXT: callq __fixunstfdi -; SSE3_64_LIN-NEXT: popq %rcx -; SSE3_64_LIN-NEXT: retq -; -; SSE2_32_WIN-LABEL: t_to_u64: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: calll ___fixunstfdi -; SSE2_32_WIN-NEXT: addl $16, %esp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: t_to_u64: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $12, %esp -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: calll __fixunstfdi -; SSE2_32_LIN-NEXT: addl $28, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64_WIN-LABEL: t_to_u64: -; SSE2_64_WIN: # %bb.0: -; SSE2_64_WIN-NEXT: subq $40, %rsp -; SSE2_64_WIN-NEXT: callq __fixunstfdi -; SSE2_64_WIN-NEXT: addq $40, %rsp -; SSE2_64_WIN-NEXT: retq -; -; SSE2_64_LIN-LABEL: t_to_u64: -; SSE2_64_LIN: # %bb.0: -; SSE2_64_LIN-NEXT: pushq %rax -; SSE2_64_LIN-NEXT: callq __fixunstfdi -; SSE2_64_LIN-NEXT: popq %rcx -; SSE2_64_LIN-NEXT: retq -; -; X87_WIN-LABEL: t_to_u64: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: calll ___fixunstfdi -; X87_WIN-NEXT: addl $16, %esp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: t_to_u64: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $12, %esp -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: calll __fixunstfdi -; X87_LIN-NEXT: addl $28, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-WIN-LABEL: t_to_u64: +; X86-AVX512-WIN: # %bb.0: +; X86-AVX512-WIN-NEXT: subl $16, %esp +; X86-AVX512-WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0 +; X86-AVX512-WIN-NEXT: vmovups %xmm0, (%esp) +; X86-AVX512-WIN-NEXT: calll ___fixunstfdi +; X86-AVX512-WIN-NEXT: addl $16, %esp +; X86-AVX512-WIN-NEXT: retl +; +; X86-AVX512-LIN-LABEL: t_to_u64: +; X86-AVX512-LIN: # %bb.0: +; X86-AVX512-LIN-NEXT: subl $28, %esp +; X86-AVX512-LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0 +; X86-AVX512-LIN-NEXT: vmovups %xmm0, (%esp) +; X86-AVX512-LIN-NEXT: calll __fixunstfdi +; X86-AVX512-LIN-NEXT: addl $28, %esp +; X86-AVX512-LIN-NEXT: retl +; +; X64-AVX512-WIN-LABEL: t_to_u64: +; X64-AVX512-WIN: # %bb.0: +; X64-AVX512-WIN-NEXT: subq $40, %rsp +; X64-AVX512-WIN-NEXT: callq __fixunstfdi +; X64-AVX512-WIN-NEXT: addq $40, %rsp +; X64-AVX512-WIN-NEXT: retq +; +; X64-AVX512-LIN-LABEL: t_to_u64: +; X64-AVX512-LIN: # %bb.0: +; X64-AVX512-LIN-NEXT: pushq %rax +; X64-AVX512-LIN-NEXT: callq __fixunstfdi +; X64-AVX512-LIN-NEXT: popq %rcx +; X64-AVX512-LIN-NEXT: retq +; +; X86-SSE-WIN-LABEL: t_to_u64: +; X86-SSE-WIN: # %bb.0: +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: calll ___fixunstfdi +; X86-SSE-WIN-NEXT: addl $16, %esp +; X86-SSE-WIN-NEXT: retl +; +; X86-SSE-LIN-LABEL: t_to_u64: +; X86-SSE-LIN: # %bb.0: +; X86-SSE-LIN-NEXT: subl $12, %esp +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: calll __fixunstfdi +; X86-SSE-LIN-NEXT: addl $28, %esp +; X86-SSE-LIN-NEXT: retl +; +; X64-SSE-WIN-LABEL: t_to_u64: +; X64-SSE-WIN: # %bb.0: +; X64-SSE-WIN-NEXT: subq $40, %rsp +; X64-SSE-WIN-NEXT: callq __fixunstfdi +; X64-SSE-WIN-NEXT: addq $40, %rsp +; X64-SSE-WIN-NEXT: retq +; +; X64-SSE-LIN-LABEL: t_to_u64: +; X64-SSE-LIN: # %bb.0: +; X64-SSE-LIN-NEXT: pushq %rax +; X64-SSE-LIN-NEXT: callq __fixunstfdi +; X64-SSE-LIN-NEXT: popq %rcx +; X64-SSE-LIN-NEXT: retq +; +; X87-WIN-LABEL: t_to_u64: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: calll ___fixunstfdi +; X87-WIN-NEXT: addl $16, %esp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: t_to_u64: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $12, %esp +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: calll __fixunstfdi +; X87-LIN-NEXT: addl $28, %esp +; X87-LIN-NEXT: retl %r = fptoui fp128 %a to i64 ret i64 %r } define i64 @t_to_s64(fp128 %a) nounwind { -; AVX512_32_WIN-LABEL: t_to_s64: -; AVX512_32_WIN: # %bb.0: -; AVX512_32_WIN-NEXT: subl $16, %esp -; AVX512_32_WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0 -; AVX512_32_WIN-NEXT: vmovups %xmm0, (%esp) -; AVX512_32_WIN-NEXT: calll ___fixtfdi -; AVX512_32_WIN-NEXT: addl $16, %esp -; AVX512_32_WIN-NEXT: retl -; -; AVX512_32_LIN-LABEL: t_to_s64: -; AVX512_32_LIN: # %bb.0: -; AVX512_32_LIN-NEXT: subl $28, %esp -; AVX512_32_LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0 -; AVX512_32_LIN-NEXT: vmovups %xmm0, (%esp) -; AVX512_32_LIN-NEXT: calll __fixtfdi -; AVX512_32_LIN-NEXT: addl $28, %esp -; AVX512_32_LIN-NEXT: retl -; -; AVX512_64_WIN-LABEL: t_to_s64: -; AVX512_64_WIN: # %bb.0: -; AVX512_64_WIN-NEXT: subq $40, %rsp -; AVX512_64_WIN-NEXT: callq __fixtfdi -; AVX512_64_WIN-NEXT: addq $40, %rsp -; AVX512_64_WIN-NEXT: retq -; -; AVX512_64_LIN-LABEL: t_to_s64: -; AVX512_64_LIN: # %bb.0: -; AVX512_64_LIN-NEXT: pushq %rax -; AVX512_64_LIN-NEXT: callq __fixtfdi -; AVX512_64_LIN-NEXT: popq %rcx -; AVX512_64_LIN-NEXT: retq -; -; SSE3_32_WIN-LABEL: t_to_s64: -; SSE3_32_WIN: # %bb.0: -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_WIN-NEXT: calll ___fixtfdi -; SSE3_32_WIN-NEXT: addl $16, %esp -; SSE3_32_WIN-NEXT: retl -; -; SSE3_32_LIN-LABEL: t_to_s64: -; SSE3_32_LIN: # %bb.0: -; SSE3_32_LIN-NEXT: subl $12, %esp -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE3_32_LIN-NEXT: calll __fixtfdi -; SSE3_32_LIN-NEXT: addl $28, %esp -; SSE3_32_LIN-NEXT: retl -; -; SSE3_64_WIN-LABEL: t_to_s64: -; SSE3_64_WIN: # %bb.0: -; SSE3_64_WIN-NEXT: subq $40, %rsp -; SSE3_64_WIN-NEXT: callq __fixtfdi -; SSE3_64_WIN-NEXT: addq $40, %rsp -; SSE3_64_WIN-NEXT: retq -; -; SSE3_64_LIN-LABEL: t_to_s64: -; SSE3_64_LIN: # %bb.0: -; SSE3_64_LIN-NEXT: pushq %rax -; SSE3_64_LIN-NEXT: callq __fixtfdi -; SSE3_64_LIN-NEXT: popq %rcx -; SSE3_64_LIN-NEXT: retq -; -; SSE2_32_WIN-LABEL: t_to_s64: -; SSE2_32_WIN: # %bb.0: -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_WIN-NEXT: calll ___fixtfdi -; SSE2_32_WIN-NEXT: addl $16, %esp -; SSE2_32_WIN-NEXT: retl -; -; SSE2_32_LIN-LABEL: t_to_s64: -; SSE2_32_LIN: # %bb.0: -; SSE2_32_LIN-NEXT: subl $12, %esp -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; SSE2_32_LIN-NEXT: calll __fixtfdi -; SSE2_32_LIN-NEXT: addl $28, %esp -; SSE2_32_LIN-NEXT: retl -; -; SSE2_64_WIN-LABEL: t_to_s64: -; SSE2_64_WIN: # %bb.0: -; SSE2_64_WIN-NEXT: subq $40, %rsp -; SSE2_64_WIN-NEXT: callq __fixtfdi -; SSE2_64_WIN-NEXT: addq $40, %rsp -; SSE2_64_WIN-NEXT: retq -; -; SSE2_64_LIN-LABEL: t_to_s64: -; SSE2_64_LIN: # %bb.0: -; SSE2_64_LIN-NEXT: pushq %rax -; SSE2_64_LIN-NEXT: callq __fixtfdi -; SSE2_64_LIN-NEXT: popq %rcx -; SSE2_64_LIN-NEXT: retq -; -; X87_WIN-LABEL: t_to_s64: -; X87_WIN: # %bb.0: -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_WIN-NEXT: calll ___fixtfdi -; X87_WIN-NEXT: addl $16, %esp -; X87_WIN-NEXT: retl -; -; X87_LIN-LABEL: t_to_s64: -; X87_LIN: # %bb.0: -; X87_LIN-NEXT: subl $12, %esp -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: pushl {{[0-9]+}}(%esp) -; X87_LIN-NEXT: calll __fixtfdi -; X87_LIN-NEXT: addl $28, %esp -; X87_LIN-NEXT: retl +; X86-AVX512-WIN-LABEL: t_to_s64: +; X86-AVX512-WIN: # %bb.0: +; X86-AVX512-WIN-NEXT: subl $16, %esp +; X86-AVX512-WIN-NEXT: vmovups {{[0-9]+}}(%esp), %xmm0 +; X86-AVX512-WIN-NEXT: vmovups %xmm0, (%esp) +; X86-AVX512-WIN-NEXT: calll ___fixtfdi +; X86-AVX512-WIN-NEXT: addl $16, %esp +; X86-AVX512-WIN-NEXT: retl +; +; X86-AVX512-LIN-LABEL: t_to_s64: +; X86-AVX512-LIN: # %bb.0: +; X86-AVX512-LIN-NEXT: subl $28, %esp +; X86-AVX512-LIN-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0 +; X86-AVX512-LIN-NEXT: vmovups %xmm0, (%esp) +; X86-AVX512-LIN-NEXT: calll __fixtfdi +; X86-AVX512-LIN-NEXT: addl $28, %esp +; X86-AVX512-LIN-NEXT: retl +; +; X64-AVX512-WIN-LABEL: t_to_s64: +; X64-AVX512-WIN: # %bb.0: +; X64-AVX512-WIN-NEXT: subq $40, %rsp +; X64-AVX512-WIN-NEXT: callq __fixtfdi +; X64-AVX512-WIN-NEXT: addq $40, %rsp +; X64-AVX512-WIN-NEXT: retq +; +; X64-AVX512-LIN-LABEL: t_to_s64: +; X64-AVX512-LIN: # %bb.0: +; X64-AVX512-LIN-NEXT: pushq %rax +; X64-AVX512-LIN-NEXT: callq __fixtfdi +; X64-AVX512-LIN-NEXT: popq %rcx +; X64-AVX512-LIN-NEXT: retq +; +; X86-SSE-WIN-LABEL: t_to_s64: +; X86-SSE-WIN: # %bb.0: +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-WIN-NEXT: calll ___fixtfdi +; X86-SSE-WIN-NEXT: addl $16, %esp +; X86-SSE-WIN-NEXT: retl +; +; X86-SSE-LIN-LABEL: t_to_s64: +; X86-SSE-LIN: # %bb.0: +; X86-SSE-LIN-NEXT: subl $12, %esp +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X86-SSE-LIN-NEXT: calll __fixtfdi +; X86-SSE-LIN-NEXT: addl $28, %esp +; X86-SSE-LIN-NEXT: retl +; +; X64-SSE-WIN-LABEL: t_to_s64: +; X64-SSE-WIN: # %bb.0: +; X64-SSE-WIN-NEXT: subq $40, %rsp +; X64-SSE-WIN-NEXT: callq __fixtfdi +; X64-SSE-WIN-NEXT: addq $40, %rsp +; X64-SSE-WIN-NEXT: retq +; +; X64-SSE-LIN-LABEL: t_to_s64: +; X64-SSE-LIN: # %bb.0: +; X64-SSE-LIN-NEXT: pushq %rax +; X64-SSE-LIN-NEXT: callq __fixtfdi +; X64-SSE-LIN-NEXT: popq %rcx +; X64-SSE-LIN-NEXT: retq +; +; X87-WIN-LABEL: t_to_s64: +; X87-WIN: # %bb.0: +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-WIN-NEXT: calll ___fixtfdi +; X87-WIN-NEXT: addl $16, %esp +; X87-WIN-NEXT: retl +; +; X87-LIN-LABEL: t_to_s64: +; X87-LIN: # %bb.0: +; X87-LIN-NEXT: subl $12, %esp +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: pushl {{[0-9]+}}(%esp) +; X87-LIN-NEXT: calll __fixtfdi +; X87-LIN-NEXT: addl $28, %esp +; X87-LIN-NEXT: retl %r = fptosi fp128 %a to i64 ret i64 %r } -- 2.7.4