OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cpu/] [or32/] [insnset.c] - Diff between revs 720 and 722

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 720 Rev 722
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;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.