[llvm] r195803 - [AArch64] Add support for NEON scalar floating-point absolute difference.
Chad Rosier
mcrosier at codeaurora.org
Tue Nov 26 17:45:59 PST 2013
Author: mcrosier
Date: Tue Nov 26 19:45:58 2013
New Revision: 195803
URL: http://llvm.org/viewvc/llvm-project?rev=195803&view=rev
Log:
[AArch64] Add support for NEON scalar floating-point absolute difference.
Added:
llvm/trunk/test/CodeGen/AArch64/neon-scalar-fabd.ll
Modified:
llvm/trunk/include/llvm/IR/IntrinsicsAArch64.td
llvm/trunk/lib/Target/AArch64/AArch64InstrNEON.td
llvm/trunk/test/MC/AArch64/neon-diagnostics.s
llvm/trunk/test/MC/AArch64/neon-scalar-abs.s
llvm/trunk/test/MC/Disassembler/AArch64/neon-instructions.txt
Modified: llvm/trunk/include/llvm/IR/IntrinsicsAArch64.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/IntrinsicsAArch64.td?rev=195803&r1=195802&r2=195803&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/IntrinsicsAArch64.td (original)
+++ llvm/trunk/include/llvm/IR/IntrinsicsAArch64.td Tue Nov 26 19:45:58 2013
@@ -312,6 +312,9 @@ def int_aarch64_neon_vsqadd : Neon_2Arg_
def int_aarch64_neon_vabs :
Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
+// Scalar Absolute Difference
+def int_aarch64_neon_vabd : Neon_2Arg_Intrinsic;
+
// Scalar Negate Value
def int_aarch64_neon_vneg :
Intrinsic<[llvm_v1i64_ty], [llvm_v1i64_ty], [IntrNoMem]>;
Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrNEON.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrNEON.td?rev=195803&r1=195802&r2=195803&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrNEON.td (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrNEON.td Tue Nov 26 19:45:58 2013
@@ -5074,6 +5074,11 @@ defm FACGT: NeonI_Scalar3Same_SD_sizes<0
defm : Neon_Scalar3Same_cmp_SD_size_patterns<int_aarch64_neon_vcagt,
FACGTsss, FACGTddd>;
+// Scakar Floating-point Absolute Difference
+defm FABD: NeonI_Scalar3Same_SD_sizes<0b1, 0b1, 0b11010, "fabd">;
+defm : Neon_Scalar3Same_SD_size_patterns<int_aarch64_neon_vabd,
+ FABDsss, FABDddd>;
+
// Scalar Absolute Value
defm ABS : NeonI_Scalar2SameMisc_D_size<0b0, 0b01011, "abs">;
defm : Neon_Scalar2SameMisc_D_size_patterns<int_aarch64_neon_vabs, ABSdd>;
Added: llvm/trunk/test/CodeGen/AArch64/neon-scalar-fabd.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/neon-scalar-fabd.ll?rev=195803&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/neon-scalar-fabd.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/neon-scalar-fabd.ll Tue Nov 26 19:45:58 2013
@@ -0,0 +1,26 @@
+; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
+
+define float @test_vabds_f32(float %a, float %b) {
+; CHECK-LABEL: test_vabds_f32
+; CHECK: fabd {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+entry:
+ %vabd.i = insertelement <1 x float> undef, float %a, i32 0
+ %vabd1.i = insertelement <1 x float> undef, float %b, i32 0
+ %vabd2.i = call <1 x float> @llvm.aarch64.neon.vabd.v1f32(<1 x float> %vabd.i, <1 x float> %vabd1.i)
+ %0 = extractelement <1 x float> %vabd2.i, i32 0
+ ret float %0
+}
+
+define double @test_vabdd_f64(double %a, double %b) {
+; CHECK-LABEL: test_vabdd_f64
+; CHECK: fabd {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}}
+entry:
+ %vabd.i = insertelement <1 x double> undef, double %a, i32 0
+ %vabd1.i = insertelement <1 x double> undef, double %b, i32 0
+ %vabd2.i = call <1 x double> @llvm.aarch64.neon.vabd.v1f64(<1 x double> %vabd.i, <1 x double> %vabd1.i)
+ %0 = extractelement <1 x double> %vabd2.i, i32 0
+ ret double %0
+}
+
+declare <1 x double> @llvm.aarch64.neon.vabd.v1f64(<1 x double>, <1 x double>)
+declare <1 x float> @llvm.aarch64.neon.vabd.v1f32(<1 x float>, <1 x float>)
Modified: llvm/trunk/test/MC/AArch64/neon-diagnostics.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/neon-diagnostics.s?rev=195803&r1=195802&r2=195803&view=diff
==============================================================================
--- llvm/trunk/test/MC/AArch64/neon-diagnostics.s (original)
+++ llvm/trunk/test/MC/AArch64/neon-diagnostics.s Tue Nov 26 19:45:58 2013
@@ -7301,3 +7301,18 @@
// CHECK-ERROR: error: invalid operand for instruction
// CHECK-ERROR: fcvtzu d0, s0
// CHECK-ERROR: ^
+
+//----------------------------------------------------------------------
+// Scalar Floating-point Absolute Difference
+//----------------------------------------------------------------------
+
+
+ fabd s29, d24, s20
+ fabd d29, s24, d20
+
+// CHECK-ERROR: error: invalid operand for instruction
+// CHECK-ERROR: fabd s29, d24, s20
+// CHECK-ERROR: ^
+// CHECK-ERROR: error: invalid operand for instruction
+// CHECK-ERROR: fabd d29, s24, d20
+// CHECK-ERROR: ^
Modified: llvm/trunk/test/MC/AArch64/neon-scalar-abs.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/neon-scalar-abs.s?rev=195803&r1=195802&r2=195803&view=diff
==============================================================================
--- llvm/trunk/test/MC/AArch64/neon-scalar-abs.s (original)
+++ llvm/trunk/test/MC/AArch64/neon-scalar-abs.s Tue Nov 26 19:45:58 2013
@@ -9,6 +9,16 @@
abs d29, d24
// CHECK: abs d29, d24 // encoding: [0x1d,0xbb,0xe0,0x5e]
+
+//----------------------------------------------------------------------
+// Scalar Floating-point Absolute Difference
+//----------------------------------------------------------------------
+
+ fabd s29, s24, s20
+ fabd d29, d24, d20
+
+// CHECK: fabd s29, s24, s20 // encoding: [0x1d,0xd7,0xb4,0x7e]
+// CHECK: fabd d29, d24, d20 // encoding: [0x1d,0xd7,0xf4,0x7e]
//----------------------------------------------------------------------
// Scalar Signed Saturating Absolute Value
Modified: llvm/trunk/test/MC/Disassembler/AArch64/neon-instructions.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Disassembler/AArch64/neon-instructions.txt?rev=195803&r1=195802&r2=195803&view=diff
==============================================================================
--- llvm/trunk/test/MC/Disassembler/AArch64/neon-instructions.txt (original)
+++ llvm/trunk/test/MC/Disassembler/AArch64/neon-instructions.txt Tue Nov 26 19:45:58 2013
@@ -2609,3 +2609,11 @@
# CHECK: fcvtzu d21, d14
0xac,0xb9,0xa1,0x7e
0xd5,0xb9,0xe1,0x7e
+
+#----------------------------------------------------------------------
+# Scalar Floating-point Absolute Difference
+#----------------------------------------------------------------------
+# CHECK: fabd s29, s24, s20
+# CHECK: fabd d29, d24, d20
+0x1d,0xd7,0xb4,0x7e
+0x1d,0xd7,0xf4,0x7e
More information about the llvm-commits
mailing list