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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [cpu/] [or32/] [insnset.c] - Diff between revs 114 and 115

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

Rev 114 Rev 115
Line 609... Line 609...
  SET_PARAM0(cpu_state.sprs[SPR_SR] & SPR_SR_F ? PARAM1 : PARAM2);
  SET_PARAM0(cpu_state.sprs[SPR_SR] & SPR_SR_F ? PARAM1 : PARAM2);
}
}
INSTRUCTION (l_ff1) {
INSTRUCTION (l_ff1) {
  SET_PARAM0(ffs(PARAM1));
  SET_PARAM0(ffs(PARAM1));
}
}
 
INSTRUCTION (l_fl1) {
 
  orreg_t t = (orreg_t)PARAM1;
 
 
 
  /* Reverse the word and use ffs */
 
  t = (((t & 0xaaaaaaaa) >> 1) | ((t & 0x55555555) << 1));
 
  t = (((t & 0xcccccccc) >> 2) | ((t & 0x33333333) << 2));
 
  t = (((t & 0xf0f0f0f0) >> 4) | ((t & 0x0f0f0f0f) << 4));
 
  t = (((t & 0xff00ff00) >> 8) | ((t & 0x00ff00ff) << 8));
 
  t = ffs ((t >> 16) | (t << 16));
 
 
 
  SET_PARAM0 (0 == t ? t : 33 - t);
 
}
/******* Floating point instructions *******/
/******* Floating point instructions *******/
/* Single precision */
/* Single precision */
INSTRUCTION (lf_add_s) {
INSTRUCTION (lf_add_s) {
  if (config.cpu.hardfloat) {
  if (config.cpu.hardfloat) {
  FLOAT param0, param1, param2;
  FLOAT param0, param1, param2;

powered by: WebSVN 2.1.0

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