rdaly525 / coreir

BSD 3-Clause "New" or "Revised" License
98 stars 24 forks source link

Floating point support: CoreIR and simulator #727

Open jeffsetter opened 5 years ago

jeffsetter commented 5 years ago

Add support for all floating operators: add, mul, sub le, lt, ge, gt, neq, neq, neg, sqr, flr, ceil, abs, min, max div, rem log, exp, pow, sqrt sin, cos, tan, asin, acos, atan2, tanh

These are listed in order from most important to least important.

dillonhuff commented 5 years ago

Cool. I assume bfloat and 32 bit are sufficient for now?

jeffsetter commented 5 years ago

Yes. BFloat and Float32 would be sufficient.

jeffsetter commented 5 years ago

Btw, if you're interested in looking at the code that Halide uses to implement bfloat16, these two files that Andrew wrote are useful: https://github.com/StanfordAHA/Halide-to-Hardware/blob/master/src/Float16.cpp https://github.com/StanfordAHA/Halide-to-Hardware/blob/master/src/EmulateFloat16Math.cpp