As a follow up of this (http://masm32.com/board/index.php?topic=7394.msg81032#msg81032), I present here 2 methods of converting 1 REAL4 to 1 HALF, the VCVTPS2PH method and the no-VCVTPS2PH method.
The first one is the best but may not work on all computers.
I compare if the result obtained from both methods yields the same result. It does :biggrin: (in this case)
HALF values are equal
BTW, I have not figured out yet know how to print a HALF (without converting it back of course). Anyone?
HALF values are equal :t
On my Core i5-2450M, vcvtps2ph xmm1, xmm0 is an illegal instruction.
Quote from: jj2007 on September 13, 2018, 01:55:37 AM
On my Core i5-2450M, vcvtps2ph xmm1, xmm0 is an illegal instruction.
You need an Ivy Bridge or later (https://en.wikipedia.org/wiki/F16C).
Hi,
Intel Core i3 4005U.
HALF values are equal
Steve N.
Haswell E/EP
HALF values are equal
Quote from: AW on September 13, 2018, 01:01:37 AM
As a follow up of this (http://masm32.com/board/index.php?topic=7394.msg81032#msg81032), I present here 2 methods of converting 1 REAL4 to 1 HALF, the VCVTPS2PH method and the no-VCVTPS2PH method.
The first one is the best but may not work on all computers.
I compare if the result obtained from both methods yields the same result. It does :biggrin: (in this case)
BTW, I have not figured out yet know how to print a HALF (without converting it back of course). Anyone?
doesnt work
I Think its more interesting to be able to store twice the amount meshes in a demo
isnt it actually what you get from importing 3d files,double values in ascii->half's much smaller?
Now, I will not use the modern instructions, some people still has pre- Ivy Bridge computers, and will print the HALF by converting it back and consider 4 significant digits (it has 3/4 significant digits), by luck in this case the 4th digit is still valid.
REAL4 Value=1.234567
HALF Value=1.234
@daydream
All depends on what you have in mind
Nice :biggrin:
Daydreamer, to compress vertex data, use "vertex subdivision" and convert the data to half floats ( the files will be incredible small ).
Quote from: AW on September 15, 2018, 12:37:49 AM
Now, I will not use the modern instructions, some people still has pre- Ivy Bridge computers, and will print the HALF by converting it back and consider 4 significant digits (it has 3/4 significant digits), by luck in this case the 4th digit is still valid.
REAL4 Value=1.234567
HALF Value=1.234
@daydream
All depends on what you have in mind
Would be nice to add aircraft meshes and other meshes as small together in my project with procedural terrain making