Skip to content
Snippets Groups Projects

BFieldCache Change the code so as to emit more clang like assembly for gcc

Merged Christos Anastopoulos requested to merge ATLAS-EGamma/athena:inside_ala_Clang_gcc into master
1 file
+ 6
2
Compare changes
  • Side-by-side
  • Inline
@@ -57,7 +57,11 @@ BFieldCache::inside(double z, double r, double phi) const
if (phi < m_phimin) {
phi += 2.0 * M_PI;
}
return (z <= m_zmax && z >= m_zmin && r <= m_rmax && r >= m_rmin &&
phi <= m_phimax && phi >= m_phimin);
// clang emits code that is more similar to using the "bit AND"
// rather than "logical AND" for this kind of check.
// Basically get rid of jmp instructions with calculating
// a bit more
return ((z <= m_zmax) & (z >= m_zmin) & (r <= m_rmax) & (r >= m_rmin) &
(phi <= m_phimax) & (phi >= m_phimin));
}
Loading