aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/AArch64/neon-scalar-neg.ll12
-rw-r--r--test/MC/AArch64/neon-diagnostics.s10
-rw-r--r--test/MC/AArch64/neon-scalar-neg.s8
-rw-r--r--test/MC/Disassembler/AArch64/neon-instructions.txt6
4 files changed, 36 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/neon-scalar-neg.ll b/test/CodeGen/AArch64/neon-scalar-neg.ll
index 41d4832..4dc9d51 100644
--- a/test/CodeGen/AArch64/neon-scalar-neg.ll
+++ b/test/CodeGen/AArch64/neon-scalar-neg.ll
@@ -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]+}}
diff --git a/test/MC/AArch64/neon-diagnostics.s b/test/MC/AArch64/neon-diagnostics.s
index ddd80ea..411ea9f 100644
--- a/test/MC/AArch64/neon-diagnostics.s
+++ b/test/MC/AArch64/neon-diagnostics.s
@@ -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: ^
diff --git a/test/MC/AArch64/neon-scalar-neg.s b/test/MC/AArch64/neon-scalar-neg.s
index 0e637da..8e5d61d 100644
--- a/test/MC/AArch64/neon-scalar-neg.s
+++ b/test/MC/AArch64/neon-scalar-neg.s
@@ -3,6 +3,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
//----------------------------------------------------------------------
diff --git a/test/MC/Disassembler/AArch64/neon-instructions.txt b/test/MC/Disassembler/AArch64/neon-instructions.txt
index 81fffd6..c70a2f6 100644
--- a/test/MC/Disassembler/AArch64/neon-instructions.txt
+++ b/test/MC/Disassembler/AArch64/neon-instructions.txt
@@ -1619,6 +1619,12 @@
0x92,0x79,0xe0,0x5e
#----------------------------------------------------------------------
+# Scalar Negate
+#----------------------------------------------------------------------
+# CHECK: neg d29, d24
+0x1d,0xbb,0xe0,0x7e
+
+#----------------------------------------------------------------------
# Scalar Signed Saturating Negate
#----------------------------------------------------------------------
# CHECK: sqneg b19, b14