Home | History | Annotate | Download | only in AArch64
      1 ; RUN: llc -mtriple=aarch64-apple-ios %s -o - | FileCheck %s
      2 
      3 define <16 x double> @test_sitofp_fixed(<16 x i32> %in) {
      4 ; CHECK-LABEL: test_sitofp_fixed:
      5 
      6   ; First, extend each i32 to i64
      7 ; CHECK-DAG: sshll2.2d [[BLOCK0_HI:v[0-9]+]], v0, #0
      8 ; CHECK-DAG: sshll2.2d [[BLOCK1_HI:v[0-9]+]], v1, #0
      9 ; CHECK-DAG: sshll2.2d [[BLOCK2_HI:v[0-9]+]], v2, #0
     10 ; CHECK-DAG: sshll2.2d [[BLOCK3_HI:v[0-9]+]], v3, #0
     11 ; CHECK-DAG: sshll.2d [[BLOCK0_LO:v[0-9]+]], v0, #0
     12 ; CHECK-DAG: sshll.2d [[BLOCK1_LO:v[0-9]+]], v1, #0
     13 ; CHECK-DAG: sshll.2d [[BLOCK2_LO:v[0-9]+]], v2, #0
     14 ; CHECK-DAG: sshll.2d [[BLOCK3_LO:v[0-9]+]], v3, #0
     15 
     16   ; Next, convert each to double.
     17 ; CHECK-DAG: scvtf.2d v0, [[BLOCK0_LO]]
     18 ; CHECK-DAG: scvtf.2d v1, [[BLOCK0_HI]]
     19 ; CHECK-DAG: scvtf.2d v2, [[BLOCK1_LO]]
     20 ; CHECK-DAG: scvtf.2d v3, [[BLOCK1_HI]]
     21 ; CHECK-DAG: scvtf.2d v4, [[BLOCK2_LO]]
     22 ; CHECK-DAG: scvtf.2d v5, [[BLOCK2_HI]]
     23 ; CHECK-DAG: scvtf.2d v6, [[BLOCK3_LO]]
     24 ; CHECK-DAG: scvtf.2d v7, [[BLOCK3_HI]]
     25 
     26 ; CHECK: ret
     27   %flt = sitofp <16 x i32> %in to <16 x double>
     28   %res = fdiv <16 x double> %flt, <double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0, double 64.0>
     29   ret <16 x double> %res
     30 }
     31 
     32 ; This one is small enough to satisfy isSimple, but still illegally large.
     33 define <4 x double> @test_sitofp_fixed_shortish(<4 x i64> %in) {
     34 ; CHECK-LABEL: test_sitofp_fixed_shortish:
     35 
     36 ; CHECK-DAG: scvtf.2d v0, v0
     37 ; CHECK-DAG: scvtf.2d v1, v1
     38 
     39 ; CHECK: ret
     40   %flt = sitofp <4 x i64> %in to <4 x double>
     41   %res = fdiv <4 x double> %flt, <double 64.0, double 64.0, double 64.0, double 64.0>
     42   ret <4 x double> %res
     43 }
     44