fudian
fudian copied to clipboard
How to support fpdiv for bfloat16 format?
When using Fudian to generate the BFloat16 floating-point unit, the ADD, MUL, and FMA modules compile successfully. However, the DIV module compilation fails. The issue stems from lines 441-445 in FDIV.scala:
r3ws := wsReg(itn_len-1, itn_len-13)
r3wc := wcReg(itn_len-1, itn_len-13)
r2ws := wsReg(itn_len-1, itn_len-10)
r2wc := wcReg(itn_len-1, itn_len-10)
Specifically, the lo value becomes negative (lo < 0) in this section.
How can we add support for BFloat16 division? This capability is crucial for machine learning floating-point processing.