@@ -19,24 +19,27 @@ constexpr uint8_t CACHE = 0x2;
19
19
constexpr uint8_t STATICALLY_COALESCE = 0x4 ;
20
20
constexpr uint8_t PREFETCH = 0x8 ;
21
21
22
- template <int32_t _N> struct burst_coalesce_impl {
23
- static constexpr int32_t value = _N;
24
- static constexpr int32_t default_value = 0 ;
22
+ struct burst_coalesce_impl_id ;
23
+ template <int32_t _N>
24
+ struct burst_coalesce_impl : std::integral_constant<int32_t , _N> {
25
+ using type_id = burst_coalesce_impl_id;
25
26
};
26
27
27
- template < int32_t _N> struct cache {
28
- static constexpr int32_t value = _N;
29
- static constexpr int32_t default_value = 0 ;
28
+ struct cache_id ;
29
+ template < int32_t _N> struct cache : std::integral_constant< int32_t , _N> {
30
+ using type_id = cache_id ;
30
31
};
31
32
32
- template <int32_t _N> struct prefetch_impl {
33
- static constexpr int32_t value = _N;
34
- static constexpr int32_t default_value = 0 ;
33
+ struct prefetch_impl_id ;
34
+ template <int32_t _N>
35
+ struct prefetch_impl : std::integral_constant<int32_t , _N> {
36
+ using type_id = prefetch_impl_id;
35
37
};
36
38
37
- template <int32_t _N> struct statically_coalesce_impl {
38
- static constexpr int32_t value = _N;
39
- static constexpr int32_t default_value = 1 ;
39
+ struct statically_coalesce_impl_id ;
40
+ template <int32_t _N>
41
+ struct statically_coalesce_impl : std::integral_constant<int32_t , _N> {
42
+ using type_id = statically_coalesce_impl_id;
40
43
};
41
44
42
45
template <bool _B> using burst_coalesce = burst_coalesce_impl<_B>;
@@ -77,21 +80,21 @@ template <class... _mem_access_params> class lsu final {
77
80
78
81
private:
79
82
static constexpr int32_t _burst_coalesce_val =
80
- _GetValue<burst_coalesce_impl, _mem_access_params...>::value;
83
+ _GetValue<burst_coalesce_impl< 0 > , _mem_access_params...>::value;
81
84
static constexpr uint8_t _burst_coalesce =
82
85
_burst_coalesce_val == 1 ? BURST_COALESCE : 0 ;
83
86
84
87
static constexpr int32_t _cache_val =
85
- _GetValue<cache, _mem_access_params...>::value;
88
+ _GetValue<cache< 0 > , _mem_access_params...>::value;
86
89
static constexpr uint8_t _cache = (_cache_val > 0 ) ? CACHE : 0 ;
87
90
88
91
static constexpr int32_t _statically_coalesce_val =
89
- _GetValue<statically_coalesce_impl, _mem_access_params...>::value;
92
+ _GetValue<statically_coalesce_impl< 1 > , _mem_access_params...>::value;
90
93
static constexpr uint8_t _dont_statically_coalesce =
91
94
_statically_coalesce_val == 0 ? STATICALLY_COALESCE : 0 ;
92
95
93
96
static constexpr int32_t _prefetch_val =
94
- _GetValue<prefetch_impl, _mem_access_params...>::value;
97
+ _GetValue<prefetch_impl< 0 > , _mem_access_params...>::value;
95
98
static constexpr uint8_t _prefetch = _prefetch_val ? PREFETCH : 0 ;
96
99
97
100
static_assert (_cache_val >= 0 , " cache size parameter must be non-negative" );
0 commit comments