Line 27... |
Line 27... |
temp1 = temp2 + temp3;
|
temp1 = temp2 + temp3;
|
SET_PARAM0(temp1);
|
SET_PARAM0(temp1);
|
set_ov_flag (temp1);
|
set_ov_flag (temp1);
|
if (ARITH_SET_FLAG) {
|
if (ARITH_SET_FLAG) {
|
flag = temp1 == 0;
|
flag = temp1 == 0;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
if ((uorreg_t) temp1 < (uorreg_t) temp2)
|
if ((uorreg_t) temp1 < (uorreg_t) temp2)
|
setsprbits(SPR_SR, SPR_SR_CY, 1);
|
cpu_state.sprs[SPR_SR] |= SPR_SR_CY;
|
else
|
else
|
setsprbits(SPR_SR, SPR_SR_CY, 0);
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_CY;
|
|
|
temp4 = temp1;
|
temp4 = temp1;
|
if (temp4 == temp1)
|
if (temp4 == temp1)
|
or1k_mstats.byteadd++;
|
or1k_mstats.byteadd++;
|
}
|
}
|
Line 44... |
Line 47... |
orreg_t temp1, temp2, temp3;
|
orreg_t temp1, temp2, temp3;
|
int8_t temp4;
|
int8_t temp4;
|
|
|
temp2 = (orreg_t)PARAM2;
|
temp2 = (orreg_t)PARAM2;
|
temp3 = (orreg_t)PARAM1;
|
temp3 = (orreg_t)PARAM1;
|
temp1 = temp2 + temp3 + getsprbits(SPR_SR, SPR_SR_CY);
|
temp1 = temp2 + temp3;
|
|
if(cpu_state.sprs[SPR_SR] & SPR_SR_CY)
|
|
temp1++;
|
SET_PARAM0(temp1);
|
SET_PARAM0(temp1);
|
set_ov_flag (temp1);
|
set_ov_flag (temp1);
|
if (ARITH_SET_FLAG) {
|
if (ARITH_SET_FLAG) {
|
flag = temp1 == 0;
|
flag = temp1 == 0;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
if ((uorreg_t) temp1 < (uorreg_t) temp2)
|
if ((uorreg_t) temp1 < (uorreg_t) temp2)
|
setsprbits(SPR_SR, SPR_SR_CY, 1);
|
cpu_state.sprs[SPR_SR] |= SPR_SR_CY;
|
else
|
else
|
setsprbits(SPR_SR, SPR_SR_CY, 0);
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_CY;
|
|
|
temp4 = temp1;
|
temp4 = temp1;
|
if (temp4 == temp1)
|
if (temp4 == temp1)
|
or1k_mstats.byteadd++;
|
or1k_mstats.byteadd++;
|
}
|
}
|
Line 140... |
Line 148... |
temp1 = PARAM1 & PARAM2;
|
temp1 = PARAM1 & PARAM2;
|
set_ov_flag (temp1);
|
set_ov_flag (temp1);
|
SET_PARAM0(temp1);
|
SET_PARAM0(temp1);
|
if (ARITH_SET_FLAG) {
|
if (ARITH_SET_FLAG) {
|
flag = temp1 == 0;
|
flag = temp1 == 0;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
}
|
}
|
INSTRUCTION (l_or) {
|
INSTRUCTION (l_or) {
|
uorreg_t temp1;
|
uorreg_t temp1;
|
temp1 = PARAM1 | PARAM2;
|
temp1 = PARAM1 | PARAM2;
|
Line 332... |
Line 343... |
break;
|
break;
|
}
|
}
|
}
|
}
|
INSTRUCTION (l_sfeq) {
|
INSTRUCTION (l_sfeq) {
|
flag = PARAM0 == PARAM1;
|
flag = PARAM0 == PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sfne) {
|
INSTRUCTION (l_sfne) {
|
flag = PARAM0 != PARAM1;
|
flag = PARAM0 != PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sfgts) {
|
INSTRUCTION (l_sfgts) {
|
flag = (orreg_t)PARAM0 > (orreg_t)PARAM1;
|
flag = (orreg_t)PARAM0 > (orreg_t)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sfges) {
|
INSTRUCTION (l_sfges) {
|
flag = (orreg_t)PARAM0 >= (orreg_t)PARAM1;
|
flag = (orreg_t)PARAM0 >= (orreg_t)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sflts) {
|
INSTRUCTION (l_sflts) {
|
flag = (orreg_t)PARAM0 < (orreg_t)PARAM1;
|
flag = (orreg_t)PARAM0 < (orreg_t)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sfles) {
|
INSTRUCTION (l_sfles) {
|
flag = (orreg_t)PARAM0 <= (orreg_t)PARAM1;
|
flag = (orreg_t)PARAM0 <= (orreg_t)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sfgtu) {
|
INSTRUCTION (l_sfgtu) {
|
flag = PARAM0 > PARAM1;
|
flag = PARAM0 > PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sfgeu) {
|
INSTRUCTION (l_sfgeu) {
|
flag = PARAM0 >= PARAM1;
|
flag = PARAM0 >= PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sfltu) {
|
INSTRUCTION (l_sfltu) {
|
flag = PARAM0 < PARAM1;
|
flag = PARAM0 < PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_sfleu) {
|
INSTRUCTION (l_sfleu) {
|
flag = PARAM0 <= PARAM1;
|
flag = PARAM0 <= PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (l_extbs) {
|
INSTRUCTION (l_extbs) {
|
int8_t x;
|
int8_t x;
|
x = PARAM1;
|
x = PARAM1;
|
SET_PARAM0((orreg_t)x);
|
SET_PARAM0((orreg_t)x);
|
Line 525... |
Line 566... |
float temp = (float)PARAM1 / (float)PARAM2;
|
float temp = (float)PARAM1 / (float)PARAM2;
|
SET_PARAM0(temp - (uint32_t)temp);
|
SET_PARAM0(temp - (uint32_t)temp);
|
}
|
}
|
INSTRUCTION (lf_sfeq_s) {
|
INSTRUCTION (lf_sfeq_s) {
|
flag = (float)PARAM0 == (float)PARAM1;
|
flag = (float)PARAM0 == (float)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (lf_sfge_s) {
|
INSTRUCTION (lf_sfge_s) {
|
flag = (float)PARAM0 >= (float)PARAM1;
|
flag = (float)PARAM0 >= (float)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (lf_sfgt_s) {
|
INSTRUCTION (lf_sfgt_s) {
|
flag = (float)PARAM0 > (float)PARAM1;
|
flag = (float)PARAM0 > (float)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (lf_sfle_s) {
|
INSTRUCTION (lf_sfle_s) {
|
flag = (float)PARAM0 <= (float)PARAM1;
|
flag = (float)PARAM0 <= (float)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (lf_sflt_s) {
|
INSTRUCTION (lf_sflt_s) {
|
flag = (float)PARAM0 < (float)PARAM1;
|
flag = (float)PARAM0 < (float)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (lf_sfne_s) {
|
INSTRUCTION (lf_sfne_s) {
|
flag = (float)PARAM0 != (float)PARAM1;
|
flag = (float)PARAM0 != (float)PARAM1;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
if(flag)
|
|
cpu_state.sprs[SPR_SR] |= SPR_SR_F;
|
|
else
|
|
cpu_state.sprs[SPR_SR] &= ~SPR_SR_F;
|
}
|
}
|
INSTRUCTION (lf_sub_s) {
|
INSTRUCTION (lf_sub_s) {
|
SET_PARAM0((float)PARAM1 - (float)PARAM2);
|
SET_PARAM0((float)PARAM1 - (float)PARAM2);
|
}
|
}
|
|
|