Text file src/simd/archsimd/_gen/simdgen/ops/Converts/go_arm64.yaml

     1  !sum
     2  
     3  - go: TruncToInt8
     4    asm: "VXTN"
     5    hiHalfAsm: "VXTN2"
     6    in:
     7      - base: int
     8        elemBits: 16
     9    out:
    10      - base: int
    11        bits: 128
    12  
    13  - go: TruncToUint8
    14    asm: "VXTN"
    15    hiHalfAsm: "VXTN2"
    16    in:
    17      - base: uint
    18        elemBits: 16
    19    out:
    20      - base: uint
    21        bits: 128
    22  
    23  - go: TruncToInt16
    24    asm: "VXTN"
    25    hiHalfAsm: "VXTN2"
    26    in:
    27      - base: int
    28        elemBits: 32
    29    out:
    30      - base: int
    31        bits: 128
    32  
    33  - go: TruncToUint16
    34    asm: "VXTN"
    35    hiHalfAsm: "VXTN2"
    36    in:
    37      - base: uint
    38        elemBits: 32
    39    out:
    40      - base: uint
    41        bits: 128
    42  
    43  - go: TruncToInt32
    44    asm: "VXTN"
    45    hiHalfAsm: "VXTN2"
    46    in:
    47      - base: int
    48        elemBits: 64
    49    out:
    50      - base: int
    51        bits: 128
    52  
    53  - go: TruncToUint32
    54    asm: "VXTN"
    55    hiHalfAsm: "VXTN2"
    56    in:
    57      - base: uint
    58        elemBits: 64
    59    out:
    60      - base: uint
    61        bits: 128
    62  
    63  # Float -> Int conversions (same-size)
    64  # ISA XML has float→float for FCVTZS_int; use OverwriteBase to correct output type
    65  # float32 -> int32
    66  - go: ConvertToInt32
    67    asm: "VFCVTZS"
    68    in:
    69      - base: float
    70        elemBits: 32
    71    out:
    72      - base: float
    73        elemBits: 32
    74        OverwriteBase: int
    75  
    76  # float32 -> uint32
    77  - go: ConvertToUint32
    78    asm: "VFCVTZU"
    79    in:
    80      - base: float
    81        elemBits: 32
    82    out:
    83      - base: float
    84        elemBits: 32
    85        OverwriteBase: uint
    86  
    87  # float64 -> int64
    88  - go: ConvertToInt64
    89    asm: "VFCVTZS"
    90    in:
    91      - base: float
    92        elemBits: 64
    93    out:
    94      - base: float
    95        elemBits: 64
    96        OverwriteBase: int
    97  
    98  # float64 -> uint64
    99  - go: ConvertToUint64
   100    asm: "VFCVTZU"
   101    in:
   102      - base: float
   103        elemBits: 64
   104    out:
   105      - base: float
   106        elemBits: 64
   107        OverwriteBase: uint
   108  
   109  # Int -> Float conversions (same-size)
   110  # ISA XML has float→float for SCVTF_int/UCVTF_int; use OverwriteBase to correct input type
   111  # int32 -> float32
   112  - go: ConvertToFloat32
   113    asm: "VSCVTF"
   114    in:
   115      - base: float
   116        elemBits: 32
   117        OverwriteBase: int
   118    out:
   119      - base: float
   120        elemBits: 32
   121  
   122  # uint32 -> float32
   123  - go: ConvertToFloat32
   124    asm: "VUCVTF"
   125    in:
   126      - base: float
   127        elemBits: 32
   128        OverwriteBase: uint
   129    out:
   130      - base: float
   131        elemBits: 32
   132  
   133  # int64 -> float64
   134  - go: ConvertToFloat64
   135    asm: "VSCVTF"
   136    in:
   137      - base: float
   138        elemBits: 64
   139        OverwriteBase: int
   140    out:
   141      - base: float
   142        elemBits: 64
   143  
   144  # uint64 -> float64
   145  - go: ConvertToFloat64
   146    asm: "VUCVTF"
   147    in:
   148      - base: float
   149        elemBits: 64
   150        OverwriteBase: uint
   151    out:
   152      - base: float
   153        elemBits: 64
   154  
   155  # Float narrow/widen
   156  # float64 -> float32 narrow
   157  - go: ConvertToFloat32
   158    asm: "VFCVTN"
   159    hiHalfAsm: "VFCVTN2"
   160    in:
   161      - base: float
   162        elemBits: 64
   163    out:
   164      - base: float
   165        elemBits: 32
   166        bits: 128
   167  
   168  # float32 -> float64 widen
   169  - go: ConvertLo2ToFloat64
   170    asm: "VFCVTL"
   171    hiHalfAsm: "VFCVTL2"
   172    in:
   173      - base: float
   174        elemBits: 32
   175    out:
   176      - base: float
   177        elemBits: 64
   178        bits: 128
   179  
   180  # Integer extend (widen) — signed
   181  # int8 -> int16
   182  - go: ExtendLo8ToInt16
   183    asm: "VSXTL"
   184    hiHalfAsm: "VSXTL2"
   185    in:
   186      - base: int
   187        elemBits: 8
   188    out:
   189      - base: int
   190        elemBits: 16
   191        bits: 128
   192  
   193  # int16 -> int32
   194  - go: ExtendLo4ToInt32
   195    asm: "VSXTL"
   196    hiHalfAsm: "VSXTL2"
   197    in:
   198      - base: int
   199        elemBits: 16
   200    out:
   201      - base: int
   202        elemBits: 32
   203        bits: 128
   204  
   205  # int32 -> int64
   206  - go: ExtendLo2ToInt64
   207    asm: "VSXTL"
   208    hiHalfAsm: "VSXTL2"
   209    in:
   210      - base: int
   211        elemBits: 32
   212    out:
   213      - base: int
   214        elemBits: 64
   215        bits: 128
   216  
   217  # Integer extend (widen) — unsigned
   218  # uint8 -> uint16
   219  - go: ExtendLo8ToUint16
   220    asm: "VUXTL"
   221    hiHalfAsm: "VUXTL2"
   222    in:
   223      - base: uint
   224        elemBits: 8
   225    out:
   226      - base: uint
   227        elemBits: 16
   228        bits: 128
   229  
   230  # uint16 -> uint32
   231  - go: ExtendLo4ToUint32
   232    asm: "VUXTL"
   233    hiHalfAsm: "VUXTL2"
   234    in:
   235      - base: uint
   236        elemBits: 16
   237    out:
   238      - base: uint
   239        elemBits: 32
   240        bits: 128
   241  
   242  # uint32 -> uint64
   243  - go: ExtendLo2ToUint64
   244    asm: "VUXTL"
   245    hiHalfAsm: "VUXTL2"
   246    in:
   247      - base: uint
   248        elemBits: 32
   249    out:
   250      - base: uint
   251        elemBits: 64
   252        bits: 128
   253  
   254  # Saturating narrow — signed (VSQXTN/VSQXTN2)
   255  - go: SaturateToInt8
   256    asm: "VSQXTN"
   257    hiHalfAsm: "VSQXTN2"
   258    in:
   259      - base: int
   260        elemBits: 16
   261    out:
   262      - base: int
   263        elemBits: 8
   264        bits: 128
   265  
   266  - go: SaturateToInt16
   267    asm: "VSQXTN"
   268    hiHalfAsm: "VSQXTN2"
   269    in:
   270      - base: int
   271        elemBits: 32
   272    out:
   273      - base: int
   274        elemBits: 16
   275        bits: 128
   276  
   277  - go: SaturateToInt32
   278    asm: "VSQXTN"
   279    hiHalfAsm: "VSQXTN2"
   280    in:
   281      - base: int
   282        elemBits: 64
   283    out:
   284      - base: int
   285        elemBits: 32
   286        bits: 128
   287  
   288  # Saturating narrow — signed to unsigned (VSQXTUN/VSQXTUN2)
   289  # ISA XML has int→int for SQXTUN; use OverwriteBase to correct output type
   290  - go: SaturateToUint8
   291    asm: "VSQXTUN"
   292    hiHalfAsm: "VSQXTUN2"
   293    in:
   294      - base: int
   295        elemBits: 16
   296    out:
   297      - base: int
   298        elemBits: 8
   299        bits: 128
   300        OverwriteBase: uint
   301  
   302  - go: SaturateToUint16
   303    asm: "VSQXTUN"
   304    hiHalfAsm: "VSQXTUN2"
   305    in:
   306      - base: int
   307        elemBits: 32
   308    out:
   309      - base: int
   310        elemBits: 16
   311        bits: 128
   312        OverwriteBase: uint
   313  
   314  - go: SaturateToUint32
   315    asm: "VSQXTUN"
   316    hiHalfAsm: "VSQXTUN2"
   317    in:
   318      - base: int
   319        elemBits: 64
   320    out:
   321      - base: int
   322        elemBits: 32
   323        bits: 128
   324        OverwriteBase: uint
   325  
   326  # Saturating narrow — unsigned (VUQXTN/VUQXTN2)
   327  - go: SaturateToUint8
   328    asm: "VUQXTN"
   329    hiHalfAsm: "VUQXTN2"
   330    in:
   331      - base: uint
   332        elemBits: 16
   333    out:
   334      - base: uint
   335        elemBits: 8
   336        bits: 128
   337  
   338  - go: SaturateToUint16
   339    asm: "VUQXTN"
   340    hiHalfAsm: "VUQXTN2"
   341    in:
   342      - base: uint
   343        elemBits: 32
   344    out:
   345      - base: uint
   346        elemBits: 16
   347        bits: 128
   348  
   349  - go: SaturateToUint32
   350    asm: "VUQXTN"
   351    hiHalfAsm: "VUQXTN2"
   352    in:
   353      - base: uint
   354        elemBits: 64
   355    out:
   356      - base: uint
   357        elemBits: 32
   358        bits: 128
   359  

View as plain text