xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/arm64_vneg.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -O1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -emit-llvm %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc // Test ARM64 SIMD negate and saturating negate intrinsics
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc #include <arm_neon.h>
5*0a6a1f1dSLionel Sambuc 
test_vnegq_s64(int64x2_t a1)6*0a6a1f1dSLionel Sambuc int64x2_t test_vnegq_s64(int64x2_t a1) {
7*0a6a1f1dSLionel Sambuc   // CHECK: test_vnegq_s64
8*0a6a1f1dSLionel Sambuc   return vnegq_s64(a1);
9*0a6a1f1dSLionel Sambuc   // CHECK: sub <2 x i64> zeroinitializer, %a1
10*0a6a1f1dSLionel Sambuc   // CHECK-NEXT: ret
11*0a6a1f1dSLionel Sambuc }
12*0a6a1f1dSLionel Sambuc 
test_vqnegq_s64(int64x2_t a1)13*0a6a1f1dSLionel Sambuc int64x2_t test_vqnegq_s64(int64x2_t a1) {
14*0a6a1f1dSLionel Sambuc   // CHECK: test_vqnegq_s64
15*0a6a1f1dSLionel Sambuc   return vqnegq_s64(a1);
16*0a6a1f1dSLionel Sambuc   // CHECK: llvm.aarch64.neon.sqneg.v2i64
17*0a6a1f1dSLionel Sambuc   // CHECK-NEXT: ret
18*0a6a1f1dSLionel Sambuc }
19