Author Topic: Zeroing local variables  (Read 738 times)

TimoVJL

  • Member
  • ****
  • Posts: 998
Re: Zeroing local variables
« Reply #15 on: April 06, 2022, 05:00:31 PM »
Code: [Select]
AMD Ryzen 5 3400G with Radeon Vega Graphics     (SSE4)

20775   cycles for 100 * ClearLocals (fast+bloated)
21998   cycles for 100 * ClearLocals (slow+compact)
??      cycles for 100 * one nop
74      cycles for 100 * 10 nops
1733    cycles for 100 * 100 nops

18085   cycles for 100 * ClearLocals (fast+bloated)
22850   cycles for 100 * ClearLocals (slow+compact)
??      cycles for 100 * one nop
74      cycles for 100 * 10 nops
1731    cycles for 100 * 100 nops

18147   cycles for 100 * ClearLocals (fast+bloated)
21744   cycles for 100 * ClearLocals (slow+compact)
??      cycles for 100 * one nop
72      cycles for 100 * 10 nops
1736    cycles for 100 * 100 nops

19727   cycles for 100 * ClearLocals (fast+bloated)
20353   cycles for 100 * ClearLocals (slow+compact)
??      cycles for 100 * one nop
79      cycles for 100 * 10 nops
3249    cycles for 100 * 100 nops

51      bytes for ClearLocals (fast+bloated)
39      bytes for ClearLocals (slow+compact)
1       bytes for one nop
10      bytes for 10 nops
100     bytes for 100 nops
May the source be with you

daydreamer

  • Member
  • *****
  • Posts: 1946
  • "follow the blue star!!!"
Re: Zeroing local variables
« Reply #16 on: April 06, 2022, 07:15:12 PM »
It's good to know pad nops before innerloop don't take many clock cycles
But what about the 2,3,4,5,6,7,8,9 byte nops? Is there a difference between 9 single byte nops vs one 9byte nop (66h nop [eax*8+ebx+dword address] something)

SIMD fan and macro fan
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
if you wanna see an asm missile ,there is already a builtin:
AAM also means "Air to Air Missile" :D

jj2007

  • Member
  • *****
  • Posts: 12345
  • Assembler is fun ;-)
    • MasmBasic
Re: Zeroing local variables
« Reply #17 on: April 06, 2022, 07:45:22 PM »
Good question, why don't you test it?