IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

x86 32-bits / 64-bits Assembleur Discussion :

Utiliser la cache L2


Sujet :

x86 32-bits / 64-bits Assembleur

  1. #1
    Membre éclairé

    Inscrit en
    Juin 2004
    Messages
    1 397
    Détails du profil
    Informations forums :
    Inscription : Juin 2004
    Messages : 1 397
    Points : 763
    Points
    763
    Par défaut Utiliser la cache L2
    Bonjour à tous et toutes !
    J'aimerais manipuler mes données à l'octet près, en passant par la cache L2, sans faire confiance à un compilateur, mais en forçant l'usage.
    Est-ce possible (je dirais oui) ?
    Si oui, comment ?

    Merci d'avance !
    Aucune réponse à une question technique par MP.
    Ce qui vous pose problème peut poser problème à un(e) autre

    http://thebrutace.labrute.fr

  2. #2
    Membre confirmé
    Homme Profil pro
    Développeur de jeux vidéo
    Inscrit en
    Mars 2006
    Messages
    400
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Développeur de jeux vidéo

    Informations forums :
    Inscription : Mars 2006
    Messages : 400
    Points : 562
    Points
    562
    Par défaut
    Avec l'instruction PREFETCH, on peut contrôler le cache L2.

  3. #3
    Inactif
    Profil pro
    Inscrit en
    Avril 2006
    Messages
    130
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2006
    Messages : 130
    Points : 160
    Points
    160
    Par défaut pour infos
    PREFETCH
    Usage: PREFETCH src Modifies flags: None
    Loads a processor cache line into the data cache. The address of this line is specified by the mem8 value.
    Prefetch Data Into Caches
    PREFETCH mem8 ; 0F 0D /0 [PENT,3DNOW]
    PREFETCHW mem8 ; 0F 0D /1 [PENT,3DNOW]
    PREFETCH and PREFETCHW fetch the line of data from memory that contains the specified byte. PREFETCHW performs differently on the Athlon to earlier processors.
    For the AMD processor, the line size is 32 bytes. In all future processors, the size of the line that is loaded by the PREFETCH instruction will be at least 32-bytes. If a cache hit occurs (the line is already in the Dcache) or a memory fault is detected, no bus cycle is initiated and the instruction is treated as a NOP. For more details, see the 3DNow! Technology Manual.
    PREFETCHh
    Usage: PREFETCHh src Modifies flags: None
    Fetches the line of data from memory that contains the byte specified with the 'src' operand to a location in the cache hierarchy specified by a locality hint.
    Prefetch Data Into Caches
    PREFETCHNTA PREFETCHT0 PREFETCHT1 PREFETCHT2
    PREFETCHNTA m8 ; 0F 18 /0 [KATMAI]
    PREFETCHT0 m8 ; 0F 18 /1 [KATMAI]
    PREFETCHT1 m8 ; 0F 18 /2 [KATMAI]
    PREFETCHT2 m8 ; 0F 18 /3 [KATMAI]
    The PREFETCHh instructions fetch the line of data from memory that contains the specified byte. It is placed in the cache according to rules specified by locality hints :
    The hints are:
    (temporal data) - prefetch data into all levels of the cache hierarchy.
    T1 (temporal data with respect to first level cache) - prefetch data into level 2 cache and higher.
    T2 (temporal data with respect to second level cache) - prefetch data into level 2 cache and higher.
    NTA (non-temporal data with respect to all cache levels) - prefetch data into non-temporal cache structure and into a location close to the processor, minimizing cache pollution.
    This instruction is merely a hint and does not affect program behavior. If executed, this instruction moves data closer to the processor in anticipation of future use. The implementation of prefetch locality hints is implementation - dependent, and can be over-loaded or ignored by a processor implementation. The amount of data prefetched is also processor implementation-dependent. It will, however, be a minimum of 32 bytes.
    Note that this group of instructions doesn't provide a guarantee that the data will be in the cache when it is needed. For more details, see the Intel IA32 Software Developer Manual, Volume 2.

    @+

Discussions similaires

  1. Réponses: 1
    Dernier message: 29/06/2011, 17h45
  2. Firefox et la non utilisation du cache pour des images
    Par xtremdisc dans le forum Général JavaScript
    Réponses: 10
    Dernier message: 10/12/2009, 00h05
  3. Utilisation du cache et restriction
    Par Jinroh77 dans le forum SSAS
    Réponses: 2
    Dernier message: 06/10/2009, 13h53
  4. Ne pas utiliser le cache avec open
    Par coockie_jr dans le forum C++
    Réponses: 6
    Dernier message: 30/05/2008, 17h51
  5. Comment utiliser un cache ?
    Par TOM-Z dans le forum XMLRAD
    Réponses: 4
    Dernier message: 14/03/2003, 09h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo