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

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [example/] [floating_point_test/] [neorv32_zfinx_extension_intrinsics.h] - Diff between revs 56 and 63

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

Rev 56 Rev 63
Line 180... Line 180...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fadd.s a0, a0, a1
  // fadd.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b0000000, a1, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b0000000, a1, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 211... Line 208...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fsub.s a0, a0, a1
  // fsub.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b0000100, a1, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b0000100, a1, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 242... Line 236...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fmul.s a0, a0, a1
  // fmul.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b0001000, a1, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b0001000, a1, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 273... Line 264...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fmin.s a0, a0, a1
  // fmin.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b0010100, a1, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b0010100, a1, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 304... Line 292...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fmax.s a0, a0, a1
  // fmax.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b0010100, a1, a0, 0b001, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b0010100, a1, a0, 0b001, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 332... Line 317...
 
 
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], x0" : : [input_i] "r" (tmp_a));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a));
 
 
  // fcvt.wu.s a0, a0
  // fcvt.wu.s a0, a0
  CUSTOM_INSTR_R2_TYPE(0b1100000, x1, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b1100000, x1, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  return result;
  return result;
}
}
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
Line 359... Line 341...
 
 
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], x0" : : [input_i] "r" (tmp_a));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a));
 
 
  // fcvt.w.s a0, a0
  // fcvt.w.s a0, a0
  CUSTOM_INSTR_R2_TYPE(0b1100000, x0, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b1100000, x0, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  return (int32_t)result;
  return (int32_t)result;
}
}
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
Line 385... Line 364...
 
 
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = rs1;
  register uint32_t tmp_a  __asm__ ("a0") = rs1;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], x0" : : [input_i] "r" (tmp_a));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a));
 
 
  // fcvt.s.wu a0, a0
  // fcvt.s.wu a0, a0
  CUSTOM_INSTR_R2_TYPE(0b1101000, x1, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b1101000, x1, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 412... Line 388...
 
 
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = (uint32_t)rs1;
  register uint32_t tmp_a  __asm__ ("a0") = (uint32_t)rs1;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], x0" : : [input_i] "r" (tmp_a));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a));
 
 
  // fcvt.s.w a0, a0
  // fcvt.s.w a0, a0
  CUSTOM_INSTR_R2_TYPE(0b1101000, x0, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b1101000, x0, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 443... Line 416...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // feq.s a0, a0, a1
  // feq.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b1010000, a1, a0, 0b010, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b1010000, a1, a0, 0b010, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  return result;
  return result;
}
}
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
Line 473... Line 443...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // flt.s a0, a0, a1
  // flt.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b1010000, a1, a0, 0b001, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b1010000, a1, a0, 0b001, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  return result;
  return result;
}
}
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
Line 503... Line 470...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fle.s a0, a0, a1
  // fle.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b1010000, a1, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b1010000, a1, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  return result;
  return result;
}
}
 
 
 
 
/**********************************************************************//**
/**********************************************************************//**
Line 533... Line 497...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fsgnj.s a0, a0, a1
  // fsgnj.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b0010000, a1, a0, 0b000, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b0010000, a1, a0, 0b000, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 564... Line 525...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fsgnjn.s a0, a0, a1
  // fsgnjn.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b0010000, a1, a0, 0b001, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b0010000, a1, a0, 0b001, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 595... Line 553...
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
  register uint32_t tmp_b  __asm__ ("a1") = opb.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], %[input_j]" : : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a), [input_j] "r" (tmp_b));
 
 
  // fsgnjx.s a0, a0, a1
  // fsgnjx.s a0, a0, a1
  CUSTOM_INSTR_R2_TYPE(0b0010000, a1, a0, 0b010, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b0010000, a1, a0, 0b010, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  res.binary_value = result;
  res.binary_value = result;
  return res.float_value;
  return res.float_value;
}
}
 
 
 
 
Line 623... Line 578...
 
 
  register uint32_t result __asm__ ("a0");
  register uint32_t result __asm__ ("a0");
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
  register uint32_t tmp_a  __asm__ ("a0") = opa.binary_value;
 
 
  // dummy instruction to prevent GCC "constprop" optimization
  // dummy instruction to prevent GCC "constprop" optimization
  asm volatile ("add x0, %[input_i], x0" : : [input_i] "r" (tmp_a));
  asm volatile ("" : [output] "=r" (result) : [input_i] "r" (tmp_a));
 
 
  // fclass.s a0, a0
  // fclass.s a0, a0
  CUSTOM_INSTR_R2_TYPE(0b1110000, x0, a0, 0b001, a0, 0b1010011);
  CUSTOM_INSTR_R2_TYPE(0b1110000, x0, a0, 0b001, a0, 0b1010011);
 
 
  // dummy instruction to prevent GCC "constprop" optimization
 
  asm volatile ("add %[res], %[input], x0" : [res] "=r" (result) : [input] "r" (result) );
 
 
 
  return result;
  return result;
}
}
 
 
 
 
// ################################################################################################
// ################################################################################################

powered by: WebSVN 2.1.0

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