@@ -174,15 +174,12 @@ RVOP(
174
174
if (!set_add (& pc_set , PC ))
175
175
has_loops = true;
176
176
if (cache_hot (rv -> block_cache , PC ))
177
- goto end_insn ;
177
+ goto end_op ;
178
178
#endif
179
179
last_pc = PC ;
180
180
MUST_TAIL return taken -> impl (rv , taken , cycle , PC );
181
181
}
182
- end_insn :
183
- rv -> csr_cycle = cycle ;
184
- rv -> PC = PC ;
185
- return true;
182
+ goto end_op ;
186
183
},
187
184
GEN ({
188
185
cond , rd ;
@@ -226,8 +223,8 @@ RVOP(
226
223
for (int i = 0; i < HISTORY_SIZE; i++) { \
227
224
if (ir->branch_table->PC[i] == PC) { \
228
225
ir->branch_table->times[i]++; \
229
- MUST_TAIL return block->ir_head->impl(rv, block->ir_head, \
230
- cycle, PC); \
226
+ if (cache_hot(rv->block_cache, PC)) \
227
+ goto end_op; \
231
228
} \
232
229
} \
233
230
/* update branch history table */ \
@@ -243,6 +240,8 @@ RVOP(
243
240
} \
244
241
ir -> branch_table -> times [min_idx ] = 1 ; \
245
242
ir -> branch_table -> PC [min_idx ] = PC ; \
243
+ if (cache_hot (rv -> block_cache , PC )) \
244
+ goto end_op ; \
246
245
MUST_TAIL return block -> ir_head -> impl (rv , block -> ir_head , cycle , PC ); \
247
246
}
248
247
#endif
@@ -268,9 +267,7 @@ RVOP(
268
267
RV_EXC_MISALIGN_HANDLER (pc , insn , false, 0 );
269
268
#endif
270
269
LOOKUP_OR_UPDATE_BRANCH_HISTORY_TABLE ();
271
- rv -> csr_cycle = cycle ;
272
- rv -> PC = PC ;
273
- return true;
270
+ goto end_op ;
274
271
},
275
272
GEN ({
276
273
cond , rd ;
@@ -324,15 +321,12 @@ RVOP(
324
321
if (!set_add (& pc_set , PC )) \
325
322
has_loops = true; \
326
323
if (cache_hot (rv -> block_cache , PC )) \
327
- goto end_insn ; \
324
+ goto end_op ; \
328
325
}, ); \
329
326
last_pc = PC ; \
330
327
MUST_TAIL return taken -> impl (rv , taken , cycle , PC ); \
331
328
} \
332
- end_insn : \
333
- rv -> csr_cycle = cycle ; \
334
- rv -> PC = PC ; \
335
- return true;
329
+ goto end_op ;
336
330
337
331
/* In RV32I and RV64I, if the branch is taken, set pc = pc + offset, where
338
332
* offset is a multiple of two; else do nothing. The offset is 13 bits long.
@@ -1956,15 +1950,12 @@ RVOP(
1956
1950
if (!set_add (& pc_set , PC ))
1957
1951
has_loops = true;
1958
1952
if (cache_hot (rv -> block_cache , PC ))
1959
- goto end_insn ;
1953
+ goto end_op ;
1960
1954
#endif
1961
1955
last_pc = PC ;
1962
1956
MUST_TAIL return taken -> impl (rv , taken , cycle , PC );
1963
1957
}
1964
- end_insn :
1965
- rv -> csr_cycle = cycle ;
1966
- rv -> PC = PC ;
1967
- return true;
1958
+ goto end_op ;
1968
1959
},
1969
1960
GEN ({
1970
1961
map , VR0 , rv_reg_ra ;
@@ -2120,15 +2111,12 @@ RVOP(
2120
2111
if (!set_add (& pc_set , PC ))
2121
2112
has_loops = true;
2122
2113
if (cache_hot (rv -> block_cache , PC ))
2123
- goto end_insn ;
2114
+ goto end_op ;
2124
2115
#endif
2125
2116
last_pc = PC ;
2126
2117
MUST_TAIL return taken -> impl (rv , taken , cycle , PC );
2127
2118
}
2128
- end_insn :
2129
- rv -> csr_cycle = cycle ;
2130
- rv -> PC = PC ;
2131
- return true;
2119
+ goto end_op ;
2132
2120
},
2133
2121
GEN ({
2134
2122
break ;
@@ -2171,15 +2159,12 @@ RVOP(
2171
2159
if (!set_add (& pc_set , PC ))
2172
2160
has_loops = true;
2173
2161
if (cache_hot (rv -> block_cache , PC ))
2174
- goto end_insn ;
2162
+ goto end_op ;
2175
2163
#endif
2176
2164
last_pc = PC ;
2177
2165
MUST_TAIL return taken -> impl (rv , taken , cycle , PC );
2178
2166
}
2179
- end_insn :
2180
- rv -> csr_cycle = cycle ;
2181
- rv -> PC = PC ;
2182
- return true;
2167
+ goto end_op ;
2183
2168
},
2184
2169
GEN ({
2185
2170
rald , VR0 , rs1 ;
@@ -2231,15 +2216,12 @@ RVOP(
2231
2216
if (!set_add (& pc_set , PC ))
2232
2217
has_loops = true;
2233
2218
if (cache_hot (rv -> block_cache , PC ))
2234
- goto end_insn ;
2219
+ goto end_op ;
2235
2220
#endif
2236
2221
last_pc = PC ;
2237
2222
MUST_TAIL return taken -> impl (rv , taken , cycle , PC );
2238
2223
}
2239
- end_insn :
2240
- rv -> csr_cycle = cycle ;
2241
- rv -> PC = PC ;
2242
- return true;
2224
+ goto end_op ;
2243
2225
},
2244
2226
GEN ({
2245
2227
rald , VR0 , rs1 ;
@@ -2297,9 +2279,7 @@ RVOP(
2297
2279
{
2298
2280
PC = rv -> X [ir -> rs1 ];
2299
2281
LOOKUP_OR_UPDATE_BRANCH_HISTORY_TABLE ();
2300
- rv -> csr_cycle = cycle ;
2301
- rv -> PC = PC ;
2302
- return true;
2282
+ goto end_op ;
2303
2283
},
2304
2284
GEN ({
2305
2285
rald , VR0 , rs1 ;
@@ -2349,9 +2329,7 @@ RVOP(
2349
2329
rv -> X [rv_reg_ra ] = PC + 2 ;
2350
2330
PC = jump_to ;
2351
2331
LOOKUP_OR_UPDATE_BRANCH_HISTORY_TABLE ();
2352
- rv -> csr_cycle = cycle ;
2353
- rv -> PC = PC ;
2354
- return true;
2332
+ goto end_op ;
2355
2333
},
2356
2334
GEN ({
2357
2335
map , VR0 , rv_reg_ra ;
0 commit comments