F16 - Fixedpoint Vector Library

Introduction

Till von Ahnen

Till von Ahnen

Experienced 3D programmer interested in challenging opportunities and out-of-the box solutions with strong graphics and low-level background who loves to visualize data in every way.


F16 - Fixedpoint Vector Library

Featured

F16 - Fixedpoint Vector Library

.

F16 is a Fixedpoint library developed for primary use on the Dingoo A320. It features most needed instructions to convert from/to F16 values, basic arithmetics and comparison functions. A full instruction list can be found at github.

I wrote it to implement a raymarcher on the Dingo A320 which is a small handheld gaming device capable of running Linux.

This standard viewcoordinate calculation

float px = ((float)x/XRES - 0.5f) * 2.f;
float py = ((float)y/YRES - 0.5f) * 2.f;

Would in F16 look like this:

F16 px = Div(i2f(x),i2f(XRES));
px = Sub(px,fl2f(0.5f));
px = Mul(px,fl2f(2.0f));

F16 py = Div(i2f(y),i2f(YRES));
py = Sub(py,fl2f(0.5f));
py = Mul(py,fl2f(2.0f));

Not the fanciest way but fast and withouth an FPU :)

Below you can see the Raymarcher implementation crosscompiled for a Dingoo-A320 which runs a ~330MHz MIPS processor without an FPU.

View Comments...