Home | History | Annotate | Download | only in AArch64
      1 // RUN: llvm-mc -triple aarch64-none-linux-gnu -mattr=+neon,+fullfp16 -show-encoding < %s | FileCheck %s
      2 
      3 // Check that the assembler can handle the documented syntax for AArch64
      4 
      5 //----------------------------------------------------------------------
      6 // Scalar Signed Integer Convert To Floating-point
      7 //----------------------------------------------------------------------
      8 
      9     scvtf h23, h14
     10     scvtf s22, s13
     11     scvtf d21, d12
     12 
     13 // CHECK: scvtf   h23, h14                // encoding: [0xd7,0xd9,0x79,0x5e]
     14 // CHECK: scvtf s22, s13    // encoding: [0xb6,0xd9,0x21,0x5e]
     15 // CHECK: scvtf d21, d12    // encoding: [0x95,0xd9,0x61,0x5e]
     16 
     17 //----------------------------------------------------------------------
     18 // Scalar Unsigned Integer Convert To Floating-point
     19 //----------------------------------------------------------------------
     20 
     21     ucvtf h20, h12
     22     ucvtf s22, s13
     23     ucvtf d21, d14
     24 
     25 // CHECK: ucvtf   h20, h12                // encoding: [0x94,0xd9,0x79,0x7e]
     26 // CHECK: ucvtf s22, s13    // encoding: [0xb6,0xd9,0x21,0x7e]
     27 // CHECK: ucvtf d21, d14    // encoding: [0xd5,0xd9,0x61,0x7e]
     28 
     29 //----------------------------------------------------------------------
     30 // Scalar Signed Fixed-point Convert To Floating-Point (Immediate)
     31 //----------------------------------------------------------------------
     32 
     33     scvtf h22, h13, #16
     34     scvtf s22, s13, #32
     35     scvtf d21, d12, #64
     36 
     37 // CHECK: scvtf   h22, h13, #16           // encoding: [0xb6,0xe5,0x10,0x5f]
     38 // CHECK: scvtf s22, s13, #32  // encoding: [0xb6,0xe5,0x20,0x5f]
     39 // CHECK: scvtf d21, d12, #64  // encoding: [0x95,0xe5,0x40,0x5f]
     40 
     41 //----------------------------------------------------------------------
     42 // Scalar Unsigned Fixed-point Convert To Floating-Point (Immediate)
     43 //----------------------------------------------------------------------
     44 
     45     ucvtf h22, h13, #16
     46     ucvtf s22, s13, #32
     47     ucvtf d21, d14, #64
     48 
     49 // CHECK: ucvtf   h22, h13, #16           // encoding: [0xb6,0xe5,0x10,0x7f]
     50 // CHECK: ucvtf s22, s13, #32  // encoding: [0xb6,0xe5,0x20,0x7f]
     51 // CHECK: ucvtf d21, d14, #64  // encoding: [0xd5,0xe5,0x40,0x7f]
     52 
     53 //----------------------------------------------------------------------
     54 // Scalar Floating-point Convert To Signed Fixed-point (Immediate)
     55 //----------------------------------------------------------------------
     56 
     57     fcvtzs h21, h12, #1
     58     fcvtzs s21, s12, #1
     59     fcvtzs d21, d12, #1
     60 
     61 // CHECK: fcvtzs  h21, h12, #1            // encoding: [0x95,0xfd,0x1f,0x5f]
     62 // CHECK: fcvtzs s21, s12, #1  // encoding: [0x95,0xfd,0x3f,0x5f]
     63 // CHECK: fcvtzs d21, d12, #1  // encoding: [0x95,0xfd,0x7f,0x5f]
     64 
     65 //----------------------------------------------------------------------
     66 // Scalar Floating-point Convert To Unsigned Fixed-point (Immediate)
     67 //----------------------------------------------------------------------
     68 
     69     fcvtzu h21, h12, #1
     70     fcvtzu s21, s12, #1
     71     fcvtzu d21, d12, #1
     72 
     73 // CHECK: fcvtzu  h21, h12, #1            // encoding: [0x95,0xfd,0x1f,0x7f]
     74 // CHECK: fcvtzu s21, s12, #1  // encoding: [0x95,0xfd,0x3f,0x7f]
     75 // CHECK: fcvtzu d21, d12, #1  // encoding: [0x95,0xfd,0x7f,0x7f]
     76 
     77 //----------------------------------------------------------------------
     78 // Scalar Floating-point Convert To Lower Precision Narrow, Rounding To
     79 // Odd
     80 //----------------------------------------------------------------------
     81 
     82     fcvtxn s22, d13
     83 
     84 // CHECK: fcvtxn s22, d13    // encoding: [0xb6,0x69,0x61,0x7e]
     85 
     86 //----------------------------------------------------------------------
     87 // Scalar Floating-point Convert To Signed Integer, Rounding To Nearest
     88 // With Ties To Away
     89 //----------------------------------------------------------------------
     90 
     91     fcvtas h12, h13
     92     fcvtas s12, s13
     93     fcvtas d21, d14
     94 
     95 // CHECK: fcvtas  h12, h13                // encoding: [0xac,0xc9,0x79,0x5e]
     96 // CHECK: fcvtas s12, s13    // encoding: [0xac,0xc9,0x21,0x5e]
     97 // CHECK: fcvtas d21, d14    // encoding: [0xd5,0xc9,0x61,0x5e]
     98 
     99 //----------------------------------------------------------------------
    100 // Scalar Floating-point Convert To Unsigned Integer, Rounding To
    101 // Nearest With Ties To Away
    102 //----------------------------------------------------------------------
    103 
    104     fcvtau h12, h13
    105     fcvtau s12, s13
    106     fcvtau d21, d14
    107 
    108 // CHECK: fcvtau  h12, h13                // encoding: [0xac,0xc9,0x79,0x7e]
    109 // CHECK: fcvtau s12, s13    // encoding: [0xac,0xc9,0x21,0x7e]
    110 // CHECK: fcvtau d21, d14    // encoding: [0xd5,0xc9,0x61,0x7e]
    111 
    112 //----------------------------------------------------------------------
    113 // Scalar Floating-point Convert To Signed Integer, Rounding Toward
    114 // Minus Infinity
    115 //----------------------------------------------------------------------
    116 
    117     fcvtms h22, h13
    118     fcvtms s22, s13
    119     fcvtms d21, d14
    120 
    121 // CHECK: fcvtms  h22, h13                // encoding: [0xb6,0xb9,0x79,0x5e]
    122 // CHECK: fcvtms s22, s13    // encoding: [0xb6,0xb9,0x21,0x5e]
    123 // CHECK: fcvtms d21, d14    // encoding: [0xd5,0xb9,0x61,0x5e]
    124 
    125 //----------------------------------------------------------------------
    126 // Scalar Floating-point Convert To Unsigned Integer, Rounding Toward
    127 // Minus Infinity
    128 //----------------------------------------------------------------------
    129 
    130     fcvtmu h12, h13
    131     fcvtmu s12, s13
    132     fcvtmu d21, d14
    133 
    134 // CHECK: fcvtmu  h12, h13                // encoding: [0xac,0xb9,0x79,0x7e]
    135 // CHECK: fcvtmu s12, s13    // encoding: [0xac,0xb9,0x21,0x7e]
    136 // CHECK: fcvtmu d21, d14    // encoding: [0xd5,0xb9,0x61,0x7e]
    137 
    138 //----------------------------------------------------------------------
    139 // Scalar Floating-point Convert To Signed Integer, Rounding To Nearest
    140 // With Ties To Even
    141 //----------------------------------------------------------------------
    142 
    143     fcvtns h22, h13
    144     fcvtns s22, s13
    145     fcvtns d21, d14
    146 
    147 // CHECK: fcvtns  h22, h13                // encoding: [0xb6,0xa9,0x79,0x5e]
    148 // CHECK: fcvtns s22, s13    // encoding: [0xb6,0xa9,0x21,0x5e]
    149 // CHECK: fcvtns d21, d14    // encoding: [0xd5,0xa9,0x61,0x5e]
    150 
    151 //----------------------------------------------------------------------
    152 // Scalar Floating-point Convert To Unsigned Integer, Rounding To
    153 // Nearest With Ties To Even
    154 //----------------------------------------------------------------------
    155 
    156     fcvtnu h12, h13
    157     fcvtnu s12, s13
    158     fcvtnu d21, d14
    159 
    160 // CHECK: fcvtnu  h12, h13                // encoding: [0xac,0xa9,0x79,0x7e]
    161 // CHECK: fcvtnu s12, s13    // encoding: [0xac,0xa9,0x21,0x7e]
    162 // CHECK: fcvtnu d21, d14    // encoding: [0xd5,0xa9,0x61,0x7e]
    163 
    164 //----------------------------------------------------------------------
    165 // Scalar Floating-point Convert To Signed Integer, Rounding Toward
    166 // Positive Infinity
    167 //----------------------------------------------------------------------
    168 
    169     fcvtps h22, h13
    170     fcvtps s22, s13
    171     fcvtps d21, d14
    172 
    173 // CHECK: fcvtps  h22, h13                // encoding: [0xb6,0xa9,0xf9,0x5e]
    174 // CHECK: fcvtps s22, s13    // encoding: [0xb6,0xa9,0xa1,0x5e]
    175 // CHECK: fcvtps d21, d14    // encoding: [0xd5,0xa9,0xe1,0x5e]
    176 
    177 //----------------------------------------------------------------------
    178 // Scalar Floating-point Convert To Unsigned Integer, Rounding Toward
    179 // Positive Infinity
    180 //----------------------------------------------------------------------
    181 
    182     fcvtpu h12, h13
    183     fcvtpu s12, s13
    184     fcvtpu d21, d14
    185 
    186 // CHECK: fcvtpu  h12, h13                // encoding: [0xac,0xa9,0xf9,0x7e]
    187 // CHECK: fcvtpu s12, s13    // encoding: [0xac,0xa9,0xa1,0x7e]
    188 // CHECK: fcvtpu d21, d14    // encoding: [0xd5,0xa9,0xe1,0x7e]
    189 
    190 //----------------------------------------------------------------------
    191 // Scalar Floating-point Convert To Signed Integer, Rounding Toward Zero
    192 //----------------------------------------------------------------------
    193 
    194     fcvtzs h12, h13
    195     fcvtzs s12, s13
    196     fcvtzs d21, d14
    197 
    198 // CHECK: fcvtzs  h12, h13                // encoding: [0xac,0xb9,0xf9,0x5e]
    199 // CHECK: fcvtzs s12, s13    // encoding: [0xac,0xb9,0xa1,0x5e]
    200 // CHECK: fcvtzs d21, d14    // encoding: [0xd5,0xb9,0xe1,0x5e]
    201 
    202 //----------------------------------------------------------------------
    203 // Scalar Floating-point Convert To Unsigned Integer, Rounding Toward
    204 // Zero
    205 //----------------------------------------------------------------------
    206 
    207     fcvtzu h12, h13
    208     fcvtzu s12, s13
    209     fcvtzu d21, d14
    210 
    211 // CHECK: fcvtzu  h12, h13                // encoding: [0xac,0xb9,0xf9,0x7e]
    212 // CHECK: fcvtzu s12, s13    // encoding: [0xac,0xb9,0xa1,0x7e]
    213 // CHECK: fcvtzu d21, d14    // encoding: [0xd5,0xb9,0xe1,0x7e]
    214