Author Topic: Help with QueryPerformanceCounter and 64 bit numbers  (Read 1688 times)

daydreamer

  • Member
  • ***
  • Posts: 492
Re: Help with QueryPerformanceCounter and 64 bit numbers
« Reply #75 on: May 18, 2018, 08:55:51 PM »
But aligning is so simple that I don't mind doing it anyway

If the code gets any faster with alignment, it makes sense in an innermost loop with a Million iterations. Otherwise it bloats your exe, pollutes the data cache, and thus may slow down the whole program.
Thanks for macro jj
Thanks for a timing test idea:
Align 16 data with sse code,so you easily can use mulps,divps etc with variables in memory
Vs you are forced to not be able to use memory aligned data with simd,so instead you use lots of movups before innerloop and innerloop makes use of all 16 xmm regs in 64bit mode for all mulps etc is reg to reg,all variables are kept in .xmm regs
And testrun this several million times
Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*

jj2007

  • Member
  • *****
  • Posts: 8599
  • Assembler is fun ;-)
    • MasmBasic
Re: Help with QueryPerformanceCounter and 64 bit numbers
« Reply #76 on: May 18, 2018, 09:48:28 PM »
Note that your testcase is different: fld alignedVariable vs fld unalignedVariable uses identical instructions. When using SIMD instructions that throw exceptions, you need additional instructions, and that may cost cycles, of course. Test it... GetTickCount is your friend ;)

daydreamer

  • Member
  • ***
  • Posts: 492
Re: Help with QueryPerformanceCounter and 64 bit numbers
« Reply #77 on: May 19, 2018, 07:16:28 AM »
Note that your testcase is different: fld alignedVariable vs fld unalignedVariable uses identical instructions. When using SIMD instructions that throw exceptions, you need additional instructions, and that may cost cycles, of course. Test it... GetTickCount is your friend ;)
my C++ exercise, force me into use movups and mulps xmmreg,xmmreg,inline asm,so I could as well try that different solution for innerloop
Quote from Flashdance
Nick  :  When you give up your dream, you die.
*wears a flameproof asbestos suit*