• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i386-apple-darwin10 -mcpu=corei7-avx -mattr=+avx | FileCheck %s
3
4;; Check that FP_TO_SINT and FP_TO_UINT generate convert with truncate
5
6define <4 x i8> @test1(<4 x double> %d) {
7; CHECK-LABEL: test1:
8; CHECK:       ## %bb.0:
9; CHECK-NEXT:    vcvttpd2dq %ymm0, %xmm0
10; CHECK-NEXT:    vpackusdw %xmm0, %xmm0, %xmm0
11; CHECK-NEXT:    vpackuswb %xmm0, %xmm0, %xmm0
12; CHECK-NEXT:    vzeroupper
13; CHECK-NEXT:    retl
14  %c = fptoui <4 x double> %d to <4 x i8>
15  ret <4 x i8> %c
16}
17define <4 x i8> @test2(<4 x double> %d) {
18; CHECK-LABEL: test2:
19; CHECK:       ## %bb.0:
20; CHECK-NEXT:    vcvttpd2dq %ymm0, %xmm0
21; CHECK-NEXT:    vpackssdw %xmm0, %xmm0, %xmm0
22; CHECK-NEXT:    vpacksswb %xmm0, %xmm0, %xmm0
23; CHECK-NEXT:    vzeroupper
24; CHECK-NEXT:    retl
25  %c = fptosi <4 x double> %d to <4 x i8>
26  ret <4 x i8> %c
27}
28