CCTLib
Calling-context and data-object attribution library for Intel Pin
redspy_immediate_tp.c
Go to the documentation of this file.
1
// redspy ISA test: repeatedly write the SAME 32-bit immediate to the same
2
// dword. The second store is redundant (same value already at address).
3
// Exercises immediate-operand instrumentation.
4
#include <stdint.h>
5
#define WORK_COUNT 20000
6
static
volatile
uint64_t
sink
;
7
static
uint32_t
buf
[
WORK_COUNT
];
8
int
main
(
int
argc,
char
** argv) {
9
(void)argc; (void)argv;
10
for
(
int
i = 0; i <
WORK_COUNT
; ++i) {
11
__asm__ __volatile__(
12
"movl $0xC0FFEE, (%0)\n\t"
13
"movl $0xC0FFEE, (%0)\n\t"
// same immediate -- redundant
14
:
15
:
"r"
(&
buf
[i])
16
:
"memory"
);
17
}
18
sink
=
buf
[0];
19
return
0;
20
}
buf
static uint32_t buf[WORK_COUNT]
Definition:
redspy_immediate_tp.c:7
WORK_COUNT
#define WORK_COUNT
Definition:
redspy_immediate_tp.c:5
main
int main(int argc, char **argv)
Definition:
redspy_immediate_tp.c:8
sink
static volatile uint64_t sink
Definition:
redspy_immediate_tp.c:6
tests
gtest
apps
isa
redspy_immediate_tp.c
Generated on Wed Jul 15 2026 04:51:30 for CCTLib by
1.9.1