-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Labels
Description
Problem
For supporting AVX/SSE2 instructions, I should have the support for 128 xmm registers, where the 128 bits can be interpreted as any one of he following:
2 64 bit doubles or
4 32-bit floats or
1 128 bit int or
2 64 bit ints or
4 32 bit ints or
8 16 bit ints or
16 8-bit ints or
The plan is to use mi(128,I) for those registers and whenever I need to interpret it as floats (or double), I will extract each 32 (or 64) bit chunks and get the corresponding float (or double).
K-buitin Floats do not provide any hooks to convert a specific bit pattern into a single precision or double precision floating point value.
Requirement
We need the ability to do the conversion as shown in examples:
Example 1:
bit-vector: 32' 01000001 01000110 00000000 00000000 === MInt(32, 1095106560)
convert to or from
Float(single precision): 12.375f.
Example 2:
bit-vector: 64' 0b0100000000101000110000000000000000000000000000000000000000000000 === MInt(64, 4623156123728347136)
convert to or from
Float(single precision): 12.375d.