@@ -9,6 +9,32 @@ use super::*;
9
9
#[ cfg( test) ]
10
10
use stdarch_test:: assert_instr;
11
11
12
+ /// Absolute difference between the arguments of Floating
13
+ #[ inline]
14
+ #[ target_feature( enable = "neon" ) ]
15
+ #[ cfg_attr( test, assert_instr( fabd) ) ]
16
+ pub unsafe fn vabd_f64 ( a : float64x1_t , b : float64x1_t ) -> float64x1_t {
17
+ #[ allow( improper_ctypes) ]
18
+ extern "C" {
19
+ #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fabd.v1f64" ) ]
20
+ fn vabd_f64_ ( a : float64x1_t , a : float64x1_t ) -> float64x1_t ;
21
+ }
22
+ vabd_f64_ ( a, b)
23
+ }
24
+
25
+ /// Absolute difference between the arguments of Floating
26
+ #[ inline]
27
+ #[ target_feature( enable = "neon" ) ]
28
+ #[ cfg_attr( test, assert_instr( fabd) ) ]
29
+ pub unsafe fn vabdq_f64 ( a : float64x2_t , b : float64x2_t ) -> float64x2_t {
30
+ #[ allow( improper_ctypes) ]
31
+ extern "C" {
32
+ #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fabd.v2f64" ) ]
33
+ fn vabdq_f64_ ( a : float64x2_t , a : float64x2_t ) -> float64x2_t ;
34
+ }
35
+ vabdq_f64_ ( a, b)
36
+ }
37
+
12
38
/// Compare bitwise Equal (vector)
13
39
#[ inline]
14
40
#[ target_feature( enable = "neon" ) ]
@@ -570,6 +596,24 @@ mod test {
570
596
use std:: mem:: transmute;
571
597
use stdarch_test:: simd_test;
572
598
599
+ #[ simd_test( enable = "neon" ) ]
600
+ unsafe fn test_vabd_f64 ( ) {
601
+ let a: f64 = 1.0 ;
602
+ let b: f64 = 9.0 ;
603
+ let e: f64 = 8.0 ;
604
+ let r: f64 = transmute ( vabd_f64 ( transmute ( a) , transmute ( b) ) ) ;
605
+ assert_eq ! ( r, e) ;
606
+ }
607
+
608
+ #[ simd_test( enable = "neon" ) ]
609
+ unsafe fn test_vabdq_f64 ( ) {
610
+ let a: f64x2 = f64x2:: new ( 1.0 , 2.0 ) ;
611
+ let b: f64x2 = f64x2:: new ( 9.0 , 3.0 ) ;
612
+ let e: f64x2 = f64x2:: new ( 8.0 , 1.0 ) ;
613
+ let r: f64x2 = transmute ( vabdq_f64 ( transmute ( a) , transmute ( b) ) ) ;
614
+ assert_eq ! ( r, e) ;
615
+ }
616
+
573
617
#[ simd_test( enable = "neon" ) ]
574
618
unsafe fn test_vceq_u64 ( ) {
575
619
let a: u64x1 = u64x1:: new ( 0 ) ;
0 commit comments