Convert c to lc3 assembly1/16/2024 ![]() ![]() Getting the high part of 64 bit integer multiplication: A portable version using uint64_t for 32x32 => 64-bit multiplies fails to optimize on a 64-bit CPU, so you need intrinsics or _int128 for efficient code on 64-bit systems. ![]() Modern compilers optimize this fixed-point example nicely, so for more modern examples that still need compiler-specific code, see uniform absolute precision over the entire range, instead of close-to-uniform relative precision ( float). ![]() These don't only come handy on devices without floating point, they shine when it comes to precision as they give you 32 bits of precision with a predictable error (float only has 23 bit and it's harder to predict precision loss). Here is a real world example: Fixed point multiplies on old compilers. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |