Text file src/simd/archsimd/_gen/fetch-arm64.sh

     1  #!/bin/bash
     2  
     3  # Copyright 2026 The Go Authors. All rights reserved.
     4  # Use of this source code is governed by a BSD-style
     5  # license that can be found in the LICENSE file.
     6  
     7  set -e
     8  
     9  TAR=ISA_A64_xml_A_profile-2026-03_96
    10  DIR=ISA_A64_xml_A_profile_2026-03_96-2026-03_rel
    11  DATA=./extern
    12  
    13  trace() {
    14      set -x
    15      "$@"
    16      { local rc=$?; set +x; } 2>/dev/null
    17      return $rc
    18  }
    19  
    20  if [[ -d "$DATA/$DIR" ]]; then
    21      echo 2>&1 "ISA description already downloaded"
    22  else
    23      tartmp=$(mktemp tmp.XXXXXXXXXX.tar.gz)
    24      trace curl -o "$tartmp" https://developer.arm.com/-/cdn-downloads/permalink/Exploration-Tools-A64-ISA/ISA_A64/$TAR.tar.gz
    25      # Check that it has the expected path
    26      want="$DIR/abs_advsimd.xml"
    27      if ! tar tzf "$tartmp" | grep -qxF "$want"; then
    28          echo 2>&1 "Archive $tartmp does not contain expected file $want"
    29          exit 1
    30      fi
    31      # This tar file has multiple top-level directories and files. We want just $DIR
    32      trace mkdir -p "$DATA"
    33      trace tar -xz -C "$DATA" -f "$tartmp" "$DIR"
    34      trace rm $tartmp
    35  fi
    36  

View as plain text