Home | History | Annotate | Download | only in ARM
      1 ; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s
      2 
      3 define <4 x i32> @test1(<4 x i32> %a) nounwind {
      4 ; CHECK-LABEL: test1:
      5 ; CHECK: vabs.s32 q
      6         %tmp1neg = sub <4 x i32> zeroinitializer, %a
      7         %b = icmp sgt <4 x i32> %a, <i32 -1, i32 -1, i32 -1, i32 -1>
      8         %abs = select <4 x i1> %b, <4 x i32> %a, <4 x i32> %tmp1neg
      9         ret <4 x i32> %abs
     10 }
     11 
     12 define <4 x i32> @test2(<4 x i32> %a) nounwind {
     13 ; CHECK-LABEL: test2:
     14 ; CHECK: vabs.s32 q
     15         %tmp1neg = sub <4 x i32> zeroinitializer, %a
     16         %b = icmp sge <4 x i32> %a, zeroinitializer
     17         %abs = select <4 x i1> %b, <4 x i32> %a, <4 x i32> %tmp1neg
     18         ret <4 x i32> %abs
     19 }
     20 
     21 define <8 x i16> @test3(<8 x i16> %a) nounwind {
     22 ; CHECK-LABEL: test3:
     23 ; CHECK: vabs.s16 q
     24         %tmp1neg = sub <8 x i16> zeroinitializer, %a
     25         %b = icmp sgt <8 x i16> %a, zeroinitializer
     26         %abs = select <8 x i1> %b, <8 x i16> %a, <8 x i16> %tmp1neg
     27         ret <8 x i16> %abs
     28 }
     29 
     30 define <16 x i8> @test4(<16 x i8> %a) nounwind {
     31 ; CHECK-LABEL: test4:
     32 ; CHECK: vabs.s8 q
     33         %tmp1neg = sub <16 x i8> zeroinitializer, %a
     34         %b = icmp slt <16 x i8> %a, zeroinitializer
     35         %abs = select <16 x i1> %b, <16 x i8> %tmp1neg, <16 x i8> %a
     36         ret <16 x i8> %abs
     37 }
     38 
     39 define <4 x i32> @test5(<4 x i32> %a) nounwind {
     40 ; CHECK-LABEL: test5:
     41 ; CHECK: vabs.s32 q
     42         %tmp1neg = sub <4 x i32> zeroinitializer, %a
     43         %b = icmp sle <4 x i32> %a, zeroinitializer
     44         %abs = select <4 x i1> %b, <4 x i32> %tmp1neg, <4 x i32> %a
     45         ret <4 x i32> %abs
     46 }
     47 
     48 define <2 x i32> @test6(<2 x i32> %a) nounwind {
     49 ; CHECK-LABEL: test6:
     50 ; CHECK: vabs.s32 d
     51         %tmp1neg = sub <2 x i32> zeroinitializer, %a
     52         %b = icmp sgt <2 x i32> %a, <i32 -1, i32 -1>
     53         %abs = select <2 x i1> %b, <2 x i32> %a, <2 x i32> %tmp1neg
     54         ret <2 x i32> %abs
     55 }
     56 
     57 define <2 x i32> @test7(<2 x i32> %a) nounwind {
     58 ; CHECK-LABEL: test7:
     59 ; CHECK: vabs.s32 d
     60         %tmp1neg = sub <2 x i32> zeroinitializer, %a
     61         %b = icmp sge <2 x i32> %a, zeroinitializer
     62         %abs = select <2 x i1> %b, <2 x i32> %a, <2 x i32> %tmp1neg
     63         ret <2 x i32> %abs
     64 }
     65 
     66 define <4 x i16> @test8(<4 x i16> %a) nounwind {
     67 ; CHECK-LABEL: test8:
     68 ; CHECK: vabs.s16 d
     69         %tmp1neg = sub <4 x i16> zeroinitializer, %a
     70         %b = icmp sgt <4 x i16> %a, zeroinitializer
     71         %abs = select <4 x i1> %b, <4 x i16> %a, <4 x i16> %tmp1neg
     72         ret <4 x i16> %abs
     73 }
     74 
     75 define <8 x i8> @test9(<8 x i8> %a) nounwind {
     76 ; CHECK-LABEL: test9:
     77 ; CHECK: vabs.s8 d
     78         %tmp1neg = sub <8 x i8> zeroinitializer, %a
     79         %b = icmp slt <8 x i8> %a, zeroinitializer
     80         %abs = select <8 x i1> %b, <8 x i8> %tmp1neg, <8 x i8> %a
     81         ret <8 x i8> %abs
     82 }
     83 
     84 define <2 x i32> @test10(<2 x i32> %a) nounwind {
     85 ; CHECK-LABEL: test10:
     86 ; CHECK: vabs.s32 d
     87         %tmp1neg = sub <2 x i32> zeroinitializer, %a
     88         %b = icmp sle <2 x i32> %a, zeroinitializer
     89         %abs = select <2 x i1> %b, <2 x i32> %tmp1neg, <2 x i32> %a
     90         ret <2 x i32> %abs
     91 }
     92