-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h
51 lines (37 loc) · 1.4 KB
/
utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef UTILS_H
#define UTILS_H
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
// //
// This file is distributed as part of the Championship Branch Prediction //
// workshop held in conjunction with ISCA'2014. Everyone is granted permission //
// to copy, modify, and/or re-distribute this software. //
// Please contact Moin Qureshi <[email protected]> if you have any questions //
// //
/////////////////////////////////////////////////////////////////////////////////
// --- DO NOT EDIT THIS FILE --- DO NOT EDIT THIS FILE --- DO NOT EDIT THIS FILE ---
// IMPORTANT NOTE: Changing anything in here will violate the competition rules.
#include <string>
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
#define UINT32 unsigned int
#define INT32 int
#define UINT64 unsigned long long
#define COUNTER unsigned long long
#define NOT_TAKEN 0
#define TAKEN 1
#define FAILURE 0
#define SUCCESS 1
static inline UINT32 SatIncrement(UINT32 x, UINT32 max)
{
if(x<max) return x+1;
return x;
}
static inline UINT32 SatDecrement(UINT32 x)
{
if(x>0) return x-1;
return x;
}
#endif