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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_1_x/] [or1ksim/] [cpu/] [or32/] [insnset.c] - Diff between revs 713 and 720

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

Rev 713 Rev 720
Line 471... Line 471...
}
}
INSTRUCTION (l_cmov) {
INSTRUCTION (l_cmov) {
  IFF (config.cpu.dependstats) current->func_unit = it_move;
  IFF (config.cpu.dependstats) current->func_unit = it_move;
  set_operand32(0, flag ? eval_operand32(1, &breakpoint) : eval_operand32(2, &breakpoint), &breakpoint);
  set_operand32(0, flag ? eval_operand32(1, &breakpoint) : eval_operand32(2, &breakpoint), &breakpoint);
}
}
 
/******* Floating point instructions *******/
 
/* Single precision */
 
INSTRUCTION (lf_add_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  freg[get_operand(0)] = (machword)((float)freg[get_operand(1)] + (float)freg[get_operand(2)]);
 
}
 
INSTRUCTION (lf_div_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  freg[get_operand(0)] = (machword)((float)freg[get_operand(1)] / (float)freg[get_operand(2)]);
 
}
 
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) {
 
  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)]);
 
}
 
INSTRUCTION (lf_mul_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  freg[get_operand(0)] = (machword)((float)freg[get_operand(1)] * (float)freg[get_operand(2)]);
 
}
 
INSTRUCTION (lf_rem_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  freg[get_operand(0)] = (machword)(
 
    (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) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  flag = (float)freg[get_operand(0)] == (float)freg[get_operand(1)];
 
  setsprbits(SPR_SR, SPR_SR_F, flag);
 
}
 
INSTRUCTION (lf_sfge_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  flag = (float)freg[get_operand(0)] >= (float)freg[get_operand(1)];
 
  setsprbits(SPR_SR, SPR_SR_F, flag);
 
}
 
INSTRUCTION (lf_sfgt_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  flag = (float)freg[get_operand(0)] > (float)freg[get_operand(1)];
 
  setsprbits(SPR_SR, SPR_SR_F, flag);
 
}
 
INSTRUCTION (lf_sfle_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  flag = (float)freg[get_operand(0)] <= (float)freg[get_operand(1)];
 
  setsprbits(SPR_SR, SPR_SR_F, flag);
 
}
 
INSTRUCTION (lf_sflt_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  flag = (float)freg[get_operand(0)] < (float)freg[get_operand(1)];
 
  setsprbits(SPR_SR, SPR_SR_F, flag);
 
}
 
INSTRUCTION (lf_sfne_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  flag = (float)freg[get_operand(0)] != (float)freg[get_operand(1)];
 
  setsprbits(SPR_SR, SPR_SR_F, flag);
 
}
 
INSTRUCTION (lf_sub_s) {
 
  IFF (config.cpu.dependstats) current->func_unit = it_float;
 
  freg[get_operand(0)] = (machword)((float)freg[get_operand(1)] - (float)freg[get_operand(2)]);
 
}
 
 
 
/******* Custom instructions *******/
INSTRUCTION (l_cust1) {
INSTRUCTION (l_cust1) {
  /*int destr = current->insn >> 21;
  /*int destr = current->insn >> 21;
    int src1r = current->insn >> 15;
    int src1r = current->insn >> 15;
    int src2r = current->insn >> 9;*/
    int src2r = current->insn >> 9;*/
}
}

powered by: WebSVN 2.1.0

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