1.1 --- a/src/cpu/sparc/vm/assembler_sparc.hpp Mon Apr 14 20:56:48 2014 -0400 1.2 +++ b/src/cpu/sparc/vm/assembler_sparc.hpp Thu Apr 10 23:15:13 2014 -0700 1.3 @@ -630,11 +630,20 @@ 1.4 } 1.5 1.6 protected: 1.7 + // Insert a nop if the previous is cbcond 1.8 + void insert_nop_after_cbcond() { 1.9 + if (UseCBCond && cbcond_before()) { 1.10 + nop(); 1.11 + } 1.12 + } 1.13 // Delay slot helpers 1.14 // cti is called when emitting control-transfer instruction, 1.15 // BEFORE doing the emitting. 1.16 // Only effective when assertion-checking is enabled. 1.17 void cti() { 1.18 + // A cbcond instruction immediately followed by a CTI 1.19 + // instruction introduces pipeline stalls, we need to avoid that. 1.20 + no_cbcond_before(); 1.21 #ifdef CHECK_DELAY 1.22 assert_not_delayed("cti should not be in delay slot"); 1.23 #endif 1.24 @@ -658,7 +667,6 @@ 1.25 void no_cbcond_before() { 1.26 assert(offset() == 0 || !cbcond_before(), "cbcond should not follow an other cbcond"); 1.27 } 1.28 - 1.29 public: 1.30 1.31 bool use_cbcond(Label& L) {