HPCToolkit
cct_addr.h
Go to the documentation of this file.
1 // -*-Mode: C++;-*- // technically C99
2 
3 // * BeginRiceCopyright *****************************************************
4 //
5 // $HeadURL$
6 // $Id$
7 //
8 // --------------------------------------------------------------------------
9 // Part of HPCToolkit (hpctoolkit.org)
10 //
11 // Information about sources of support for research and development of
12 // HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'.
13 // --------------------------------------------------------------------------
14 //
15 // Copyright ((c)) 2002-2019, Rice University
16 // All rights reserved.
17 //
18 // Redistribution and use in source and binary forms, with or without
19 // modification, are permitted provided that the following conditions are
20 // met:
21 //
22 // * Redistributions of source code must retain the above copyright
23 // notice, this list of conditions and the following disclaimer.
24 //
25 // * Redistributions in binary form must reproduce the above copyright
26 // notice, this list of conditions and the following disclaimer in the
27 // documentation and/or other materials provided with the distribution.
28 //
29 // * Neither the name of Rice University (RICE) nor the names of its
30 // contributors may be used to endorse or promote products derived from
31 // this software without specific prior written permission.
32 //
33 // This software is provided by RICE and contributors "as is" and any
34 // express or implied warranties, including, but not limited to, the
35 // implied warranties of merchantability and fitness for a particular
36 // purpose are disclaimed. In no event shall RICE or contributors be
37 // liable for any direct, indirect, incidental, special, exemplary, or
38 // consequential damages (including, but not limited to, procurement of
39 // substitute goods or services; loss of use, data, or profits; or
40 // business interruption) however caused and on any theory of liability,
41 // whether in contract, strict liability, or tort (including negligence
42 // or otherwise) arising in any way out of the use of this software, even
43 // if advised of the possibility of such damage.
44 //
45 // ******************************************************* EndRiceCopyright *
46 
47 #ifndef CCT_ADDR_H
48 #define CCT_ADDR_H
49 
50 #include <include/queue.h>
51 
54 
55 typedef struct cct_addr_t cct_addr_t;
56 
57 
58 struct cct_addr_t {
59 
61 
62  // physical instruction pointer: more accurately, this is an
63  // 'operation pointer'. The operation in the instruction packet is
64  // represented by adding 0, 1, or 2 to the instruction pointer for
65  // the first, second and third operation, respectively.
67 
68  // logical instruction pointer
70 
71 };
72 
73 //
74 // comparison operations, mainly for cct sibling splay operations
75 //
76 
77 static inline bool
78 cct_addr_eq(const cct_addr_t* a, const cct_addr_t* b)
79 {
80  return ( ip_normalized_eq(&(a->ip_norm), &(b->ip_norm)) &&
81  lush_lip_eq(a->lip, b->lip) &&
83 }
84 
85 static inline bool
86 cct_addr_lt(const cct_addr_t* a, const cct_addr_t* b)
87 {
88  if (ip_normalized_lt(&(a->ip_norm), &(b->ip_norm))) return true;
89  if (ip_normalized_gt(&(a->ip_norm), &(b->ip_norm))) return false;
90  if (lush_lip_lt(a->lip, b->lip)) return true;
91  if (lush_lip_gt(a->lip, b->lip)) return false;
92  if (lush_assoc_info_gt(a->as_info, b->as_info)) return false;
93  if (lush_assoc_info_lt(a->as_info, b->as_info)) return true;
94 
95  return false;
96 }
97 
98 static inline bool
99 cct_addr_gt(const cct_addr_t* a, const cct_addr_t* b)
100 {
101  return cct_addr_lt(b, a);
102 }
103 
104 #define assoc_info_NULL {.bits = 0}
105 
106 #define NON_LUSH_ADDR_INI(id, ip) {.as_info = assoc_info_NULL, .ip_norm = {.lm_id = id, .lm_ip = ip}, .lip = NULL}
107 
108 #endif // CCT_ADDR_H
static bool lush_assoc_info_eq(lush_assoc_info_t x, lush_assoc_info_t y)
Definition: lush-support.h:237
static bool lush_lip_lt(const lush_lip_t *x, const lush_lip_t *y)
Definition: lush-support.h:335
lush_lip_t * lip
Definition: cct_addr.h:69
static bool cct_addr_gt(const cct_addr_t *a, const cct_addr_t *b)
Definition: cct_addr.h:99
static bool lush_assoc_info_gt(lush_assoc_info_t x, lush_assoc_info_t y)
Definition: lush-support.h:252
static bool cct_addr_eq(const cct_addr_t *a, const cct_addr_t *b)
Definition: cct_addr.h:78
static bool ip_normalized_lt(const ip_normalized_t *a, const ip_normalized_t *b)
ip_normalized_t ip_norm
Definition: cct_addr.h:66
lush_assoc_info_t as_info
Definition: cct_addr.h:60
static bool ip_normalized_gt(const ip_normalized_t *a, const ip_normalized_t *b)
static bool lush_lip_eq(const lush_lip_t *x, const lush_lip_t *y)
Definition: lush-support.h:327
static bool ip_normalized_eq(const ip_normalized_t *a, const ip_normalized_t *b)
Definition: ip-normalized.h:94
static bool cct_addr_lt(const cct_addr_t *a, const cct_addr_t *b)
Definition: cct_addr.h:86
static bool lush_lip_gt(const lush_lip_t *x, const lush_lip_t *y)
Definition: lush-support.h:351
static bool lush_assoc_info_lt(lush_assoc_info_t x, lush_assoc_info_t y)
Definition: lush-support.h:243