Bug 122 - FP software emulation needed,
Summary: FP software emulation needed,
Status: RESOLVED FIXED
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: ALU (including IEEE754 16/32/64-bit FPU) (show other bugs)
Version: unspecified
Hardware: Other Linux
: --- enhancement
Assignee: Luke Kenneth Casson Leighton
URL:
Depends on: 145 146
Blocks: 48
  Show dependency treegraph
 
Reported: 2019-07-28 22:09 BST by Luke Kenneth Casson Leighton
Modified: 2022-07-17 14:15 BST (History)
2 users (show)

See Also:
NLnet milestone: NLnet.2019.02.012
total budget (EUR) for completion of task and all subtasks: 1050
budget (EUR) for this task, excluding subtasks' budget: 0
parent task for budget allocation: 48
child tasks for budget allocation: 145 146
The table of payments (in EUR) for this task; TOML format:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Kenneth Casson Leighton 2019-07-28 22:09:54 BST
FP soft emulation needed that is RISCV compliant and includes RSQRT.
softfloat-3 does not include RSQRT.
FP64 RSQRT cannot be tested, FP16/32 can be however is not guaranteed accurate.
Comment 1 Jacob Lifshay 2019-07-28 23:20:32 BST
WIP algebraic numbers library at https://salsa.debian.org/Kazan-team/algebraics

-- represents values exactly
-- makes writing correctly rounded operations simple (as long as the operations don't produce transcendental numbers)
-- has a quadratic number type that works for implementing add, sub, mul, div, sqrt, rsqrt, fma
-- meant for testing since it's probably rather slow; still faster than python would be
-- will be writing python bindings using https://pyo3.rs/v0.7.0/ which makes writing bindings almost trivial
Comment 2 Jacob Lifshay 2019-07-30 16:16:58 BST
implemented comparison between quadratic numbers, working on addition.

My brain is fried for the day, had to derive quadratic_less_than:
https://salsa.debian.org/Kazan-team/algebraics/blob/190761b189d62870ffdb83639a9ff6ccae72f262/src/quadratic_numbers.rs#L602
Comment 3 Jacob Lifshay 2019-07-31 21:04:44 BST
(In reply to Jacob Lifshay from comment #2)
> implemented comparison between quadratic numbers, working on addition.
> 
> My brain is fried for the day, had to derive quadratic_less_than:
> https://salsa.debian.org/Kazan-team/algebraics/blob/
> 190761b189d62870ffdb83639a9ff6ccae72f262/src/quadratic_numbers.rs#L602

quadratic_less_than implements comparing two non-equal irrational quadratic numbers:
it returns lhs < rhs by using exact BigInt arithmetic and without using sqrt.

the full general less/equal/greater comparison is implemented in "impl Ord for RealQuadraticNumber"