[AArch64] Add support for NEON scalar negate instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192843 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chad Rosier 2013-10-16 21:04:39 +00:00
parent a249914462
commit dceac4c5a6
6 changed files with 44 additions and 0 deletions

View File

@ -200,4 +200,8 @@ def int_aarch64_neon_vsqadd : Neon_2Arg_Intrinsic;
// Scalar Absolute Value
def int_aarch64_neon_vabs :
Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
// Scalar Negate Value
def int_aarch64_neon_vneg :
Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
}

View File

@ -3585,6 +3585,10 @@ defm SQABS : NeonI_Scalar2SameMisc_BHSD_size<0b0, 0b00111, "sqabs">;
defm : Neon_Scalar2SameMisc_BHSD_size_patterns<int_arm_neon_vqabs,
SQABSbb, SQABShh, SQABSss, SQABSdd>;
// Scalar Negate
defm NEG : NeonI_Scalar2SameMisc_D_size<0b1, 0b01011, "neg">;
defm : Neon_Scalar2SameMisc_D_size_patterns<int_aarch64_neon_vneg, NEGdd>;
// Scalar Signed Saturating Negate
defm SQNEG : NeonI_Scalar2SameMisc_BHSD_size<0b1, 0b00111, "sqneg">;
defm : Neon_Scalar2SameMisc_BHSD_size_patterns<int_arm_neon_vqneg,

View File

@ -1,5 +1,17 @@
; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
define i64 @test_vnegd_s64(i64 %a) {
; CHECK: test_vnegd_s64
; CHECK: neg {{d[0-9]+}}, {{d[0-9]+}}
entry:
%vneg.i = insertelement <1 x i64> undef, i64 %a, i32 0
%vneg1.i = tail call <1 x i64> @llvm.aarch64.neon.vneg(<1 x i64> %vneg.i)
%0 = extractelement <1 x i64> %vneg1.i, i32 0
ret i64 %0
}
declare <1 x i64> @llvm.aarch64.neon.vneg(<1 x i64>)
define i8 @test_vqnegb_s8(i8 %a) {
; CHECK: test_vqnegb_s8
; CHECK: sqneg {{b[0-9]+}}, {{b[0-9]+}}

View File

@ -4450,3 +4450,13 @@
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: abs d29, s24
// CHECK-ERROR: ^
//----------------------------------------------------------------------
// Scalar Negate
//----------------------------------------------------------------------
neg d29, s24
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: neg d29, s24
// CHECK-ERROR: ^

View File

@ -2,6 +2,14 @@
// Check that the assembler can handle the documented syntax for AArch64
//----------------------------------------------------------------------
// Scalar Negate
//----------------------------------------------------------------------
neg d29, d24
// CHECK: neg d29, d24 // encoding: [0x1d,0xbb,0xe0,0x7e]
//----------------------------------------------------------------------
// Scalar Signed Saturating Negate
//----------------------------------------------------------------------

View File

@ -1618,6 +1618,12 @@
0x94,0x79,0xa0,0x5e
0x92,0x79,0xe0,0x5e
#----------------------------------------------------------------------
# Scalar Negate
#----------------------------------------------------------------------
# CHECK: neg d29, d24
0x1d,0xbb,0xe0,0x7e
#----------------------------------------------------------------------
# Scalar Signed Saturating Negate
#----------------------------------------------------------------------