@@ -492,7 +492,7 @@ void dppc_interpreter::power_sraiq(uint32_t opcode) {
492
492
ppc_grab_regssash (opcode);
493
493
uint32_t mask = (1U << rot_sh) - 1 ;
494
494
ppc_result_a = (int32_t )ppc_result_d >> rot_sh;
495
- ppc_state.spr [SPR::MQ] = rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d ;
495
+ ppc_state.spr [SPR::MQ] = ROTR_32 ( ppc_result_d, rot_sh);
496
496
497
497
if ((int32_t (ppc_result_d) < 0 ) && (ppc_result_d & mask)) {
498
498
ppc_state.spr [SPR::XER] |= XER::CA;
@@ -523,7 +523,7 @@ void dppc_interpreter::power_sraq(uint32_t opcode) {
523
523
ppc_state.spr [SPR::XER] &= ~XER::CA;
524
524
}
525
525
526
- ppc_state.spr [SPR::MQ] = rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d ;
526
+ ppc_state.spr [SPR::MQ] = ROTR_32 ( ppc_result_d, rot_sh);
527
527
528
528
if (rec)
529
529
ppc_changecrf0 (ppc_result_a);
@@ -541,7 +541,7 @@ void dppc_interpreter::power_sre(uint32_t opcode) {
541
541
unsigned rot_sh = ppc_result_b & 0x1F ;
542
542
ppc_result_a = ppc_result_d >> rot_sh;
543
543
544
- ppc_state.spr [SPR::MQ] = rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d ;
544
+ ppc_state.spr [SPR::MQ] = ROTR_32 ( ppc_result_d, rot_sh);
545
545
546
546
if (rec)
547
547
ppc_changecrf0 (ppc_result_a);
@@ -557,7 +557,7 @@ void dppc_interpreter::power_srea(uint32_t opcode) {
557
557
ppc_grab_regssab (opcode);
558
558
unsigned rot_sh = ppc_result_b & 0x1F ;
559
559
ppc_result_a = (int32_t )ppc_result_d >> rot_sh;
560
- uint32_t r = (rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d );
560
+ uint32_t r = ROTR_32 ( ppc_result_d, rot_sh);
561
561
uint32_t mask = -1U >> rot_sh;
562
562
563
563
if ((int32_t (ppc_result_d) < 0 ) && (r & ~mask)) {
@@ -583,7 +583,7 @@ void dppc_interpreter::power_sreq(uint32_t opcode) {
583
583
uint32_t mask = -1U >> rot_sh;
584
584
585
585
ppc_result_a = (ppc_result_d >> rot_sh) | (ppc_state.spr [SPR::MQ] & ~mask);
586
- ppc_state.spr [SPR::MQ] = rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d ;
586
+ ppc_state.spr [SPR::MQ] = ROTR_32 ( ppc_result_d, rot_sh);
587
587
588
588
if (rec)
589
589
ppc_changecrf0 (ppc_result_a);
@@ -598,7 +598,7 @@ template <field_rc rec>
598
598
void dppc_interpreter::power_sriq (uint32_t opcode) {
599
599
ppc_grab_regssash (opcode);
600
600
ppc_result_a = ppc_result_d >> rot_sh;
601
- ppc_state.spr [SPR::MQ] = rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d ;
601
+ ppc_state.spr [SPR::MQ] = ROTR_32 ( ppc_result_d, rot_sh);
602
602
603
603
if (rec)
604
604
ppc_changecrf0 (ppc_result_a);
@@ -612,7 +612,7 @@ template void dppc_interpreter::power_sriq<RC1>(uint32_t opcode);
612
612
template <field_rc rec>
613
613
void dppc_interpreter::power_srliq (uint32_t opcode) {
614
614
ppc_grab_regssash (opcode);
615
- uint32_t r = rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d ;
615
+ uint32_t r = ROTR_32 ( ppc_result_d, rot_sh);
616
616
unsigned mask = power_rot_mask (rot_sh, 31 );
617
617
618
618
ppc_result_a = ((r & mask) | (ppc_state.spr [SPR::MQ] & ~mask));
@@ -631,7 +631,7 @@ template <field_rc rec>
631
631
void dppc_interpreter::power_srlq (uint32_t opcode) {
632
632
ppc_grab_regssab (opcode);
633
633
unsigned rot_sh = ppc_result_b & 0x1F ;
634
- uint32_t r = rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d ;
634
+ uint32_t r = ROTR_32 ( ppc_result_d, rot_sh);
635
635
unsigned mask = power_rot_mask (rot_sh, 31 );
636
636
637
637
if (ppc_result_b & 0x20 ) {
@@ -660,7 +660,7 @@ void dppc_interpreter::power_srq(uint32_t opcode) {
660
660
ppc_result_a = ppc_result_d >> rot_sh;
661
661
}
662
662
663
- ppc_state.spr [SPR::MQ] = rot_sh ? (( ppc_result_d >> rot_sh) | (ppc_result_d << ( 32 - rot_sh))) : ppc_result_d ;
663
+ ppc_state.spr [SPR::MQ] = ROTR_32 ( ppc_result_d, rot_sh);
664
664
665
665
if (rec)
666
666
ppc_changecrf0 (ppc_result_a);
0 commit comments