File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed
ares/component/processor/m68000 Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -338,28 +338,27 @@ template<u32 Size> auto M68000::instructionBTST(EffectiveAddress with) -> void {
338
338
}
339
339
340
340
auto M68000::instructionCHK (DataRegister compare, EffectiveAddress maximum) -> void {
341
- auto source = read<Word>(maximum);
342
- auto target = read<Word>(compare);
343
- auto result = (n64)target - source;
344
- r.c = sign<Word>(result >> 1 ) < 0 ;
345
- r.v = sign<Word>((target ^ source) & (target ^ result)) < 0 ;
346
- r.z = clip<Word>(result) == 0 ;
347
- r.n = sign<Word>(result) < 0 ;
348
- r.n ^= r.v ;
349
- prefetch ();
341
+ auto source = read<Word>(compare);
342
+ auto target = read<Word>(maximum);
343
+ CMP<Word>(source, target);
344
+ idle (2 );
345
+ bool bound = r.n || r.v ;
346
+ CMP<Word>(0 , source);
347
+ idle (2 );
350
348
351
- if (!r.n && !r.z ) {
349
+ if (bound) {
350
+ prefetched ();
352
351
return exception (Exception::BoundsCheck, Vector::BoundsCheck);
353
352
}
354
353
355
- r. z = clip<Word>(target) == 0 ;
356
- r. n = sign<Word>(target) < 0 ;
354
+ idle ( 2 ) ;
355
+
357
356
if (r.n ) {
358
- idle ( 2 );
357
+ prefetched ( );
359
358
return exception (Exception::BoundsCheck, Vector::BoundsCheck);
360
359
}
361
360
362
- idle ( 6 );
361
+ prefetch ( );
363
362
}
364
363
365
364
template <u32 Size> auto M68000::instructionCLR (EffectiveAddress with) -> void {
You can’t perform that action at this time.
0 commit comments