News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

using halfs?

Started by daydreamer, May 15, 2021, 05:24:34 AM

Previous topic - Next topic

daydreamer

to save space,could I have lots of data in halfs instead of real4's?
are there already conversion macros/proc between them? or I need to do bitfiddling myself?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

jj2007

Search the forum for REAL2, there are many posts.

InfiniteLoop

F16C is 16-bit floating point.

VCVTPH2PS ymm1, xmm2/m128

jj2007

Nice find, InfiniteLoop :thumbsup:

I've put together a simple example (using plain Masm32 SDK code, see attached source), but I can't test it on my old cpu...

  vcvtps2ph half, xmm0, 0       ; 4 x single to half-precision; round to nearest even
  vcvtph2ps xmm0, xmm1          ; 4 x half to single-precision

daydreamer

Thanks infiniteloop and jj :thumbsup:
I try 16 bit fixed point storage ->  fimul constant also
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

jj2007

Did my proggie work for you, daydreamer?

hutch--

Seems to run here OK.

test 111.125000
test 222.250000
test 333.250000
test 444.500000
ok?

LiaoMi

Quote from: jj2007 on May 20, 2021, 10:49:13 AM
Nice find, InfiniteLoop :thumbsup:

I've put together a simple example (using plain Masm32 SDK code, see attached source), but I can't test it on my old cpu...

  vcvtps2ph half, xmm0, 0       ; 4 x single to half-precision; round to nearest even
  vcvtph2ps xmm0, xmm1          ; 4 x half to single-precision


test 111.125000
test 222.250000
test 333.250000
test 444.500000
ok?

daydreamer

#8
Quote from: jj2007 on May 20, 2021, 09:09:41 PM
Did my proggie work for you, daydreamer?
it works
:thumbsup:
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

If I have lots of 3d object data, half's would be good to have smaller size data
But even word data = in millimeters might be good alternative
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

HSE

Quote from: jj2007 on May 20, 2021, 10:49:13 AM
... but I can't test it on my old cpu...

:biggrin: Wrong, JJ

You can use Intel SDE (I don't have AVX, pretty old machine):
test 111.125000
test 222.250000
test 333.250000
test 444.500000
ok?
Equations in Assembly: SmplMath

jj2007

Quote from: HSE on May 20, 2021, 11:45:59 PMYou can use Intel SDE

Never seen. Interesting, how does it work? I saw it's not such a fat download. Is it freeware? Does it really emulate the processor, in the sense: utterly slow but it works correctly?

daydreamer

Quote from: HSE on May 20, 2021, 11:45:59 PM
Quote from: jj2007 on May 20, 2021, 10:49:13 AM
... but I can't test it on my old cpu...

:biggrin: Wrong, JJ

You can use Intel SDE (I don't have AVX, pretty old machine):
test 111.125000
test 222.250000
test 333.250000
test 444.500000
ok?

Nice
But isn't it bigger chance old gpu have half caps,where I seen its used many years ago,and maybe some shader capable of conversion,or shader compiler running on cpu have caps. To convert half's <>floats?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

HSE

Quote from: jj2007 on May 20, 2021, 11:51:46 PM
how does it work? I saw it's not such a fat download. Is it freeware?
I don't remember if requiere a free subscription, but is free for our use. Nidud posted a test (or something) a year ago.

There is a batch that open a command window. From the prompt you have a AVX machine  :biggrin:

Also work a little batch: path\sde -- halfprecision.exe
Equations in Assembly: SmplMath

HSE

Quote from: daydreamer on May 21, 2021, 12:04:50 AM
But isn't it bigger chance old gpu have half caps,where I seen its used many years ago,and maybe some shader capable of conversion,or shader compiler running on cpu have caps. To convert half's <>floats?
Have you writed some code to show how that can be maked? That could be interesting  :thumbsup:
Equations in Assembly: SmplMath