1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 -O3 | FileCheck %s --check-prefixes=SSE-X86 3; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 -O3 | FileCheck %s --check-prefixes=SSE-X64 4; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx -O3 | FileCheck %s --check-prefixes=AVX-X86,AVX1-X86 5; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx -O3 | FileCheck %s --check-prefixes=AVX-X64,AVX1-X64 6; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512f -mattr=+avx512vl -O3 | FileCheck %s --check-prefixes=AVX-X86,AVX512-X86 7; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f -mattr=+avx512vl -O3 | FileCheck %s --check-prefixes=AVX-X64,AVX512-X64 8; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=-sse -O3 | FileCheck %s --check-prefixes=X87 9 10declare i1 @llvm.experimental.constrained.fptosi.i1.f32(float, metadata) 11declare i8 @llvm.experimental.constrained.fptosi.i8.f32(float, metadata) 12declare i16 @llvm.experimental.constrained.fptosi.i16.f32(float, metadata) 13declare i32 @llvm.experimental.constrained.fptosi.i32.f32(float, metadata) 14declare i64 @llvm.experimental.constrained.fptosi.i64.f32(float, metadata) 15declare i1 @llvm.experimental.constrained.fptoui.i1.f32(float, metadata) 16declare i8 @llvm.experimental.constrained.fptoui.i8.f32(float, metadata) 17declare i16 @llvm.experimental.constrained.fptoui.i16.f32(float, metadata) 18declare i32 @llvm.experimental.constrained.fptoui.i32.f32(float, metadata) 19declare i64 @llvm.experimental.constrained.fptoui.i64.f32(float, metadata) 20 21declare i1 @llvm.experimental.constrained.fptosi.i1.f64(double, metadata) 22declare i8 @llvm.experimental.constrained.fptosi.i8.f64(double, metadata) 23declare i16 @llvm.experimental.constrained.fptosi.i16.f64(double, metadata) 24declare i32 @llvm.experimental.constrained.fptosi.i32.f64(double, metadata) 25declare i64 @llvm.experimental.constrained.fptosi.i64.f64(double, metadata) 26declare i1 @llvm.experimental.constrained.fptoui.i1.f64(double, metadata) 27declare i8 @llvm.experimental.constrained.fptoui.i8.f64(double, metadata) 28declare i16 @llvm.experimental.constrained.fptoui.i16.f64(double, metadata) 29declare i32 @llvm.experimental.constrained.fptoui.i32.f64(double, metadata) 30declare i64 @llvm.experimental.constrained.fptoui.i64.f64(double, metadata) 31 32define i1 @fptosi_f32toi1(float %x) #0 { 33; SSE-X86-LABEL: fptosi_f32toi1: 34; SSE-X86: # %bb.0: 35; SSE-X86-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax 36; SSE-X86-NEXT: # kill: def $al killed $al killed $eax 37; SSE-X86-NEXT: retl 38; 39; SSE-X64-LABEL: fptosi_f32toi1: 40; SSE-X64: # %bb.0: 41; SSE-X64-NEXT: cvttss2si %xmm0, %eax 42; SSE-X64-NEXT: # kill: def $al killed $al killed $eax 43; SSE-X64-NEXT: retq 44; 45; AVX-X86-LABEL: fptosi_f32toi1: 46; AVX-X86: # %bb.0: 47; AVX-X86-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax 48; AVX-X86-NEXT: # kill: def $al killed $al killed $eax 49; AVX-X86-NEXT: retl 50; 51; AVX-X64-LABEL: fptosi_f32toi1: 52; AVX-X64: # %bb.0: 53; AVX-X64-NEXT: vcvttss2si %xmm0, %eax 54; AVX-X64-NEXT: # kill: def $al killed $al killed $eax 55; AVX-X64-NEXT: retq 56; 57; X87-LABEL: fptosi_f32toi1: 58; X87: # %bb.0: 59; X87-NEXT: subl $8, %esp 60; X87-NEXT: .cfi_def_cfa_offset 12 61; X87-NEXT: flds {{[0-9]+}}(%esp) 62; X87-NEXT: wait 63; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 64; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 65; X87-NEXT: orl $3072, %eax # imm = 0xC00 66; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 67; X87-NEXT: fldcw {{[0-9]+}}(%esp) 68; X87-NEXT: fistps {{[0-9]+}}(%esp) 69; X87-NEXT: fldcw {{[0-9]+}}(%esp) 70; X87-NEXT: movb {{[0-9]+}}(%esp), %al 71; X87-NEXT: addl $8, %esp 72; X87-NEXT: .cfi_def_cfa_offset 4 73; X87-NEXT: retl 74 %result = call i1 @llvm.experimental.constrained.fptosi.i1.f32(float %x, 75 metadata !"fpexcept.strict") #0 76 ret i1 %result 77} 78 79define i8 @fptosi_f32toi8(float %x) #0 { 80; SSE-X86-LABEL: fptosi_f32toi8: 81; SSE-X86: # %bb.0: 82; SSE-X86-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax 83; SSE-X86-NEXT: # kill: def $al killed $al killed $eax 84; SSE-X86-NEXT: retl 85; 86; SSE-X64-LABEL: fptosi_f32toi8: 87; SSE-X64: # %bb.0: 88; SSE-X64-NEXT: cvttss2si %xmm0, %eax 89; SSE-X64-NEXT: # kill: def $al killed $al killed $eax 90; SSE-X64-NEXT: retq 91; 92; AVX-X86-LABEL: fptosi_f32toi8: 93; AVX-X86: # %bb.0: 94; AVX-X86-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax 95; AVX-X86-NEXT: # kill: def $al killed $al killed $eax 96; AVX-X86-NEXT: retl 97; 98; AVX-X64-LABEL: fptosi_f32toi8: 99; AVX-X64: # %bb.0: 100; AVX-X64-NEXT: vcvttss2si %xmm0, %eax 101; AVX-X64-NEXT: # kill: def $al killed $al killed $eax 102; AVX-X64-NEXT: retq 103; 104; X87-LABEL: fptosi_f32toi8: 105; X87: # %bb.0: 106; X87-NEXT: subl $8, %esp 107; X87-NEXT: .cfi_def_cfa_offset 12 108; X87-NEXT: flds {{[0-9]+}}(%esp) 109; X87-NEXT: wait 110; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 111; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 112; X87-NEXT: orl $3072, %eax # imm = 0xC00 113; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 114; X87-NEXT: fldcw {{[0-9]+}}(%esp) 115; X87-NEXT: fistps {{[0-9]+}}(%esp) 116; X87-NEXT: fldcw {{[0-9]+}}(%esp) 117; X87-NEXT: movb {{[0-9]+}}(%esp), %al 118; X87-NEXT: addl $8, %esp 119; X87-NEXT: .cfi_def_cfa_offset 4 120; X87-NEXT: retl 121 %result = call i8 @llvm.experimental.constrained.fptosi.i8.f32(float %x, 122 metadata !"fpexcept.strict") #0 123 ret i8 %result 124} 125 126define i16 @fptosi_f32toi16(float %x) #0 { 127; SSE-X86-LABEL: fptosi_f32toi16: 128; SSE-X86: # %bb.0: 129; SSE-X86-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax 130; SSE-X86-NEXT: # kill: def $ax killed $ax killed $eax 131; SSE-X86-NEXT: retl 132; 133; SSE-X64-LABEL: fptosi_f32toi16: 134; SSE-X64: # %bb.0: 135; SSE-X64-NEXT: cvttss2si %xmm0, %eax 136; SSE-X64-NEXT: # kill: def $ax killed $ax killed $eax 137; SSE-X64-NEXT: retq 138; 139; AVX-X86-LABEL: fptosi_f32toi16: 140; AVX-X86: # %bb.0: 141; AVX-X86-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax 142; AVX-X86-NEXT: # kill: def $ax killed $ax killed $eax 143; AVX-X86-NEXT: retl 144; 145; AVX-X64-LABEL: fptosi_f32toi16: 146; AVX-X64: # %bb.0: 147; AVX-X64-NEXT: vcvttss2si %xmm0, %eax 148; AVX-X64-NEXT: # kill: def $ax killed $ax killed $eax 149; AVX-X64-NEXT: retq 150; 151; X87-LABEL: fptosi_f32toi16: 152; X87: # %bb.0: 153; X87-NEXT: subl $8, %esp 154; X87-NEXT: .cfi_def_cfa_offset 12 155; X87-NEXT: flds {{[0-9]+}}(%esp) 156; X87-NEXT: wait 157; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 158; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 159; X87-NEXT: orl $3072, %eax # imm = 0xC00 160; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 161; X87-NEXT: fldcw {{[0-9]+}}(%esp) 162; X87-NEXT: fistps {{[0-9]+}}(%esp) 163; X87-NEXT: fldcw {{[0-9]+}}(%esp) 164; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 165; X87-NEXT: addl $8, %esp 166; X87-NEXT: .cfi_def_cfa_offset 4 167; X87-NEXT: retl 168 %result = call i16 @llvm.experimental.constrained.fptosi.i16.f32(float %x, 169 metadata !"fpexcept.strict") #0 170 ret i16 %result 171} 172 173define i32 @fptosi_f32toi32(float %x) #0 { 174; SSE-X86-LABEL: fptosi_f32toi32: 175; SSE-X86: # %bb.0: 176; SSE-X86-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax 177; SSE-X86-NEXT: retl 178; 179; SSE-X64-LABEL: fptosi_f32toi32: 180; SSE-X64: # %bb.0: 181; SSE-X64-NEXT: cvttss2si %xmm0, %eax 182; SSE-X64-NEXT: retq 183; 184; AVX-X86-LABEL: fptosi_f32toi32: 185; AVX-X86: # %bb.0: 186; AVX-X86-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax 187; AVX-X86-NEXT: retl 188; 189; AVX-X64-LABEL: fptosi_f32toi32: 190; AVX-X64: # %bb.0: 191; AVX-X64-NEXT: vcvttss2si %xmm0, %eax 192; AVX-X64-NEXT: retq 193; 194; X87-LABEL: fptosi_f32toi32: 195; X87: # %bb.0: 196; X87-NEXT: subl $8, %esp 197; X87-NEXT: .cfi_def_cfa_offset 12 198; X87-NEXT: flds {{[0-9]+}}(%esp) 199; X87-NEXT: wait 200; X87-NEXT: fnstcw (%esp) 201; X87-NEXT: movzwl (%esp), %eax 202; X87-NEXT: orl $3072, %eax # imm = 0xC00 203; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 204; X87-NEXT: fldcw {{[0-9]+}}(%esp) 205; X87-NEXT: fistpl {{[0-9]+}}(%esp) 206; X87-NEXT: fldcw (%esp) 207; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 208; X87-NEXT: addl $8, %esp 209; X87-NEXT: .cfi_def_cfa_offset 4 210; X87-NEXT: retl 211 %result = call i32 @llvm.experimental.constrained.fptosi.i32.f32(float %x, 212 metadata !"fpexcept.strict") #0 213 ret i32 %result 214} 215 216define i64 @fptosi_f32toi64(float %x) #0 { 217; SSE-X86-LABEL: fptosi_f32toi64: 218; SSE-X86: # %bb.0: 219; SSE-X86-NEXT: pushl %ebp 220; SSE-X86-NEXT: .cfi_def_cfa_offset 8 221; SSE-X86-NEXT: .cfi_offset %ebp, -8 222; SSE-X86-NEXT: movl %esp, %ebp 223; SSE-X86-NEXT: .cfi_def_cfa_register %ebp 224; SSE-X86-NEXT: andl $-8, %esp 225; SSE-X86-NEXT: subl $16, %esp 226; SSE-X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero 227; SSE-X86-NEXT: movss %xmm0, {{[0-9]+}}(%esp) 228; SSE-X86-NEXT: flds {{[0-9]+}}(%esp) 229; SSE-X86-NEXT: wait 230; SSE-X86-NEXT: fnstcw {{[0-9]+}}(%esp) 231; SSE-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax 232; SSE-X86-NEXT: orl $3072, %eax # imm = 0xC00 233; SSE-X86-NEXT: movw %ax, {{[0-9]+}}(%esp) 234; SSE-X86-NEXT: fldcw {{[0-9]+}}(%esp) 235; SSE-X86-NEXT: fistpll {{[0-9]+}}(%esp) 236; SSE-X86-NEXT: fldcw {{[0-9]+}}(%esp) 237; SSE-X86-NEXT: movl {{[0-9]+}}(%esp), %eax 238; SSE-X86-NEXT: movl {{[0-9]+}}(%esp), %edx 239; SSE-X86-NEXT: movl %ebp, %esp 240; SSE-X86-NEXT: popl %ebp 241; SSE-X86-NEXT: .cfi_def_cfa %esp, 4 242; SSE-X86-NEXT: retl 243; 244; SSE-X64-LABEL: fptosi_f32toi64: 245; SSE-X64: # %bb.0: 246; SSE-X64-NEXT: cvttss2si %xmm0, %rax 247; SSE-X64-NEXT: retq 248; 249; AVX-X86-LABEL: fptosi_f32toi64: 250; AVX-X86: # %bb.0: 251; AVX-X86-NEXT: pushl %ebp 252; AVX-X86-NEXT: .cfi_def_cfa_offset 8 253; AVX-X86-NEXT: .cfi_offset %ebp, -8 254; AVX-X86-NEXT: movl %esp, %ebp 255; AVX-X86-NEXT: .cfi_def_cfa_register %ebp 256; AVX-X86-NEXT: andl $-8, %esp 257; AVX-X86-NEXT: subl $8, %esp 258; AVX-X86-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero 259; AVX-X86-NEXT: vmovss %xmm0, (%esp) 260; AVX-X86-NEXT: flds (%esp) 261; AVX-X86-NEXT: fisttpll (%esp) 262; AVX-X86-NEXT: wait 263; AVX-X86-NEXT: movl (%esp), %eax 264; AVX-X86-NEXT: movl {{[0-9]+}}(%esp), %edx 265; AVX-X86-NEXT: movl %ebp, %esp 266; AVX-X86-NEXT: popl %ebp 267; AVX-X86-NEXT: .cfi_def_cfa %esp, 4 268; AVX-X86-NEXT: retl 269; 270; AVX-X64-LABEL: fptosi_f32toi64: 271; AVX-X64: # %bb.0: 272; AVX-X64-NEXT: vcvttss2si %xmm0, %rax 273; AVX-X64-NEXT: retq 274; 275; X87-LABEL: fptosi_f32toi64: 276; X87: # %bb.0: 277; X87-NEXT: pushl %ebp 278; X87-NEXT: .cfi_def_cfa_offset 8 279; X87-NEXT: .cfi_offset %ebp, -8 280; X87-NEXT: movl %esp, %ebp 281; X87-NEXT: .cfi_def_cfa_register %ebp 282; X87-NEXT: andl $-8, %esp 283; X87-NEXT: subl $16, %esp 284; X87-NEXT: flds 8(%ebp) 285; X87-NEXT: wait 286; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 287; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 288; X87-NEXT: orl $3072, %eax # imm = 0xC00 289; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 290; X87-NEXT: fldcw {{[0-9]+}}(%esp) 291; X87-NEXT: fistpll {{[0-9]+}}(%esp) 292; X87-NEXT: fldcw {{[0-9]+}}(%esp) 293; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 294; X87-NEXT: movl {{[0-9]+}}(%esp), %edx 295; X87-NEXT: movl %ebp, %esp 296; X87-NEXT: popl %ebp 297; X87-NEXT: .cfi_def_cfa %esp, 4 298; X87-NEXT: retl 299 %result = call i64 @llvm.experimental.constrained.fptosi.i64.f32(float %x, 300 metadata !"fpexcept.strict") #0 301 ret i64 %result 302} 303 304define i1 @fptoui_f32toi1(float %x) #0 { 305; SSE-X86-LABEL: fptoui_f32toi1: 306; SSE-X86: # %bb.0: 307; SSE-X86-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax 308; SSE-X86-NEXT: # kill: def $al killed $al killed $eax 309; SSE-X86-NEXT: retl 310; 311; SSE-X64-LABEL: fptoui_f32toi1: 312; SSE-X64: # %bb.0: 313; SSE-X64-NEXT: cvttss2si %xmm0, %eax 314; SSE-X64-NEXT: # kill: def $al killed $al killed $eax 315; SSE-X64-NEXT: retq 316; 317; AVX-X86-LABEL: fptoui_f32toi1: 318; AVX-X86: # %bb.0: 319; AVX-X86-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax 320; AVX-X86-NEXT: # kill: def $al killed $al killed $eax 321; AVX-X86-NEXT: retl 322; 323; AVX-X64-LABEL: fptoui_f32toi1: 324; AVX-X64: # %bb.0: 325; AVX-X64-NEXT: vcvttss2si %xmm0, %eax 326; AVX-X64-NEXT: # kill: def $al killed $al killed $eax 327; AVX-X64-NEXT: retq 328; 329; X87-LABEL: fptoui_f32toi1: 330; X87: # %bb.0: 331; X87-NEXT: subl $8, %esp 332; X87-NEXT: .cfi_def_cfa_offset 12 333; X87-NEXT: flds {{[0-9]+}}(%esp) 334; X87-NEXT: wait 335; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 336; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 337; X87-NEXT: orl $3072, %eax # imm = 0xC00 338; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 339; X87-NEXT: fldcw {{[0-9]+}}(%esp) 340; X87-NEXT: fistps {{[0-9]+}}(%esp) 341; X87-NEXT: fldcw {{[0-9]+}}(%esp) 342; X87-NEXT: movb {{[0-9]+}}(%esp), %al 343; X87-NEXT: addl $8, %esp 344; X87-NEXT: .cfi_def_cfa_offset 4 345; X87-NEXT: retl 346 %result = call i1 @llvm.experimental.constrained.fptoui.i1.f32(float %x, 347 metadata !"fpexcept.strict") #0 348 ret i1 %result 349} 350 351define i8 @fptoui_f32toi8(float %x) #0 { 352; SSE-X86-LABEL: fptoui_f32toi8: 353; SSE-X86: # %bb.0: 354; SSE-X86-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax 355; SSE-X86-NEXT: # kill: def $al killed $al killed $eax 356; SSE-X86-NEXT: retl 357; 358; SSE-X64-LABEL: fptoui_f32toi8: 359; SSE-X64: # %bb.0: 360; SSE-X64-NEXT: cvttss2si %xmm0, %eax 361; SSE-X64-NEXT: # kill: def $al killed $al killed $eax 362; SSE-X64-NEXT: retq 363; 364; AVX-X86-LABEL: fptoui_f32toi8: 365; AVX-X86: # %bb.0: 366; AVX-X86-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax 367; AVX-X86-NEXT: # kill: def $al killed $al killed $eax 368; AVX-X86-NEXT: retl 369; 370; AVX-X64-LABEL: fptoui_f32toi8: 371; AVX-X64: # %bb.0: 372; AVX-X64-NEXT: vcvttss2si %xmm0, %eax 373; AVX-X64-NEXT: # kill: def $al killed $al killed $eax 374; AVX-X64-NEXT: retq 375; 376; X87-LABEL: fptoui_f32toi8: 377; X87: # %bb.0: 378; X87-NEXT: subl $8, %esp 379; X87-NEXT: .cfi_def_cfa_offset 12 380; X87-NEXT: flds {{[0-9]+}}(%esp) 381; X87-NEXT: wait 382; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 383; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 384; X87-NEXT: orl $3072, %eax # imm = 0xC00 385; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 386; X87-NEXT: fldcw {{[0-9]+}}(%esp) 387; X87-NEXT: fistps {{[0-9]+}}(%esp) 388; X87-NEXT: fldcw {{[0-9]+}}(%esp) 389; X87-NEXT: movb {{[0-9]+}}(%esp), %al 390; X87-NEXT: addl $8, %esp 391; X87-NEXT: .cfi_def_cfa_offset 4 392; X87-NEXT: retl 393 %result = call i8 @llvm.experimental.constrained.fptoui.i8.f32(float %x, 394 metadata !"fpexcept.strict") #0 395 ret i8 %result 396} 397 398define i16 @fptoui_f32toi16(float %x) #0 { 399; SSE-X86-LABEL: fptoui_f32toi16: 400; SSE-X86: # %bb.0: 401; SSE-X86-NEXT: cvttss2si {{[0-9]+}}(%esp), %eax 402; SSE-X86-NEXT: # kill: def $ax killed $ax killed $eax 403; SSE-X86-NEXT: retl 404; 405; SSE-X64-LABEL: fptoui_f32toi16: 406; SSE-X64: # %bb.0: 407; SSE-X64-NEXT: cvttss2si %xmm0, %eax 408; SSE-X64-NEXT: # kill: def $ax killed $ax killed $eax 409; SSE-X64-NEXT: retq 410; 411; AVX-X86-LABEL: fptoui_f32toi16: 412; AVX-X86: # %bb.0: 413; AVX-X86-NEXT: vcvttss2si {{[0-9]+}}(%esp), %eax 414; AVX-X86-NEXT: # kill: def $ax killed $ax killed $eax 415; AVX-X86-NEXT: retl 416; 417; AVX-X64-LABEL: fptoui_f32toi16: 418; AVX-X64: # %bb.0: 419; AVX-X64-NEXT: vcvttss2si %xmm0, %eax 420; AVX-X64-NEXT: # kill: def $ax killed $ax killed $eax 421; AVX-X64-NEXT: retq 422; 423; X87-LABEL: fptoui_f32toi16: 424; X87: # %bb.0: 425; X87-NEXT: subl $8, %esp 426; X87-NEXT: .cfi_def_cfa_offset 12 427; X87-NEXT: flds {{[0-9]+}}(%esp) 428; X87-NEXT: wait 429; X87-NEXT: fnstcw (%esp) 430; X87-NEXT: movzwl (%esp), %eax 431; X87-NEXT: orl $3072, %eax # imm = 0xC00 432; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 433; X87-NEXT: fldcw {{[0-9]+}}(%esp) 434; X87-NEXT: fistpl {{[0-9]+}}(%esp) 435; X87-NEXT: fldcw (%esp) 436; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 437; X87-NEXT: # kill: def $ax killed $ax killed $eax 438; X87-NEXT: addl $8, %esp 439; X87-NEXT: .cfi_def_cfa_offset 4 440; X87-NEXT: retl 441 %result = call i16 @llvm.experimental.constrained.fptoui.i16.f32(float %x, 442 metadata !"fpexcept.strict") #0 443 ret i16 %result 444} 445 446define i32 @fptoui_f32toi32(float %x) #0 { 447; SSE-X86-LABEL: fptoui_f32toi32: 448; SSE-X86: # %bb.0: 449; SSE-X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero 450; SSE-X86-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero 451; SSE-X86-NEXT: comiss %xmm0, %xmm2 452; SSE-X86-NEXT: xorps %xmm1, %xmm1 453; SSE-X86-NEXT: ja .LBB8_2 454; SSE-X86-NEXT: # %bb.1: 455; SSE-X86-NEXT: movaps %xmm2, %xmm1 456; SSE-X86-NEXT: .LBB8_2: 457; SSE-X86-NEXT: setbe %al 458; SSE-X86-NEXT: movzbl %al, %ecx 459; SSE-X86-NEXT: shll $31, %ecx 460; SSE-X86-NEXT: subss %xmm1, %xmm0 461; SSE-X86-NEXT: cvttss2si %xmm0, %eax 462; SSE-X86-NEXT: xorl %ecx, %eax 463; SSE-X86-NEXT: retl 464; 465; SSE-X64-LABEL: fptoui_f32toi32: 466; SSE-X64: # %bb.0: 467; SSE-X64-NEXT: cvttss2si %xmm0, %rax 468; SSE-X64-NEXT: # kill: def $eax killed $eax killed $rax 469; SSE-X64-NEXT: retq 470; 471; AVX1-X86-LABEL: fptoui_f32toi32: 472; AVX1-X86: # %bb.0: 473; AVX1-X86-NEXT: pushl %ebp 474; AVX1-X86-NEXT: .cfi_def_cfa_offset 8 475; AVX1-X86-NEXT: .cfi_offset %ebp, -8 476; AVX1-X86-NEXT: movl %esp, %ebp 477; AVX1-X86-NEXT: .cfi_def_cfa_register %ebp 478; AVX1-X86-NEXT: andl $-8, %esp 479; AVX1-X86-NEXT: subl $8, %esp 480; AVX1-X86-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero 481; AVX1-X86-NEXT: vmovss %xmm0, (%esp) 482; AVX1-X86-NEXT: flds (%esp) 483; AVX1-X86-NEXT: fisttpll (%esp) 484; AVX1-X86-NEXT: wait 485; AVX1-X86-NEXT: movl (%esp), %eax 486; AVX1-X86-NEXT: movl %ebp, %esp 487; AVX1-X86-NEXT: popl %ebp 488; AVX1-X86-NEXT: .cfi_def_cfa %esp, 4 489; AVX1-X86-NEXT: retl 490; 491; AVX1-X64-LABEL: fptoui_f32toi32: 492; AVX1-X64: # %bb.0: 493; AVX1-X64-NEXT: vcvttss2si %xmm0, %rax 494; AVX1-X64-NEXT: # kill: def $eax killed $eax killed $rax 495; AVX1-X64-NEXT: retq 496; 497; AVX512-X86-LABEL: fptoui_f32toi32: 498; AVX512-X86: # %bb.0: 499; AVX512-X86-NEXT: vcvttss2usi {{[0-9]+}}(%esp), %eax 500; AVX512-X86-NEXT: retl 501; 502; AVX512-X64-LABEL: fptoui_f32toi32: 503; AVX512-X64: # %bb.0: 504; AVX512-X64-NEXT: vcvttss2usi %xmm0, %eax 505; AVX512-X64-NEXT: retq 506; 507; X87-LABEL: fptoui_f32toi32: 508; X87: # %bb.0: 509; X87-NEXT: pushl %ebp 510; X87-NEXT: .cfi_def_cfa_offset 8 511; X87-NEXT: .cfi_offset %ebp, -8 512; X87-NEXT: movl %esp, %ebp 513; X87-NEXT: .cfi_def_cfa_register %ebp 514; X87-NEXT: andl $-8, %esp 515; X87-NEXT: subl $16, %esp 516; X87-NEXT: flds 8(%ebp) 517; X87-NEXT: wait 518; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 519; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 520; X87-NEXT: orl $3072, %eax # imm = 0xC00 521; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 522; X87-NEXT: fldcw {{[0-9]+}}(%esp) 523; X87-NEXT: fistpll {{[0-9]+}}(%esp) 524; X87-NEXT: fldcw {{[0-9]+}}(%esp) 525; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 526; X87-NEXT: movl %ebp, %esp 527; X87-NEXT: popl %ebp 528; X87-NEXT: .cfi_def_cfa %esp, 4 529; X87-NEXT: retl 530 %result = call i32 @llvm.experimental.constrained.fptoui.i32.f32(float %x, 531 metadata !"fpexcept.strict") #0 532 ret i32 %result 533} 534 535define i64 @fptoui_f32toi64(float %x) #0 { 536; SSE-X86-LABEL: fptoui_f32toi64: 537; SSE-X86: # %bb.0: 538; SSE-X86-NEXT: pushl %ebp 539; SSE-X86-NEXT: .cfi_def_cfa_offset 8 540; SSE-X86-NEXT: .cfi_offset %ebp, -8 541; SSE-X86-NEXT: movl %esp, %ebp 542; SSE-X86-NEXT: .cfi_def_cfa_register %ebp 543; SSE-X86-NEXT: andl $-8, %esp 544; SSE-X86-NEXT: subl $16, %esp 545; SSE-X86-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero 546; SSE-X86-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero 547; SSE-X86-NEXT: comiss %xmm0, %xmm1 548; SSE-X86-NEXT: jbe .LBB9_2 549; SSE-X86-NEXT: # %bb.1: 550; SSE-X86-NEXT: xorps %xmm1, %xmm1 551; SSE-X86-NEXT: .LBB9_2: 552; SSE-X86-NEXT: subss %xmm1, %xmm0 553; SSE-X86-NEXT: movss %xmm0, {{[0-9]+}}(%esp) 554; SSE-X86-NEXT: setbe %al 555; SSE-X86-NEXT: flds {{[0-9]+}}(%esp) 556; SSE-X86-NEXT: wait 557; SSE-X86-NEXT: fnstcw {{[0-9]+}}(%esp) 558; SSE-X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx 559; SSE-X86-NEXT: orl $3072, %ecx # imm = 0xC00 560; SSE-X86-NEXT: movw %cx, {{[0-9]+}}(%esp) 561; SSE-X86-NEXT: fldcw {{[0-9]+}}(%esp) 562; SSE-X86-NEXT: fistpll {{[0-9]+}}(%esp) 563; SSE-X86-NEXT: fldcw {{[0-9]+}}(%esp) 564; SSE-X86-NEXT: movzbl %al, %edx 565; SSE-X86-NEXT: shll $31, %edx 566; SSE-X86-NEXT: xorl {{[0-9]+}}(%esp), %edx 567; SSE-X86-NEXT: movl {{[0-9]+}}(%esp), %eax 568; SSE-X86-NEXT: movl %ebp, %esp 569; SSE-X86-NEXT: popl %ebp 570; SSE-X86-NEXT: .cfi_def_cfa %esp, 4 571; SSE-X86-NEXT: retl 572; 573; SSE-X64-LABEL: fptoui_f32toi64: 574; SSE-X64: # %bb.0: 575; SSE-X64-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero 576; SSE-X64-NEXT: comiss %xmm2, %xmm0 577; SSE-X64-NEXT: xorps %xmm1, %xmm1 578; SSE-X64-NEXT: jb .LBB9_2 579; SSE-X64-NEXT: # %bb.1: 580; SSE-X64-NEXT: movaps %xmm2, %xmm1 581; SSE-X64-NEXT: .LBB9_2: 582; SSE-X64-NEXT: subss %xmm1, %xmm0 583; SSE-X64-NEXT: cvttss2si %xmm0, %rcx 584; SSE-X64-NEXT: setae %al 585; SSE-X64-NEXT: movzbl %al, %eax 586; SSE-X64-NEXT: shlq $63, %rax 587; SSE-X64-NEXT: xorq %rcx, %rax 588; SSE-X64-NEXT: retq 589; 590; AVX1-X86-LABEL: fptoui_f32toi64: 591; AVX1-X86: # %bb.0: 592; AVX1-X86-NEXT: pushl %ebp 593; AVX1-X86-NEXT: .cfi_def_cfa_offset 8 594; AVX1-X86-NEXT: .cfi_offset %ebp, -8 595; AVX1-X86-NEXT: movl %esp, %ebp 596; AVX1-X86-NEXT: .cfi_def_cfa_register %ebp 597; AVX1-X86-NEXT: andl $-8, %esp 598; AVX1-X86-NEXT: subl $8, %esp 599; AVX1-X86-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero 600; AVX1-X86-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero 601; AVX1-X86-NEXT: vcomiss %xmm0, %xmm1 602; AVX1-X86-NEXT: jbe .LBB9_2 603; AVX1-X86-NEXT: # %bb.1: 604; AVX1-X86-NEXT: vxorps %xmm1, %xmm1, %xmm1 605; AVX1-X86-NEXT: .LBB9_2: 606; AVX1-X86-NEXT: vsubss %xmm1, %xmm0, %xmm0 607; AVX1-X86-NEXT: vmovss %xmm0, (%esp) 608; AVX1-X86-NEXT: flds (%esp) 609; AVX1-X86-NEXT: fisttpll (%esp) 610; AVX1-X86-NEXT: wait 611; AVX1-X86-NEXT: setbe %al 612; AVX1-X86-NEXT: movzbl %al, %edx 613; AVX1-X86-NEXT: shll $31, %edx 614; AVX1-X86-NEXT: xorl {{[0-9]+}}(%esp), %edx 615; AVX1-X86-NEXT: movl (%esp), %eax 616; AVX1-X86-NEXT: movl %ebp, %esp 617; AVX1-X86-NEXT: popl %ebp 618; AVX1-X86-NEXT: .cfi_def_cfa %esp, 4 619; AVX1-X86-NEXT: retl 620; 621; AVX1-X64-LABEL: fptoui_f32toi64: 622; AVX1-X64: # %bb.0: 623; AVX1-X64-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero 624; AVX1-X64-NEXT: vcomiss %xmm1, %xmm0 625; AVX1-X64-NEXT: vxorps %xmm2, %xmm2, %xmm2 626; AVX1-X64-NEXT: jb .LBB9_2 627; AVX1-X64-NEXT: # %bb.1: 628; AVX1-X64-NEXT: vmovaps %xmm1, %xmm2 629; AVX1-X64-NEXT: .LBB9_2: 630; AVX1-X64-NEXT: vsubss %xmm2, %xmm0, %xmm0 631; AVX1-X64-NEXT: vcvttss2si %xmm0, %rcx 632; AVX1-X64-NEXT: setae %al 633; AVX1-X64-NEXT: movzbl %al, %eax 634; AVX1-X64-NEXT: shlq $63, %rax 635; AVX1-X64-NEXT: xorq %rcx, %rax 636; AVX1-X64-NEXT: retq 637; 638; AVX512-X86-LABEL: fptoui_f32toi64: 639; AVX512-X86: # %bb.0: 640; AVX512-X86-NEXT: pushl %ebp 641; AVX512-X86-NEXT: .cfi_def_cfa_offset 8 642; AVX512-X86-NEXT: .cfi_offset %ebp, -8 643; AVX512-X86-NEXT: movl %esp, %ebp 644; AVX512-X86-NEXT: .cfi_def_cfa_register %ebp 645; AVX512-X86-NEXT: andl $-8, %esp 646; AVX512-X86-NEXT: subl $8, %esp 647; AVX512-X86-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero 648; AVX512-X86-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero 649; AVX512-X86-NEXT: xorl %edx, %edx 650; AVX512-X86-NEXT: vcomiss %xmm0, %xmm1 651; AVX512-X86-NEXT: setbe %dl 652; AVX512-X86-NEXT: kmovw %edx, %k1 653; AVX512-X86-NEXT: vmovss %xmm1, %xmm1, %xmm1 {%k1} {z} 654; AVX512-X86-NEXT: vsubss %xmm1, %xmm0, %xmm0 655; AVX512-X86-NEXT: vmovss %xmm0, (%esp) 656; AVX512-X86-NEXT: flds (%esp) 657; AVX512-X86-NEXT: fisttpll (%esp) 658; AVX512-X86-NEXT: wait 659; AVX512-X86-NEXT: shll $31, %edx 660; AVX512-X86-NEXT: xorl {{[0-9]+}}(%esp), %edx 661; AVX512-X86-NEXT: movl (%esp), %eax 662; AVX512-X86-NEXT: movl %ebp, %esp 663; AVX512-X86-NEXT: popl %ebp 664; AVX512-X86-NEXT: .cfi_def_cfa %esp, 4 665; AVX512-X86-NEXT: retl 666; 667; AVX512-X64-LABEL: fptoui_f32toi64: 668; AVX512-X64: # %bb.0: 669; AVX512-X64-NEXT: vcvttss2usi %xmm0, %rax 670; AVX512-X64-NEXT: retq 671; 672; X87-LABEL: fptoui_f32toi64: 673; X87: # %bb.0: 674; X87-NEXT: pushl %ebp 675; X87-NEXT: .cfi_def_cfa_offset 8 676; X87-NEXT: .cfi_offset %ebp, -8 677; X87-NEXT: movl %esp, %ebp 678; X87-NEXT: .cfi_def_cfa_register %ebp 679; X87-NEXT: andl $-8, %esp 680; X87-NEXT: subl $16, %esp 681; X87-NEXT: flds 8(%ebp) 682; X87-NEXT: flds {{\.LCPI.*}} 683; X87-NEXT: fcom %st(1) 684; X87-NEXT: wait 685; X87-NEXT: fnstsw %ax 686; X87-NEXT: xorl %edx, %edx 687; X87-NEXT: # kill: def $ah killed $ah killed $ax 688; X87-NEXT: sahf 689; X87-NEXT: setbe %al 690; X87-NEXT: fldz 691; X87-NEXT: jbe .LBB9_2 692; X87-NEXT: # %bb.1: 693; X87-NEXT: fstp %st(1) 694; X87-NEXT: fldz 695; X87-NEXT: .LBB9_2: 696; X87-NEXT: fstp %st(0) 697; X87-NEXT: fsubrp %st, %st(1) 698; X87-NEXT: wait 699; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 700; X87-NEXT: movzwl {{[0-9]+}}(%esp), %ecx 701; X87-NEXT: orl $3072, %ecx # imm = 0xC00 702; X87-NEXT: movw %cx, {{[0-9]+}}(%esp) 703; X87-NEXT: fldcw {{[0-9]+}}(%esp) 704; X87-NEXT: fistpll {{[0-9]+}}(%esp) 705; X87-NEXT: fldcw {{[0-9]+}}(%esp) 706; X87-NEXT: movb %al, %dl 707; X87-NEXT: shll $31, %edx 708; X87-NEXT: xorl {{[0-9]+}}(%esp), %edx 709; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 710; X87-NEXT: movl %ebp, %esp 711; X87-NEXT: popl %ebp 712; X87-NEXT: .cfi_def_cfa %esp, 4 713; X87-NEXT: retl 714 %result = call i64 @llvm.experimental.constrained.fptoui.i64.f32(float %x, 715 metadata !"fpexcept.strict") #0 716 ret i64 %result 717} 718 719define i8 @fptosi_f64toi8(double %x) #0 { 720; SSE-X86-LABEL: fptosi_f64toi8: 721; SSE-X86: # %bb.0: 722; SSE-X86-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax 723; SSE-X86-NEXT: # kill: def $al killed $al killed $eax 724; SSE-X86-NEXT: retl 725; 726; SSE-X64-LABEL: fptosi_f64toi8: 727; SSE-X64: # %bb.0: 728; SSE-X64-NEXT: cvttsd2si %xmm0, %eax 729; SSE-X64-NEXT: # kill: def $al killed $al killed $eax 730; SSE-X64-NEXT: retq 731; 732; AVX-X86-LABEL: fptosi_f64toi8: 733; AVX-X86: # %bb.0: 734; AVX-X86-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax 735; AVX-X86-NEXT: # kill: def $al killed $al killed $eax 736; AVX-X86-NEXT: retl 737; 738; AVX-X64-LABEL: fptosi_f64toi8: 739; AVX-X64: # %bb.0: 740; AVX-X64-NEXT: vcvttsd2si %xmm0, %eax 741; AVX-X64-NEXT: # kill: def $al killed $al killed $eax 742; AVX-X64-NEXT: retq 743; 744; X87-LABEL: fptosi_f64toi8: 745; X87: # %bb.0: 746; X87-NEXT: subl $8, %esp 747; X87-NEXT: .cfi_def_cfa_offset 12 748; X87-NEXT: fldl {{[0-9]+}}(%esp) 749; X87-NEXT: wait 750; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 751; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 752; X87-NEXT: orl $3072, %eax # imm = 0xC00 753; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 754; X87-NEXT: fldcw {{[0-9]+}}(%esp) 755; X87-NEXT: fistps {{[0-9]+}}(%esp) 756; X87-NEXT: fldcw {{[0-9]+}}(%esp) 757; X87-NEXT: movb {{[0-9]+}}(%esp), %al 758; X87-NEXT: addl $8, %esp 759; X87-NEXT: .cfi_def_cfa_offset 4 760; X87-NEXT: retl 761 %result = call i8 @llvm.experimental.constrained.fptosi.i8.f64(double %x, 762 metadata !"fpexcept.strict") #0 763 ret i8 %result 764} 765 766define i16 @fptosi_f64toi16(double %x) #0 { 767; SSE-X86-LABEL: fptosi_f64toi16: 768; SSE-X86: # %bb.0: 769; SSE-X86-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax 770; SSE-X86-NEXT: # kill: def $ax killed $ax killed $eax 771; SSE-X86-NEXT: retl 772; 773; SSE-X64-LABEL: fptosi_f64toi16: 774; SSE-X64: # %bb.0: 775; SSE-X64-NEXT: cvttsd2si %xmm0, %eax 776; SSE-X64-NEXT: # kill: def $ax killed $ax killed $eax 777; SSE-X64-NEXT: retq 778; 779; AVX-X86-LABEL: fptosi_f64toi16: 780; AVX-X86: # %bb.0: 781; AVX-X86-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax 782; AVX-X86-NEXT: # kill: def $ax killed $ax killed $eax 783; AVX-X86-NEXT: retl 784; 785; AVX-X64-LABEL: fptosi_f64toi16: 786; AVX-X64: # %bb.0: 787; AVX-X64-NEXT: vcvttsd2si %xmm0, %eax 788; AVX-X64-NEXT: # kill: def $ax killed $ax killed $eax 789; AVX-X64-NEXT: retq 790; 791; X87-LABEL: fptosi_f64toi16: 792; X87: # %bb.0: 793; X87-NEXT: subl $8, %esp 794; X87-NEXT: .cfi_def_cfa_offset 12 795; X87-NEXT: fldl {{[0-9]+}}(%esp) 796; X87-NEXT: wait 797; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 798; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 799; X87-NEXT: orl $3072, %eax # imm = 0xC00 800; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 801; X87-NEXT: fldcw {{[0-9]+}}(%esp) 802; X87-NEXT: fistps {{[0-9]+}}(%esp) 803; X87-NEXT: fldcw {{[0-9]+}}(%esp) 804; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 805; X87-NEXT: addl $8, %esp 806; X87-NEXT: .cfi_def_cfa_offset 4 807; X87-NEXT: retl 808 %result = call i16 @llvm.experimental.constrained.fptosi.i16.f64(double %x, 809 metadata !"fpexcept.strict") #0 810 ret i16 %result 811} 812 813define i32 @fptosi_f64toi32(double %x) #0 { 814; SSE-X86-LABEL: fptosi_f64toi32: 815; SSE-X86: # %bb.0: 816; SSE-X86-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax 817; SSE-X86-NEXT: retl 818; 819; SSE-X64-LABEL: fptosi_f64toi32: 820; SSE-X64: # %bb.0: 821; SSE-X64-NEXT: cvttsd2si %xmm0, %eax 822; SSE-X64-NEXT: retq 823; 824; AVX-X86-LABEL: fptosi_f64toi32: 825; AVX-X86: # %bb.0: 826; AVX-X86-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax 827; AVX-X86-NEXT: retl 828; 829; AVX-X64-LABEL: fptosi_f64toi32: 830; AVX-X64: # %bb.0: 831; AVX-X64-NEXT: vcvttsd2si %xmm0, %eax 832; AVX-X64-NEXT: retq 833; 834; X87-LABEL: fptosi_f64toi32: 835; X87: # %bb.0: 836; X87-NEXT: subl $8, %esp 837; X87-NEXT: .cfi_def_cfa_offset 12 838; X87-NEXT: fldl {{[0-9]+}}(%esp) 839; X87-NEXT: wait 840; X87-NEXT: fnstcw (%esp) 841; X87-NEXT: movzwl (%esp), %eax 842; X87-NEXT: orl $3072, %eax # imm = 0xC00 843; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 844; X87-NEXT: fldcw {{[0-9]+}}(%esp) 845; X87-NEXT: fistpl {{[0-9]+}}(%esp) 846; X87-NEXT: fldcw (%esp) 847; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 848; X87-NEXT: addl $8, %esp 849; X87-NEXT: .cfi_def_cfa_offset 4 850; X87-NEXT: retl 851 %result = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %x, 852 metadata !"fpexcept.strict") #0 853 ret i32 %result 854} 855 856define i64 @fptosi_f64toi64(double %x) #0 { 857; SSE-X86-LABEL: fptosi_f64toi64: 858; SSE-X86: # %bb.0: 859; SSE-X86-NEXT: pushl %ebp 860; SSE-X86-NEXT: .cfi_def_cfa_offset 8 861; SSE-X86-NEXT: .cfi_offset %ebp, -8 862; SSE-X86-NEXT: movl %esp, %ebp 863; SSE-X86-NEXT: .cfi_def_cfa_register %ebp 864; SSE-X86-NEXT: andl $-8, %esp 865; SSE-X86-NEXT: subl $16, %esp 866; SSE-X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero 867; SSE-X86-NEXT: movsd %xmm0, {{[0-9]+}}(%esp) 868; SSE-X86-NEXT: fldl {{[0-9]+}}(%esp) 869; SSE-X86-NEXT: wait 870; SSE-X86-NEXT: fnstcw {{[0-9]+}}(%esp) 871; SSE-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax 872; SSE-X86-NEXT: orl $3072, %eax # imm = 0xC00 873; SSE-X86-NEXT: movw %ax, {{[0-9]+}}(%esp) 874; SSE-X86-NEXT: fldcw {{[0-9]+}}(%esp) 875; SSE-X86-NEXT: fistpll {{[0-9]+}}(%esp) 876; SSE-X86-NEXT: fldcw {{[0-9]+}}(%esp) 877; SSE-X86-NEXT: movl {{[0-9]+}}(%esp), %eax 878; SSE-X86-NEXT: movl {{[0-9]+}}(%esp), %edx 879; SSE-X86-NEXT: movl %ebp, %esp 880; SSE-X86-NEXT: popl %ebp 881; SSE-X86-NEXT: .cfi_def_cfa %esp, 4 882; SSE-X86-NEXT: retl 883; 884; SSE-X64-LABEL: fptosi_f64toi64: 885; SSE-X64: # %bb.0: 886; SSE-X64-NEXT: cvttsd2si %xmm0, %rax 887; SSE-X64-NEXT: retq 888; 889; AVX-X86-LABEL: fptosi_f64toi64: 890; AVX-X86: # %bb.0: 891; AVX-X86-NEXT: pushl %ebp 892; AVX-X86-NEXT: .cfi_def_cfa_offset 8 893; AVX-X86-NEXT: .cfi_offset %ebp, -8 894; AVX-X86-NEXT: movl %esp, %ebp 895; AVX-X86-NEXT: .cfi_def_cfa_register %ebp 896; AVX-X86-NEXT: andl $-8, %esp 897; AVX-X86-NEXT: subl $8, %esp 898; AVX-X86-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero 899; AVX-X86-NEXT: vmovsd %xmm0, (%esp) 900; AVX-X86-NEXT: fldl (%esp) 901; AVX-X86-NEXT: fisttpll (%esp) 902; AVX-X86-NEXT: wait 903; AVX-X86-NEXT: movl (%esp), %eax 904; AVX-X86-NEXT: movl {{[0-9]+}}(%esp), %edx 905; AVX-X86-NEXT: movl %ebp, %esp 906; AVX-X86-NEXT: popl %ebp 907; AVX-X86-NEXT: .cfi_def_cfa %esp, 4 908; AVX-X86-NEXT: retl 909; 910; AVX-X64-LABEL: fptosi_f64toi64: 911; AVX-X64: # %bb.0: 912; AVX-X64-NEXT: vcvttsd2si %xmm0, %rax 913; AVX-X64-NEXT: retq 914; 915; X87-LABEL: fptosi_f64toi64: 916; X87: # %bb.0: 917; X87-NEXT: pushl %ebp 918; X87-NEXT: .cfi_def_cfa_offset 8 919; X87-NEXT: .cfi_offset %ebp, -8 920; X87-NEXT: movl %esp, %ebp 921; X87-NEXT: .cfi_def_cfa_register %ebp 922; X87-NEXT: andl $-8, %esp 923; X87-NEXT: subl $16, %esp 924; X87-NEXT: fldl 8(%ebp) 925; X87-NEXT: wait 926; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 927; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 928; X87-NEXT: orl $3072, %eax # imm = 0xC00 929; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 930; X87-NEXT: fldcw {{[0-9]+}}(%esp) 931; X87-NEXT: fistpll {{[0-9]+}}(%esp) 932; X87-NEXT: fldcw {{[0-9]+}}(%esp) 933; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 934; X87-NEXT: movl {{[0-9]+}}(%esp), %edx 935; X87-NEXT: movl %ebp, %esp 936; X87-NEXT: popl %ebp 937; X87-NEXT: .cfi_def_cfa %esp, 4 938; X87-NEXT: retl 939 %result = call i64 @llvm.experimental.constrained.fptosi.i64.f64(double %x, 940 metadata !"fpexcept.strict") #0 941 ret i64 %result 942} 943 944define i1 @fptoui_f64toi1(double %x) #0 { 945; SSE-X86-LABEL: fptoui_f64toi1: 946; SSE-X86: # %bb.0: 947; SSE-X86-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax 948; SSE-X86-NEXT: # kill: def $al killed $al killed $eax 949; SSE-X86-NEXT: retl 950; 951; SSE-X64-LABEL: fptoui_f64toi1: 952; SSE-X64: # %bb.0: 953; SSE-X64-NEXT: cvttsd2si %xmm0, %eax 954; SSE-X64-NEXT: # kill: def $al killed $al killed $eax 955; SSE-X64-NEXT: retq 956; 957; AVX-X86-LABEL: fptoui_f64toi1: 958; AVX-X86: # %bb.0: 959; AVX-X86-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax 960; AVX-X86-NEXT: # kill: def $al killed $al killed $eax 961; AVX-X86-NEXT: retl 962; 963; AVX-X64-LABEL: fptoui_f64toi1: 964; AVX-X64: # %bb.0: 965; AVX-X64-NEXT: vcvttsd2si %xmm0, %eax 966; AVX-X64-NEXT: # kill: def $al killed $al killed $eax 967; AVX-X64-NEXT: retq 968; 969; X87-LABEL: fptoui_f64toi1: 970; X87: # %bb.0: 971; X87-NEXT: subl $8, %esp 972; X87-NEXT: .cfi_def_cfa_offset 12 973; X87-NEXT: fldl {{[0-9]+}}(%esp) 974; X87-NEXT: wait 975; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 976; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 977; X87-NEXT: orl $3072, %eax # imm = 0xC00 978; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 979; X87-NEXT: fldcw {{[0-9]+}}(%esp) 980; X87-NEXT: fistps {{[0-9]+}}(%esp) 981; X87-NEXT: fldcw {{[0-9]+}}(%esp) 982; X87-NEXT: movb {{[0-9]+}}(%esp), %al 983; X87-NEXT: addl $8, %esp 984; X87-NEXT: .cfi_def_cfa_offset 4 985; X87-NEXT: retl 986 %result = call i1 @llvm.experimental.constrained.fptoui.i1.f64(double %x, 987 metadata !"fpexcept.strict") #0 988 ret i1 %result 989} 990 991define i8 @fptoui_f64toi8(double %x) #0 { 992; SSE-X86-LABEL: fptoui_f64toi8: 993; SSE-X86: # %bb.0: 994; SSE-X86-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax 995; SSE-X86-NEXT: # kill: def $al killed $al killed $eax 996; SSE-X86-NEXT: retl 997; 998; SSE-X64-LABEL: fptoui_f64toi8: 999; SSE-X64: # %bb.0: 1000; SSE-X64-NEXT: cvttsd2si %xmm0, %eax 1001; SSE-X64-NEXT: # kill: def $al killed $al killed $eax 1002; SSE-X64-NEXT: retq 1003; 1004; AVX-X86-LABEL: fptoui_f64toi8: 1005; AVX-X86: # %bb.0: 1006; AVX-X86-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax 1007; AVX-X86-NEXT: # kill: def $al killed $al killed $eax 1008; AVX-X86-NEXT: retl 1009; 1010; AVX-X64-LABEL: fptoui_f64toi8: 1011; AVX-X64: # %bb.0: 1012; AVX-X64-NEXT: vcvttsd2si %xmm0, %eax 1013; AVX-X64-NEXT: # kill: def $al killed $al killed $eax 1014; AVX-X64-NEXT: retq 1015; 1016; X87-LABEL: fptoui_f64toi8: 1017; X87: # %bb.0: 1018; X87-NEXT: subl $8, %esp 1019; X87-NEXT: .cfi_def_cfa_offset 12 1020; X87-NEXT: fldl {{[0-9]+}}(%esp) 1021; X87-NEXT: wait 1022; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 1023; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 1024; X87-NEXT: orl $3072, %eax # imm = 0xC00 1025; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 1026; X87-NEXT: fldcw {{[0-9]+}}(%esp) 1027; X87-NEXT: fistps {{[0-9]+}}(%esp) 1028; X87-NEXT: fldcw {{[0-9]+}}(%esp) 1029; X87-NEXT: movb {{[0-9]+}}(%esp), %al 1030; X87-NEXT: addl $8, %esp 1031; X87-NEXT: .cfi_def_cfa_offset 4 1032; X87-NEXT: retl 1033 %result = call i8 @llvm.experimental.constrained.fptoui.i8.f64(double %x, 1034 metadata !"fpexcept.strict") #0 1035 ret i8 %result 1036} 1037 1038define i16 @fptoui_f64toi16(double %x) #0 { 1039; SSE-X86-LABEL: fptoui_f64toi16: 1040; SSE-X86: # %bb.0: 1041; SSE-X86-NEXT: cvttsd2si {{[0-9]+}}(%esp), %eax 1042; SSE-X86-NEXT: # kill: def $ax killed $ax killed $eax 1043; SSE-X86-NEXT: retl 1044; 1045; SSE-X64-LABEL: fptoui_f64toi16: 1046; SSE-X64: # %bb.0: 1047; SSE-X64-NEXT: cvttsd2si %xmm0, %eax 1048; SSE-X64-NEXT: # kill: def $ax killed $ax killed $eax 1049; SSE-X64-NEXT: retq 1050; 1051; AVX-X86-LABEL: fptoui_f64toi16: 1052; AVX-X86: # %bb.0: 1053; AVX-X86-NEXT: vcvttsd2si {{[0-9]+}}(%esp), %eax 1054; AVX-X86-NEXT: # kill: def $ax killed $ax killed $eax 1055; AVX-X86-NEXT: retl 1056; 1057; AVX-X64-LABEL: fptoui_f64toi16: 1058; AVX-X64: # %bb.0: 1059; AVX-X64-NEXT: vcvttsd2si %xmm0, %eax 1060; AVX-X64-NEXT: # kill: def $ax killed $ax killed $eax 1061; AVX-X64-NEXT: retq 1062; 1063; X87-LABEL: fptoui_f64toi16: 1064; X87: # %bb.0: 1065; X87-NEXT: subl $8, %esp 1066; X87-NEXT: .cfi_def_cfa_offset 12 1067; X87-NEXT: fldl {{[0-9]+}}(%esp) 1068; X87-NEXT: wait 1069; X87-NEXT: fnstcw (%esp) 1070; X87-NEXT: movzwl (%esp), %eax 1071; X87-NEXT: orl $3072, %eax # imm = 0xC00 1072; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 1073; X87-NEXT: fldcw {{[0-9]+}}(%esp) 1074; X87-NEXT: fistpl {{[0-9]+}}(%esp) 1075; X87-NEXT: fldcw (%esp) 1076; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 1077; X87-NEXT: # kill: def $ax killed $ax killed $eax 1078; X87-NEXT: addl $8, %esp 1079; X87-NEXT: .cfi_def_cfa_offset 4 1080; X87-NEXT: retl 1081 %result = call i16 @llvm.experimental.constrained.fptoui.i16.f64(double %x, 1082 metadata !"fpexcept.strict") #0 1083 ret i16 %result 1084} 1085 1086define i32 @fptoui_f64toi32(double %x) #0 { 1087; SSE-X86-LABEL: fptoui_f64toi32: 1088; SSE-X86: # %bb.0: 1089; SSE-X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero 1090; SSE-X86-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero 1091; SSE-X86-NEXT: comisd %xmm0, %xmm2 1092; SSE-X86-NEXT: xorpd %xmm1, %xmm1 1093; SSE-X86-NEXT: ja .LBB17_2 1094; SSE-X86-NEXT: # %bb.1: 1095; SSE-X86-NEXT: movapd %xmm2, %xmm1 1096; SSE-X86-NEXT: .LBB17_2: 1097; SSE-X86-NEXT: setbe %al 1098; SSE-X86-NEXT: movzbl %al, %ecx 1099; SSE-X86-NEXT: shll $31, %ecx 1100; SSE-X86-NEXT: subsd %xmm1, %xmm0 1101; SSE-X86-NEXT: cvttsd2si %xmm0, %eax 1102; SSE-X86-NEXT: xorl %ecx, %eax 1103; SSE-X86-NEXT: retl 1104; 1105; SSE-X64-LABEL: fptoui_f64toi32: 1106; SSE-X64: # %bb.0: 1107; SSE-X64-NEXT: cvttsd2si %xmm0, %rax 1108; SSE-X64-NEXT: # kill: def $eax killed $eax killed $rax 1109; SSE-X64-NEXT: retq 1110; 1111; AVX1-X86-LABEL: fptoui_f64toi32: 1112; AVX1-X86: # %bb.0: 1113; AVX1-X86-NEXT: pushl %ebp 1114; AVX1-X86-NEXT: .cfi_def_cfa_offset 8 1115; AVX1-X86-NEXT: .cfi_offset %ebp, -8 1116; AVX1-X86-NEXT: movl %esp, %ebp 1117; AVX1-X86-NEXT: .cfi_def_cfa_register %ebp 1118; AVX1-X86-NEXT: andl $-8, %esp 1119; AVX1-X86-NEXT: subl $8, %esp 1120; AVX1-X86-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero 1121; AVX1-X86-NEXT: vmovsd %xmm0, (%esp) 1122; AVX1-X86-NEXT: fldl (%esp) 1123; AVX1-X86-NEXT: fisttpll (%esp) 1124; AVX1-X86-NEXT: wait 1125; AVX1-X86-NEXT: movl (%esp), %eax 1126; AVX1-X86-NEXT: movl %ebp, %esp 1127; AVX1-X86-NEXT: popl %ebp 1128; AVX1-X86-NEXT: .cfi_def_cfa %esp, 4 1129; AVX1-X86-NEXT: retl 1130; 1131; AVX1-X64-LABEL: fptoui_f64toi32: 1132; AVX1-X64: # %bb.0: 1133; AVX1-X64-NEXT: vcvttsd2si %xmm0, %rax 1134; AVX1-X64-NEXT: # kill: def $eax killed $eax killed $rax 1135; AVX1-X64-NEXT: retq 1136; 1137; AVX512-X86-LABEL: fptoui_f64toi32: 1138; AVX512-X86: # %bb.0: 1139; AVX512-X86-NEXT: vcvttsd2usi {{[0-9]+}}(%esp), %eax 1140; AVX512-X86-NEXT: retl 1141; 1142; AVX512-X64-LABEL: fptoui_f64toi32: 1143; AVX512-X64: # %bb.0: 1144; AVX512-X64-NEXT: vcvttsd2usi %xmm0, %eax 1145; AVX512-X64-NEXT: retq 1146; 1147; X87-LABEL: fptoui_f64toi32: 1148; X87: # %bb.0: 1149; X87-NEXT: pushl %ebp 1150; X87-NEXT: .cfi_def_cfa_offset 8 1151; X87-NEXT: .cfi_offset %ebp, -8 1152; X87-NEXT: movl %esp, %ebp 1153; X87-NEXT: .cfi_def_cfa_register %ebp 1154; X87-NEXT: andl $-8, %esp 1155; X87-NEXT: subl $16, %esp 1156; X87-NEXT: fldl 8(%ebp) 1157; X87-NEXT: wait 1158; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 1159; X87-NEXT: movzwl {{[0-9]+}}(%esp), %eax 1160; X87-NEXT: orl $3072, %eax # imm = 0xC00 1161; X87-NEXT: movw %ax, {{[0-9]+}}(%esp) 1162; X87-NEXT: fldcw {{[0-9]+}}(%esp) 1163; X87-NEXT: fistpll {{[0-9]+}}(%esp) 1164; X87-NEXT: fldcw {{[0-9]+}}(%esp) 1165; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 1166; X87-NEXT: movl %ebp, %esp 1167; X87-NEXT: popl %ebp 1168; X87-NEXT: .cfi_def_cfa %esp, 4 1169; X87-NEXT: retl 1170 %result = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double %x, 1171 metadata !"fpexcept.strict") #0 1172 ret i32 %result 1173} 1174 1175define i64 @fptoui_f64toi64(double %x) #0 { 1176; SSE-X86-LABEL: fptoui_f64toi64: 1177; SSE-X86: # %bb.0: 1178; SSE-X86-NEXT: pushl %ebp 1179; SSE-X86-NEXT: .cfi_def_cfa_offset 8 1180; SSE-X86-NEXT: .cfi_offset %ebp, -8 1181; SSE-X86-NEXT: movl %esp, %ebp 1182; SSE-X86-NEXT: .cfi_def_cfa_register %ebp 1183; SSE-X86-NEXT: andl $-8, %esp 1184; SSE-X86-NEXT: subl $16, %esp 1185; SSE-X86-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero 1186; SSE-X86-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero 1187; SSE-X86-NEXT: comisd %xmm0, %xmm1 1188; SSE-X86-NEXT: jbe .LBB18_2 1189; SSE-X86-NEXT: # %bb.1: 1190; SSE-X86-NEXT: xorpd %xmm1, %xmm1 1191; SSE-X86-NEXT: .LBB18_2: 1192; SSE-X86-NEXT: subsd %xmm1, %xmm0 1193; SSE-X86-NEXT: movsd %xmm0, {{[0-9]+}}(%esp) 1194; SSE-X86-NEXT: setbe %al 1195; SSE-X86-NEXT: fldl {{[0-9]+}}(%esp) 1196; SSE-X86-NEXT: wait 1197; SSE-X86-NEXT: fnstcw {{[0-9]+}}(%esp) 1198; SSE-X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx 1199; SSE-X86-NEXT: orl $3072, %ecx # imm = 0xC00 1200; SSE-X86-NEXT: movw %cx, {{[0-9]+}}(%esp) 1201; SSE-X86-NEXT: fldcw {{[0-9]+}}(%esp) 1202; SSE-X86-NEXT: fistpll {{[0-9]+}}(%esp) 1203; SSE-X86-NEXT: fldcw {{[0-9]+}}(%esp) 1204; SSE-X86-NEXT: movzbl %al, %edx 1205; SSE-X86-NEXT: shll $31, %edx 1206; SSE-X86-NEXT: xorl {{[0-9]+}}(%esp), %edx 1207; SSE-X86-NEXT: movl {{[0-9]+}}(%esp), %eax 1208; SSE-X86-NEXT: movl %ebp, %esp 1209; SSE-X86-NEXT: popl %ebp 1210; SSE-X86-NEXT: .cfi_def_cfa %esp, 4 1211; SSE-X86-NEXT: retl 1212; 1213; SSE-X64-LABEL: fptoui_f64toi64: 1214; SSE-X64: # %bb.0: 1215; SSE-X64-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero 1216; SSE-X64-NEXT: comisd %xmm2, %xmm0 1217; SSE-X64-NEXT: xorpd %xmm1, %xmm1 1218; SSE-X64-NEXT: jb .LBB18_2 1219; SSE-X64-NEXT: # %bb.1: 1220; SSE-X64-NEXT: movapd %xmm2, %xmm1 1221; SSE-X64-NEXT: .LBB18_2: 1222; SSE-X64-NEXT: subsd %xmm1, %xmm0 1223; SSE-X64-NEXT: cvttsd2si %xmm0, %rcx 1224; SSE-X64-NEXT: setae %al 1225; SSE-X64-NEXT: movzbl %al, %eax 1226; SSE-X64-NEXT: shlq $63, %rax 1227; SSE-X64-NEXT: xorq %rcx, %rax 1228; SSE-X64-NEXT: retq 1229; 1230; AVX1-X86-LABEL: fptoui_f64toi64: 1231; AVX1-X86: # %bb.0: 1232; AVX1-X86-NEXT: pushl %ebp 1233; AVX1-X86-NEXT: .cfi_def_cfa_offset 8 1234; AVX1-X86-NEXT: .cfi_offset %ebp, -8 1235; AVX1-X86-NEXT: movl %esp, %ebp 1236; AVX1-X86-NEXT: .cfi_def_cfa_register %ebp 1237; AVX1-X86-NEXT: andl $-8, %esp 1238; AVX1-X86-NEXT: subl $8, %esp 1239; AVX1-X86-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero 1240; AVX1-X86-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero 1241; AVX1-X86-NEXT: vcomisd %xmm0, %xmm1 1242; AVX1-X86-NEXT: jbe .LBB18_2 1243; AVX1-X86-NEXT: # %bb.1: 1244; AVX1-X86-NEXT: vxorpd %xmm1, %xmm1, %xmm1 1245; AVX1-X86-NEXT: .LBB18_2: 1246; AVX1-X86-NEXT: vsubsd %xmm1, %xmm0, %xmm0 1247; AVX1-X86-NEXT: vmovsd %xmm0, (%esp) 1248; AVX1-X86-NEXT: fldl (%esp) 1249; AVX1-X86-NEXT: fisttpll (%esp) 1250; AVX1-X86-NEXT: wait 1251; AVX1-X86-NEXT: setbe %al 1252; AVX1-X86-NEXT: movzbl %al, %edx 1253; AVX1-X86-NEXT: shll $31, %edx 1254; AVX1-X86-NEXT: xorl {{[0-9]+}}(%esp), %edx 1255; AVX1-X86-NEXT: movl (%esp), %eax 1256; AVX1-X86-NEXT: movl %ebp, %esp 1257; AVX1-X86-NEXT: popl %ebp 1258; AVX1-X86-NEXT: .cfi_def_cfa %esp, 4 1259; AVX1-X86-NEXT: retl 1260; 1261; AVX1-X64-LABEL: fptoui_f64toi64: 1262; AVX1-X64: # %bb.0: 1263; AVX1-X64-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero 1264; AVX1-X64-NEXT: vcomisd %xmm1, %xmm0 1265; AVX1-X64-NEXT: vxorpd %xmm2, %xmm2, %xmm2 1266; AVX1-X64-NEXT: jb .LBB18_2 1267; AVX1-X64-NEXT: # %bb.1: 1268; AVX1-X64-NEXT: vmovapd %xmm1, %xmm2 1269; AVX1-X64-NEXT: .LBB18_2: 1270; AVX1-X64-NEXT: vsubsd %xmm2, %xmm0, %xmm0 1271; AVX1-X64-NEXT: vcvttsd2si %xmm0, %rcx 1272; AVX1-X64-NEXT: setae %al 1273; AVX1-X64-NEXT: movzbl %al, %eax 1274; AVX1-X64-NEXT: shlq $63, %rax 1275; AVX1-X64-NEXT: xorq %rcx, %rax 1276; AVX1-X64-NEXT: retq 1277; 1278; AVX512-X86-LABEL: fptoui_f64toi64: 1279; AVX512-X86: # %bb.0: 1280; AVX512-X86-NEXT: pushl %ebp 1281; AVX512-X86-NEXT: .cfi_def_cfa_offset 8 1282; AVX512-X86-NEXT: .cfi_offset %ebp, -8 1283; AVX512-X86-NEXT: movl %esp, %ebp 1284; AVX512-X86-NEXT: .cfi_def_cfa_register %ebp 1285; AVX512-X86-NEXT: andl $-8, %esp 1286; AVX512-X86-NEXT: subl $8, %esp 1287; AVX512-X86-NEXT: vmovsd {{.*#+}} xmm0 = mem[0],zero 1288; AVX512-X86-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero 1289; AVX512-X86-NEXT: xorl %edx, %edx 1290; AVX512-X86-NEXT: vcomisd %xmm0, %xmm1 1291; AVX512-X86-NEXT: setbe %dl 1292; AVX512-X86-NEXT: kmovw %edx, %k1 1293; AVX512-X86-NEXT: vmovsd %xmm1, %xmm1, %xmm1 {%k1} {z} 1294; AVX512-X86-NEXT: vsubsd %xmm1, %xmm0, %xmm0 1295; AVX512-X86-NEXT: vmovsd %xmm0, (%esp) 1296; AVX512-X86-NEXT: fldl (%esp) 1297; AVX512-X86-NEXT: fisttpll (%esp) 1298; AVX512-X86-NEXT: wait 1299; AVX512-X86-NEXT: shll $31, %edx 1300; AVX512-X86-NEXT: xorl {{[0-9]+}}(%esp), %edx 1301; AVX512-X86-NEXT: movl (%esp), %eax 1302; AVX512-X86-NEXT: movl %ebp, %esp 1303; AVX512-X86-NEXT: popl %ebp 1304; AVX512-X86-NEXT: .cfi_def_cfa %esp, 4 1305; AVX512-X86-NEXT: retl 1306; 1307; AVX512-X64-LABEL: fptoui_f64toi64: 1308; AVX512-X64: # %bb.0: 1309; AVX512-X64-NEXT: vcvttsd2usi %xmm0, %rax 1310; AVX512-X64-NEXT: retq 1311; 1312; X87-LABEL: fptoui_f64toi64: 1313; X87: # %bb.0: 1314; X87-NEXT: pushl %ebp 1315; X87-NEXT: .cfi_def_cfa_offset 8 1316; X87-NEXT: .cfi_offset %ebp, -8 1317; X87-NEXT: movl %esp, %ebp 1318; X87-NEXT: .cfi_def_cfa_register %ebp 1319; X87-NEXT: andl $-8, %esp 1320; X87-NEXT: subl $16, %esp 1321; X87-NEXT: fldl 8(%ebp) 1322; X87-NEXT: flds {{\.LCPI.*}} 1323; X87-NEXT: fcom %st(1) 1324; X87-NEXT: wait 1325; X87-NEXT: fnstsw %ax 1326; X87-NEXT: xorl %edx, %edx 1327; X87-NEXT: # kill: def $ah killed $ah killed $ax 1328; X87-NEXT: sahf 1329; X87-NEXT: setbe %al 1330; X87-NEXT: fldz 1331; X87-NEXT: jbe .LBB18_2 1332; X87-NEXT: # %bb.1: 1333; X87-NEXT: fstp %st(1) 1334; X87-NEXT: fldz 1335; X87-NEXT: .LBB18_2: 1336; X87-NEXT: fstp %st(0) 1337; X87-NEXT: fsubrp %st, %st(1) 1338; X87-NEXT: wait 1339; X87-NEXT: fnstcw {{[0-9]+}}(%esp) 1340; X87-NEXT: movzwl {{[0-9]+}}(%esp), %ecx 1341; X87-NEXT: orl $3072, %ecx # imm = 0xC00 1342; X87-NEXT: movw %cx, {{[0-9]+}}(%esp) 1343; X87-NEXT: fldcw {{[0-9]+}}(%esp) 1344; X87-NEXT: fistpll {{[0-9]+}}(%esp) 1345; X87-NEXT: fldcw {{[0-9]+}}(%esp) 1346; X87-NEXT: movb %al, %dl 1347; X87-NEXT: shll $31, %edx 1348; X87-NEXT: xorl {{[0-9]+}}(%esp), %edx 1349; X87-NEXT: movl {{[0-9]+}}(%esp), %eax 1350; X87-NEXT: movl %ebp, %esp 1351; X87-NEXT: popl %ebp 1352; X87-NEXT: .cfi_def_cfa %esp, 4 1353; X87-NEXT: retl 1354 %result = call i64 @llvm.experimental.constrained.fptoui.i64.f64(double %x, 1355 metadata !"fpexcept.strict") #0 1356 ret i64 %result 1357} 1358 1359attributes #0 = { strictfp } 1360