ETISS 0.8.0
Extendable Translating Instruction Set Simulator (version 0.8.0)
Macros | Functions
lwpintrin.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __DEFAULT_FN_ATTRS   __attribute__((__always_inline__, __nodebug__, __target__("lwp")))
 
#define __lwpins32(DATA2, DATA1, FLAGS)
 Inserts programmed event record into the LWP event ring buffer and advances the ring buffer pointer. More...
 
#define __lwpval32(DATA2, DATA1, FLAGS)
 Decrements the LWP programmed value sample event counter. More...
 

Functions

static __inline__ void __DEFAULT_FN_ATTRS __llwpcb (void *__addr)
 Parses the LWPCB at the specified address and enables profiling if valid. More...
 
static __inline__ void *__DEFAULT_FN_ATTRS __slwpcb (void)
 Flushes the LWP state to memory and returns the address of the LWPCB. More...
 

Macro Definition Documentation

◆ __DEFAULT_FN_ATTRS

#define __DEFAULT_FN_ATTRS   __attribute__((__always_inline__, __nodebug__, __target__("lwp")))

Definition at line 18 of file lwpintrin.h.

◆ __lwpins32

#define __lwpins32 (   DATA2,
  DATA1,
  FLAGS 
)
Value:
(__builtin_ia32_lwpins32((unsigned int) (DATA2), (unsigned int) (DATA1), \
(unsigned int) (FLAGS)))

Inserts programmed event record into the LWP event ring buffer and advances the ring buffer pointer.

This intrinsic corresponds to the LWPINS instruction.

Parameters
DATA2A 32-bit value is zero-extended and inserted into the 64-bit Data2 field.
DATA1A 32-bit value is inserted into the 32-bit Data1 field.
FLAGSA 32-bit immediate value is inserted into the 32-bit Flags field.
Returns
If the ring buffer is full and LWP is running in Synchronized Mode, the event record overwrites the last record in the buffer, the MissedEvents counter in the LWPCB is incremented, the head pointer is not advanced, and 1 is returned. Otherwise 0 is returned.

Definition at line 69 of file lwpintrin.h.

◆ __lwpval32

#define __lwpval32 (   DATA2,
  DATA1,
  FLAGS 
)
Value:
(__builtin_ia32_lwpval32((unsigned int) (DATA2), (unsigned int) (DATA1), \
(unsigned int) (FLAGS)))

Decrements the LWP programmed value sample event counter.

If the result is negative, inserts an event record into the LWP event ring buffer in memory and advances the ring buffer pointer.

This intrinsic corresponds to the LWPVAL instruction.

Parameters
DATA2A 32-bit value is zero-extended and inserted into the 64-bit Data2 field.
DATA1A 32-bit value is inserted into the 32-bit Data1 field.
FLAGSA 32-bit immediate value is inserted into the 32-bit Flags field.

Definition at line 87 of file lwpintrin.h.

Function Documentation

◆ __llwpcb()

static __inline__ void __DEFAULT_FN_ATTRS __llwpcb ( void *  __addr)
static

Parses the LWPCB at the specified address and enables profiling if valid.

This intrinsic corresponds to the LLWPCB instruction.

Parameters
__addrAddress to the new Lightweight Profiling Control Block (LWPCB). If the LWPCB is valid, writes the address into the LWP_CBADDR MSR and enables Lightweight Profiling.

Definition at line 32 of file lwpintrin.h.

◆ __slwpcb()

static __inline__ void* __DEFAULT_FN_ATTRS __slwpcb ( void  )
static

Flushes the LWP state to memory and returns the address of the LWPCB.

This intrinsic corresponds to the SLWPCB instruction.

Returns
Address to the current Lightweight Profiling Control Block (LWPCB). If LWP is not currently enabled, returns NULL.

Definition at line 47 of file lwpintrin.h.