Home | History | Annotate | Download | only in AArch64
      1 // RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon -show-encoding < %s | FileCheck %s
      2 
      3 // Check that the assembler can handle the documented syntax for AArch64
      4 
      5 
      6 //------------------------------------------------------------------------------
      7 // Vector Integer Saturating Add (Signed)
      8 //------------------------------------------------------------------------------
      9          sqadd v0.8b, v1.8b, v2.8b
     10          sqadd v0.16b, v1.16b, v2.16b
     11          sqadd v0.4h, v1.4h, v2.4h
     12          sqadd v0.8h, v1.8h, v2.8h
     13          sqadd v0.2s, v1.2s, v2.2s
     14          sqadd v0.4s, v1.4s, v2.4s
     15          sqadd v0.2d, v1.2d, v2.2d
     16 
     17 // CHECK: sqadd v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x0c,0x22,0x0e]
     18 // CHECK: sqadd v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x0c,0x22,0x4e]
     19 // CHECK: sqadd v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x0c,0x62,0x0e]
     20 // CHECK: sqadd v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x0c,0x62,0x4e]
     21 // CHECK: sqadd v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x0c,0xa2,0x0e]
     22 // CHECK: sqadd v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x0c,0xa2,0x4e]
     23 // CHECK: sqadd v0.2d, v1.2d, v2.2d        // encoding: [0x20,0x0c,0xe2,0x4e]
     24 
     25 //------------------------------------------------------------------------------
     26 // Vector Integer Saturating Add (Unsigned)
     27 //------------------------------------------------------------------------------
     28          uqadd v0.8b, v1.8b, v2.8b
     29          uqadd v0.16b, v1.16b, v2.16b
     30          uqadd v0.4h, v1.4h, v2.4h
     31          uqadd v0.8h, v1.8h, v2.8h
     32          uqadd v0.2s, v1.2s, v2.2s
     33          uqadd v0.4s, v1.4s, v2.4s
     34          uqadd v0.2d, v1.2d, v2.2d
     35 
     36 // CHECK: uqadd v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x0c,0x22,0x2e]
     37 // CHECK: uqadd v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x0c,0x22,0x6e]
     38 // CHECK: uqadd v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x0c,0x62,0x2e]
     39 // CHECK: uqadd v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x0c,0x62,0x6e]
     40 // CHECK: uqadd v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x0c,0xa2,0x2e]
     41 // CHECK: uqadd v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x0c,0xa2,0x6e]
     42 // CHECK: uqadd v0.2d, v1.2d, v2.2d        // encoding: [0x20,0x0c,0xe2,0x6e]
     43 
     44 //------------------------------------------------------------------------------
     45 // Vector Integer Saturating Sub (Signed)
     46 //------------------------------------------------------------------------------
     47          sqsub v0.8b, v1.8b, v2.8b
     48          sqsub v0.16b, v1.16b, v2.16b
     49          sqsub v0.4h, v1.4h, v2.4h
     50          sqsub v0.8h, v1.8h, v2.8h
     51          sqsub v0.2s, v1.2s, v2.2s
     52          sqsub v0.4s, v1.4s, v2.4s
     53          sqsub v0.2d, v1.2d, v2.2d
     54 
     55 // CHECK: sqsub v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x2c,0x22,0x0e]
     56 // CHECK: sqsub v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x2c,0x22,0x4e]
     57 // CHECK: sqsub v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x2c,0x62,0x0e]
     58 // CHECK: sqsub v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x2c,0x62,0x4e]
     59 // CHECK: sqsub v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x2c,0xa2,0x0e]
     60 // CHECK: sqsub v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x2c,0xa2,0x4e]
     61 // CHECK: sqsub v0.2d, v1.2d, v2.2d        // encoding: [0x20,0x2c,0xe2,0x4e]
     62 
     63 //------------------------------------------------------------------------------
     64 // Vector Integer Saturating Sub (Unsigned)
     65 //------------------------------------------------------------------------------
     66          uqsub v0.8b, v1.8b, v2.8b
     67          uqsub v0.16b, v1.16b, v2.16b
     68          uqsub v0.4h, v1.4h, v2.4h
     69          uqsub v0.8h, v1.8h, v2.8h
     70          uqsub v0.2s, v1.2s, v2.2s
     71          uqsub v0.4s, v1.4s, v2.4s
     72          uqsub v0.2d, v1.2d, v2.2d
     73 
     74 // CHECK: uqsub v0.8b, v1.8b, v2.8b        // encoding: [0x20,0x2c,0x22,0x2e]
     75 // CHECK: uqsub v0.16b, v1.16b, v2.16b     // encoding: [0x20,0x2c,0x22,0x6e]
     76 // CHECK: uqsub v0.4h, v1.4h, v2.4h        // encoding: [0x20,0x2c,0x62,0x2e]
     77 // CHECK: uqsub v0.8h, v1.8h, v2.8h        // encoding: [0x20,0x2c,0x62,0x6e]
     78 // CHECK: uqsub v0.2s, v1.2s, v2.2s        // encoding: [0x20,0x2c,0xa2,0x2e]
     79 // CHECK: uqsub v0.4s, v1.4s, v2.4s        // encoding: [0x20,0x2c,0xa2,0x6e]
     80 // CHECK: uqsub v0.2d, v1.2d, v2.2d        // encoding: [0x20,0x2c,0xe2,0x6e]
     81 
     82 //------------------------------------------------------------------------------
     83 // Scalar Integer Saturating Add (Signed)
     84 //------------------------------------------------------------------------------
     85          sqadd b0, b1, b2
     86          sqadd h10, h11, h12
     87          sqadd s20, s21, s2
     88          sqadd d17, d31, d8
     89 
     90 // CHECK: sqadd b0, b1, b2        // encoding: [0x20,0x0c,0x22,0x5e]
     91 // CHECK: sqadd h10, h11, h12     // encoding: [0x6a,0x0d,0x6c,0x5e]
     92 // CHECK: sqadd s20, s21, s2      // encoding: [0xb4,0x0e,0xa2,0x5e]
     93 // CHECK: sqadd d17, d31, d8      // encoding: [0xf1,0x0f,0xe8,0x5e]
     94 
     95 //------------------------------------------------------------------------------
     96 // Scalar Integer Saturating Add (Unsigned)
     97 //------------------------------------------------------------------------------
     98          uqadd b0, b1, b2
     99          uqadd h10, h11, h12
    100          uqadd s20, s21, s2
    101          uqadd d17, d31, d8
    102 
    103 // CHECK: uqadd b0, b1, b2        // encoding: [0x20,0x0c,0x22,0x7e]
    104 // CHECK: uqadd h10, h11, h12     // encoding: [0x6a,0x0d,0x6c,0x7e]
    105 // CHECK: uqadd s20, s21, s2      // encoding: [0xb4,0x0e,0xa2,0x7e]
    106 // CHECK: uqadd d17, d31, d8      // encoding: [0xf1,0x0f,0xe8,0x7e]
    107 
    108 //------------------------------------------------------------------------------
    109 // Scalar Integer Saturating Sub (Signed)
    110 //------------------------------------------------------------------------------
    111          sqsub b0, b1, b2
    112          sqsub h10, h11, h12
    113          sqsub s20, s21, s2
    114          sqsub d17, d31, d8
    115 
    116 // CHECK: sqsub b0, b1, b2        // encoding: [0x20,0x2c,0x22,0x5e]
    117 // CHECK: sqsub h10, h11, h12     // encoding: [0x6a,0x2d,0x6c,0x5e]
    118 // CHECK: sqsub s20, s21, s2      // encoding: [0xb4,0x2e,0xa2,0x5e]
    119 // CHECK: sqsub d17, d31, d8      // encoding: [0xf1,0x2f,0xe8,0x5e]
    120 
    121 //------------------------------------------------------------------------------
    122 // Scalar Integer Saturating Sub (Unsigned)
    123 //------------------------------------------------------------------------------
    124          uqsub b0, b1, b2
    125          uqsub h10, h11, h12
    126          uqsub s20, s21, s2
    127          uqsub d17, d31, d8
    128 
    129 // CHECK: uqsub b0, b1, b2        // encoding: [0x20,0x2c,0x22,0x7e]
    130 // CHECK: uqsub h10, h11, h12     // encoding: [0x6a,0x2d,0x6c,0x7e]
    131 // CHECK: uqsub s20, s21, s2      // encoding: [0xb4,0x2e,0xa2,0x7e]
    132 // CHECK: uqsub d17, d31, d8      // encoding: [0xf1,0x2f,0xe8,0x7e]
    133 
    134