Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  sve_helpers.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 2024 ARM Limited
 *
 * Common helper functions for SVE and SME functionality.
 */


#include <stdbool.h>
#include <kselftest.h>
#include <asm/sigcontext.h>
#include <sys/prctl.h>

unsigned int vls[SVE_VQ_MAX];
unsigned int nvls;

int sve_fill_vls(bool use_sme, int min_vls)
{
 int vq, vl;
 int pr_set_vl = use_sme ? PR_SME_SET_VL : PR_SVE_SET_VL;
 int len_mask = use_sme ? PR_SME_VL_LEN_MASK : PR_SVE_VL_LEN_MASK;

 /*
 * Enumerate up to SVE_VQ_MAX vector lengths
 */

 for (vq = SVE_VQ_MAX; vq > 0; --vq) {
  vl = prctl(pr_set_vl, vq * 16);
  if (vl == -1)
   return KSFT_FAIL;

  vl &= len_mask;

  /*
 * Unlike SVE, SME does not require the minimum vector length
 * to be implemented, or the VLs to be consecutive, so any call
 * to the prctl might return the single implemented VL, which
 * might be larger than 16. So to avoid this loop never
 * terminating,  bail out here when we find a higher VL than
 * we asked for.
 * See the ARM ARM, DDI 0487K.a, B1.4.2: I_QQRNR and I_NWYBP.
 */

  if (vq < sve_vq_from_vl(vl))
   break;

  /* Skip missing VLs */
  vq = sve_vq_from_vl(vl);

  vls[nvls++] = vl;
 }

 if (nvls < min_vls) {
  fprintf(stderr, "Only %d VL supported\n", nvls);
  return KSFT_SKIP;
 }

 return KSFT_PASS;
}

Messung V0.5
C=96 H=85 G=90

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge