Line 475... |
Line 475... |
}
|
}
|
/******* Floating point instructions *******/
|
/******* Floating point instructions *******/
|
/* Single precision */
|
/* Single precision */
|
INSTRUCTION (lf_add_s) {
|
INSTRUCTION (lf_add_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
freg[get_operand(0)] = (machword)((float)freg[get_operand(1)] + (float)freg[get_operand(2)]);
|
set_operand32(0, (machword)((float)eval_operand32(1, &breakpoint) + (float)eval_operand32(2, &breakpoint)), &breakpoint);
|
}
|
}
|
INSTRUCTION (lf_div_s) {
|
INSTRUCTION (lf_div_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
freg[get_operand(0)] = (machword)((float)freg[get_operand(1)] / (float)freg[get_operand(2)]);
|
set_operand32(0, (machword)((float)eval_operand32(1, &breakpoint) / (float)eval_operand32(2, &breakpoint)), &breakpoint);
|
}
|
|
INSTRUCTION (lf_ftoi_s) {
|
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
|
set_operand32(0, freg[get_operand(1)], &breakpoint);
|
|
}
|
|
INSTRUCTION (lf_itof_s) {
|
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
|
freg[get_operand(0)] = eval_operand32(1, &breakpoint);
|
|
}
|
}
|
|
/*INSTRUCTION (lf_ftoi_s) {
|
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
|
set_operand32(0, freg[get_operand(1)], &breakpoint);
|
|
}
|
|
INSTRUCTION (lf_itof_s) {
|
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
|
freg[get_operand(0)] = eval_operand32(1, &breakpoint);
|
|
}*/
|
INSTRUCTION (lf_madd_s) {
|
INSTRUCTION (lf_madd_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
freg[get_operand(0)] = (machword)((float)freg[get_operand(0)] + (float)freg[get_operand(1)] * (float)freg[get_operand(2)]);
|
set_operand32(0, (machword)((float)eval_operand32(0, &breakpoint) + (float)eval_operand32(1, &breakpoint) * (float)eval_operand32(2, &breakpoint)), &breakpoint);
|
}
|
}
|
INSTRUCTION (lf_mul_s) {
|
INSTRUCTION (lf_mul_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
freg[get_operand(0)] = (machword)((float)freg[get_operand(1)] * (float)freg[get_operand(2)]);
|
set_operand32(0, (machword)((float)eval_operand32(1, &breakpoint) * (float)eval_operand32(2, &breakpoint)), &breakpoint);
|
}
|
}
|
INSTRUCTION (lf_rem_s) {
|
INSTRUCTION (lf_rem_s) {
|
|
float temp = (float)eval_operand32(1, &breakpoint) / (float)eval_operand32(2, &breakpoint);
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
freg[get_operand(0)] = (machword)(
|
set_operand32(0, temp - (machword)temp, &breakpoint);
|
(float)freg[get_operand(1)] / (float)freg[get_operand(2)]
|
|
- (int)(float)freg[get_operand(1)] / (int)(float)freg[get_operand(2)]);
|
|
}
|
}
|
INSTRUCTION (lf_sfeq_s) {
|
INSTRUCTION (lf_sfeq_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
flag = (float)freg[get_operand(0)] == (float)freg[get_operand(1)];
|
flag = (float)eval_operand32(0, &breakpoint) == (float)eval_operand32(1, &breakpoint);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
}
|
}
|
INSTRUCTION (lf_sfge_s) {
|
INSTRUCTION (lf_sfge_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
flag = (float)freg[get_operand(0)] >= (float)freg[get_operand(1)];
|
flag = (float)eval_operand32(0, &breakpoint) >= (float)eval_operand32(1, &breakpoint);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
}
|
}
|
INSTRUCTION (lf_sfgt_s) {
|
INSTRUCTION (lf_sfgt_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
flag = (float)freg[get_operand(0)] > (float)freg[get_operand(1)];
|
flag = (float)eval_operand32(0, &breakpoint) > (float)eval_operand32(1, &breakpoint);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
}
|
}
|
INSTRUCTION (lf_sfle_s) {
|
INSTRUCTION (lf_sfle_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
flag = (float)freg[get_operand(0)] <= (float)freg[get_operand(1)];
|
flag = (float)eval_operand32(0, &breakpoint) <= (float)eval_operand32(1, &breakpoint);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
}
|
}
|
INSTRUCTION (lf_sflt_s) {
|
INSTRUCTION (lf_sflt_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
flag = (float)freg[get_operand(0)] < (float)freg[get_operand(1)];
|
flag = (float)eval_operand32(0, &breakpoint) < (float)eval_operand32(1, &breakpoint);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
}
|
}
|
INSTRUCTION (lf_sfne_s) {
|
INSTRUCTION (lf_sfne_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
flag = (float)freg[get_operand(0)] != (float)freg[get_operand(1)];
|
flag = (float)eval_operand32(0, &breakpoint) != (float)eval_operand32(1, &breakpoint);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
}
|
}
|
INSTRUCTION (lf_sub_s) {
|
INSTRUCTION (lf_sub_s) {
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
IFF (config.cpu.dependstats) current->func_unit = it_float;
|
freg[get_operand(0)] = (machword)((float)freg[get_operand(1)] - (float)freg[get_operand(2)]);
|
set_operand32(0, (machword)((float)eval_operand32(1, &breakpoint) - (float)eval_operand32(2, &breakpoint)), &breakpoint);
|
}
|
}
|
|
|
/******* Custom instructions *******/
|
/******* Custom instructions *******/
|
INSTRUCTION (l_cust1) {
|
INSTRUCTION (l_cust1) {
|
/*int destr = current->insn >> 21;
|
/*int destr = current->insn >> 21;
|