[libre-riscv-dev] [Bug 44] IEEE754 FPU inverse-sqrt

bugzilla-daemon at libre-riscv.org bugzilla-daemon at libre-riscv.org
Sat May 11 10:22:14 BST 2019


http://bugs.libre-riscv.org/show_bug.cgi?id=44

--- Comment #14 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
looking at the diagram from ep08-21.pdf on page 36 (figure 3.15)

* q[j+1] in radix 2 is a 2-bit signed binary number, -1 0 or +1
  (top of p35), in binary -1 = 0b10, 0 = 0b00, 1 = 0b01

* |q[j+1]| probably means "absolute value" of q[j+1], in other words
  when q[j+1] == 0b00, return 0b00, and when q[j+1] == 0b10 (-1),
  return 0b10 (+1).

* r is the "radix", confirmed (inferred) from the top paragraph of page 33

* the key equations to produce Q(next) and QM(next) are given in
  (3.21) and (3.22):

  if q[j+1] >= 0:
      Q(next) = Q << 1 | q[j+1]
  else:
      Q(next) = QM << 1 | (2-abs(q[j+1]))
  if q[j+1] > 0:
      QM(next) = QM << 1 | (q[j+1]-1)
  else:
      QM(next) = Q << 1 | (1-abs(q[j+1]))

those sums, "q[j+1]-1" "2-abs(q[j+1])" and "1-abs(q[j+1])" are in 2-bit
signed binary, so should be trivial to produce logic for.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-riscv-dev mailing list