Changeset afaa70 in git
- Timestamp:
- Nov 10, 2017, 10:20:37 AM (6 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- d4659730f5d051bbee5937a7f2b59acecc3f7aa0
- Parents:
- 971a80779ac3cac292826e9392ea037d28a0ccd4
- git-author:
- Andreas Steenpass <steenpass@mathematik.uni-kl.de>2017-11-10 10:20:37+01:00
- git-committer:
- Andreas Steenpass <steenpass@mathematik.uni-kl.de>2017-12-15 12:17:08+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/syz4.cc
r971a80 rafaa70 16 16 17 17 #ifdef __GNUC__ 18 #define likely(X) (__builtin_expect( X, 1))19 #define unlikely(X) (__builtin_expect( X, 0))18 #define likely(X) (__builtin_expect(!!(X), 1)) 19 #define unlikely(X) (__builtin_expect(!!(X), 0)) 20 20 #else 21 21 #define likely(X) (X) … … 54 54 } 55 55 for (int j = R->N; j > 0; j--) { 56 if ( variables[j-1] && p_GetExp(m, j, R) > 0) {56 if (unlikely(variables[j-1] && p_GetExp(m, j, R) > 0)) { 57 57 return true; 58 58 } … … 88 88 const ring r = currRing; 89 89 lts_hash::const_iterator itr = hash_previous_module->find(p_GetComp(t, r)); 90 if ( itr == hash_previous_module->end()) {90 if (unlikely(itr == hash_previous_module->end())) { 91 91 return NULL; 92 92 } … … 98 98 const unsigned long q_not_sev = ~p_GetShortExpVector(q, r); 99 99 for( ; itr_curr != itr_end; ++itr_curr) { 100 if ( itr_curr->sev & q_not_sev100 if (likely(itr_curr->sev & q_not_sev) 101 101 || unlikely(!(_p_LmDivisibleByNoComp(itr_curr->lt, q, r)))) { 102 102 continue; … … 137 137 const poly t = traverse_tail(s, c, previous_module, variables, 138 138 hash_previous_module); 139 if ( t != NULL) {139 if (unlikely(t != NULL)) { 140 140 s = p_Add_q(s, t, r); 141 141 } … … 148 148 { 149 149 const poly tail = previous_module->m[comp]->next; 150 if ( tail == NULL|| !check_variables(variables, multiplier)) {150 if (unlikely(tail == NULL) || !check_variables(variables, multiplier)) { 151 151 return NULL; 152 152 } … … 213 213 const poly multiplier) 214 214 { 215 if (itr->second == NULL) {215 if (likely(itr->second == NULL)) { 216 216 return NULL; 217 217 } 218 218 const ring r = currRing; 219 219 poly p = p_Copy(itr->second, r); 220 if ( !n_Equal(pGetCoeff(multiplier), pGetCoeff(itr->first), r)) {220 if (likely(!n_Equal(pGetCoeff(multiplier), pGetCoeff(itr->first), r))) { 221 221 number n = n_Div(pGetCoeff(multiplier), pGetCoeff(itr->first), r); 222 222 p = p_Mult_nn(p, n, r); … … 232 232 cache_term *T = &(Cache[comp]); 233 233 cache_term::iterator itr = T->find(multiplier); 234 if ( itr != T->end()) {234 if (likely(itr != T->end())) { 235 235 return get_from_cache_term(itr, multiplier); 236 236 } … … 503 503 poly p = res[1]->m[i]; 504 504 while (p != NULL) { 505 if ( pGetComp(p) == comp) {505 if (unlikely(pGetComp(p) == comp)) { 506 506 n_InpMult(pGetCoeff(p), coef_inv, r->cf); 507 507 }
Note: See TracChangeset
for help on using the changeset viewer.