I was a programmer first, then a web developer, and I think it might give others like myself an advantage at times. In this day of WYSIWYG web page editors, templates, and content management systems (CMS), many web developers never get intimate with the actual HTML/XHTML code anymore. Sure, they might look in the code window from time to time, but many totally rely on their editor/CMS to take care of the details. That is, until things suddenly go wrong or they need to perform a site-wide change that cannot be easily implemented by altering the style sheet or the include files. It is times like these that don’t phase me, because I always have diff and search-and-replace tools at the ready. Read the rest of this entry »
I had not been following the status of the proposed C1x standard very closely, so I was surprised when I read on Dr. Dobb’s Journal that C11 had been completed late last year by ISO/IEC. Finally, as C compilers are updated to the new standard, C programmers will be able to make portable threaded programs without using an external library to support Unix-like systems and Windows. Of course, don’t hold your breath for Microsoft to fully support C11; they still don’t fully support C99!
So, how does this effect HawkThreads? I had been planning to deprecate the HawkThreads API because I felt that yet-another-thread-library was not in the best long-term interest of my projects. I had planned to just use Posix threads, and force Windows developers to use Pthreads-w32 (a very good implementation, but it requires an extra DLL), but I have other thoughts now. Read the rest of this entry »
If you have not already read part 1, do so now to set the stage. . .
A floating point number is composed of three parts: the sign bit, the exponent, and the mantissa (or significand). I will represent these as S, E, and M, respectively. The IEEE float is composed of a sign bit, 8 bits for exponent, and 23 bits for the mantissa (1S-8E-23M). The IEEE double float is 1S-11E- 52M, and the IEEE half float is 1S-5E-10M.
The Small Floating Point (SFP) format is 8E-1S-7M (note the order). It preserves the 8 bits of exponent from the IEEE float, and moves the sign bit next to the mantissa, thus creating a natural break along a byte boundary. Preserving the byte boundaries helps to reduce the number of masking and shifting operations in a software implementation. Read the rest of this entry »
3.141592653589793238462643383279502884197169399375105820974944592307816406286 208998628034825342117067982148086513282306647093844609550582231725359408128481 117450284102701938521105559644622948954930381964428810975665933446128475648233 Read the rest of this entry »
Hardware floating point is taken for granted by today’s programmers, but it has not always been so. I remember programming 80286/386 CPUs that did not have hardware floating point hardware, and back then the accepted alternative for many programs, especially games, was fixed point math. But fixed point math is HARD. It is hard for many programmers to understand, then it is hard to convert an entire code base from floating to fixed. So I have been looking at other ways to speed up software floating point code, hopefully enough so that many projects will not need to be converted to fixed point to run at a decent speed.
I am not going into a description of floating and fixed point math right now, so if you are not familiar with them you can read this floating point article and/or this fixed point article. For this post, I will begin by highlighting a few of the reasons software floating point math, specifically IEEE 754 conforming floating point, is so slow in software. Read the rest of this entry »