An assembly abstraction library for 16-bit and 32-bit POSIT instructions based on Xposit.
This library provides a base C library with assembly wrapper functions, and a C++ library with operator overloading.
SoftPosit is used for software-based conversion between posit and float. This allows C++ Posit type to accept float values in constructor, as well as casting Posit to float. Note that posit16 was adapted to use es=2 instead of es=1 from the original repo.
A modified version of llvm-xposit is used for full posit register support in LLVM. This allows LLVM to allocate registers automatically and efficiently. In case of hardware hazard, compile with -mavoid-pmv flag to replace pmv instructions with lw+sw at LLVM level. This workaround may not be needed for posit16.
To help investigate hardware hazard, libposit-autotester was created. The autotester is able to create reproducible randomized tests beyond the static hazard_test.cpp provided by this repository.