xref: /aosp_15_r20/external/llvm/test/MC/AArch64/neon-scalar-saturating-add-sub.s (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker//------------------------------------------------------------------------------
4*9880d681SAndroid Build Coastguard Worker// Scalar Integer Saturating Add (Signed)
5*9880d681SAndroid Build Coastguard Worker//------------------------------------------------------------------------------
6*9880d681SAndroid Build Coastguard Worker         sqadd b0, b1, b2
7*9880d681SAndroid Build Coastguard Worker         sqadd h10, h11, h12
8*9880d681SAndroid Build Coastguard Worker         sqadd s20, s21, s2
9*9880d681SAndroid Build Coastguard Worker         sqadd d17, d31, d8
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker// CHECK: sqadd b0, b1, b2        // encoding: [0x20,0x0c,0x22,0x5e]
12*9880d681SAndroid Build Coastguard Worker// CHECK: sqadd h10, h11, h12     // encoding: [0x6a,0x0d,0x6c,0x5e]
13*9880d681SAndroid Build Coastguard Worker// CHECK: sqadd s20, s21, s2      // encoding: [0xb4,0x0e,0xa2,0x5e]
14*9880d681SAndroid Build Coastguard Worker// CHECK: sqadd d17, d31, d8      // encoding: [0xf1,0x0f,0xe8,0x5e]
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Worker//------------------------------------------------------------------------------
17*9880d681SAndroid Build Coastguard Worker// Scalar Integer Saturating Add (Unsigned)
18*9880d681SAndroid Build Coastguard Worker//------------------------------------------------------------------------------
19*9880d681SAndroid Build Coastguard Worker         uqadd b0, b1, b2
20*9880d681SAndroid Build Coastguard Worker         uqadd h10, h11, h12
21*9880d681SAndroid Build Coastguard Worker         uqadd s20, s21, s2
22*9880d681SAndroid Build Coastguard Worker         uqadd d17, d31, d8
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker// CHECK: uqadd b0, b1, b2        // encoding: [0x20,0x0c,0x22,0x7e]
25*9880d681SAndroid Build Coastguard Worker// CHECK: uqadd h10, h11, h12     // encoding: [0x6a,0x0d,0x6c,0x7e]
26*9880d681SAndroid Build Coastguard Worker// CHECK: uqadd s20, s21, s2      // encoding: [0xb4,0x0e,0xa2,0x7e]
27*9880d681SAndroid Build Coastguard Worker// CHECK: uqadd d17, d31, d8      // encoding: [0xf1,0x0f,0xe8,0x7e]
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker//------------------------------------------------------------------------------
30*9880d681SAndroid Build Coastguard Worker// Scalar Integer Saturating Sub (Signed)
31*9880d681SAndroid Build Coastguard Worker//------------------------------------------------------------------------------
32*9880d681SAndroid Build Coastguard Worker         sqsub b0, b1, b2
33*9880d681SAndroid Build Coastguard Worker         sqsub h10, h11, h12
34*9880d681SAndroid Build Coastguard Worker         sqsub s20, s21, s2
35*9880d681SAndroid Build Coastguard Worker         sqsub d17, d31, d8
36*9880d681SAndroid Build Coastguard Worker
37*9880d681SAndroid Build Coastguard Worker// CHECK: sqsub b0, b1, b2        // encoding: [0x20,0x2c,0x22,0x5e]
38*9880d681SAndroid Build Coastguard Worker// CHECK: sqsub h10, h11, h12     // encoding: [0x6a,0x2d,0x6c,0x5e]
39*9880d681SAndroid Build Coastguard Worker// CHECK: sqsub s20, s21, s2      // encoding: [0xb4,0x2e,0xa2,0x5e]
40*9880d681SAndroid Build Coastguard Worker// CHECK: sqsub d17, d31, d8      // encoding: [0xf1,0x2f,0xe8,0x5e]
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Worker//------------------------------------------------------------------------------
43*9880d681SAndroid Build Coastguard Worker// Scalar Integer Saturating Sub (Unsigned)
44*9880d681SAndroid Build Coastguard Worker//------------------------------------------------------------------------------
45*9880d681SAndroid Build Coastguard Worker         uqsub b0, b1, b2
46*9880d681SAndroid Build Coastguard Worker         uqsub h10, h11, h12
47*9880d681SAndroid Build Coastguard Worker         uqsub s20, s21, s2
48*9880d681SAndroid Build Coastguard Worker         uqsub d17, d31, d8
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard Worker// CHECK: uqsub b0, b1, b2        // encoding: [0x20,0x2c,0x22,0x7e]
51*9880d681SAndroid Build Coastguard Worker// CHECK: uqsub h10, h11, h12     // encoding: [0x6a,0x2d,0x6c,0x7e]
52*9880d681SAndroid Build Coastguard Worker// CHECK: uqsub s20, s21, s2      // encoding: [0xb4,0x2e,0xa2,0x7e]
53*9880d681SAndroid Build Coastguard Worker// CHECK: uqsub d17, d31, d8      // encoding: [0xf1,0x2f,0xe8,0x7e]
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Worker//----------------------------------------------------------------------
56*9880d681SAndroid Build Coastguard Worker// Signed Saturating Accumulated of Unsigned Value
57*9880d681SAndroid Build Coastguard Worker//----------------------------------------------------------------------
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard Worker    suqadd b19, b14
60*9880d681SAndroid Build Coastguard Worker    suqadd h20, h15
61*9880d681SAndroid Build Coastguard Worker    suqadd s21, s12
62*9880d681SAndroid Build Coastguard Worker    suqadd d18, d22
63*9880d681SAndroid Build Coastguard Worker
64*9880d681SAndroid Build Coastguard Worker// CHECK: suqadd b19, b14    // encoding: [0xd3,0x39,0x20,0x5e]
65*9880d681SAndroid Build Coastguard Worker// CHECK: suqadd h20, h15    // encoding: [0xf4,0x39,0x60,0x5e]
66*9880d681SAndroid Build Coastguard Worker// CHECK: suqadd s21, s12    // encoding: [0x95,0x39,0xa0,0x5e]
67*9880d681SAndroid Build Coastguard Worker// CHECK: suqadd d18, d22    // encoding: [0xd2,0x3a,0xe0,0x5e]
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Worker//----------------------------------------------------------------------
70*9880d681SAndroid Build Coastguard Worker// Unsigned Saturating Accumulated of Signed Value
71*9880d681SAndroid Build Coastguard Worker//----------------------------------------------------------------------
72*9880d681SAndroid Build Coastguard Worker
73*9880d681SAndroid Build Coastguard Worker    usqadd b19, b14
74*9880d681SAndroid Build Coastguard Worker    usqadd h20, h15
75*9880d681SAndroid Build Coastguard Worker    usqadd s21, s12
76*9880d681SAndroid Build Coastguard Worker    usqadd d18, d22
77*9880d681SAndroid Build Coastguard Worker
78*9880d681SAndroid Build Coastguard Worker// CHECK: usqadd b19, b14    // encoding: [0xd3,0x39,0x20,0x7e]
79*9880d681SAndroid Build Coastguard Worker// CHECK: usqadd h20, h15    // encoding: [0xf4,0x39,0x60,0x7e]
80*9880d681SAndroid Build Coastguard Worker// CHECK: usqadd s21, s12    // encoding: [0x95,0x39,0xa0,0x7e]
81*9880d681SAndroid Build Coastguard Worker// CHECK: usqadd d18, d22    // encoding: [0xd2,0x3a,0xe0,0x7e]
82