1 ; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s 2 3 define i32 @test_neg_i32(i32 %in) { 4 ; CHECK-LABEL: test_neg_i32: 5 ; CHECK: neg w0, w0 6 %res = sub i32 0, %in 7 ret i32 %res 8 } 9 10 define i64 @test_neg_i64(i64 %in) { 11 ; CHECK-LABEL: test_neg_i64: 12 ; CHECK: neg x0, x0 13 %res = sub i64 0, %in 14 ret i64 %res 15 } 16 17 define <8 x i8> @test_neg_v8i8(<8 x i8> %in) { 18 ; CHECK-LABEL: test_neg_v8i8: 19 ; CHECK: neg v0.8b, v0.8b 20 %res = sub <8 x i8> zeroinitializer, %in 21 ret <8 x i8> %res 22 } 23 24 define <4 x i16> @test_neg_v4i16(<4 x i16> %in) { 25 ; CHECK-LABEL: test_neg_v4i16: 26 ; CHECK: neg v0.4h, v0.4h 27 %res = sub <4 x i16> zeroinitializer, %in 28 ret <4 x i16> %res 29 } 30 31 define <2 x i32> @test_neg_v2i32(<2 x i32> %in) { 32 ; CHECK-LABEL: test_neg_v2i32: 33 ; CHECK: neg v0.2s, v0.2s 34 %res = sub <2 x i32> zeroinitializer, %in 35 ret <2 x i32> %res 36 } 37 38 define <16 x i8> @test_neg_v16i8(<16 x i8> %in) { 39 ; CHECK-LABEL: test_neg_v16i8: 40 ; CHECK: neg v0.16b, v0.16b 41 %res = sub <16 x i8> zeroinitializer, %in 42 ret <16 x i8> %res 43 } 44 45 define <8 x i16> @test_neg_v8i16(<8 x i16> %in) { 46 ; CHECK-LABEL: test_neg_v8i16: 47 ; CHECK: neg v0.8h, v0.8h 48 %res = sub <8 x i16> zeroinitializer, %in 49 ret <8 x i16> %res 50 } 51 52 define <4 x i32> @test_neg_v4i32(<4 x i32> %in) { 53 ; CHECK-LABEL: test_neg_v4i32: 54 ; CHECK: neg v0.4s, v0.4s 55 %res = sub <4 x i32> zeroinitializer, %in 56 ret <4 x i32> %res 57 } 58 59 define <2 x i64> @test_neg_v2i64(<2 x i64> %in) { 60 ; CHECK-LABEL: test_neg_v2i64: 61 ; CHECK: neg v0.2d, v0.2d 62 %res = sub <2 x i64> zeroinitializer, %in 63 ret <2 x i64> %res 64 } 65 66 define <1 x i64> @test_neg_v1i64(<1 x i64> %in) { 67 ; CHECK-LABEL: test_neg_v1i64: 68 ; CHECK: neg d0, d0 69 %res = sub <1 x i64> zeroinitializer, %in 70 ret <1 x i64> %res 71 } 72