OurBigBook About$ Donate
 Sign in+ Sign up
by Ciro Santilli (@cirosantilli, 37)

c/inc_loop_asm.c

 ... Computer Software Programming language List of programming languages C (programming language) C example
 0 By others on same topic  0 Discussions  Updated 2025-06-17  +Created 2025-06-17  See my version
Tags: CPU microbenchmark
(root) / c / inc_loop_asm.c
This is the only way that we've managed to reliably get a single inc instruction loop, by using inline assembly, e.g. on we do x86:
loop:
  inc %[i];
  cmp %[max], %[i];
  jb loop;
For 1s on P14s Ubuntu 25.04 GCC 14.2 -O0 x86_64 we need about 5 billion:
time ./inc_loop_asm.out 5000000000

 Ancestors (10)

  1. C example
  2. C (programming language)
  3. List of programming languages
  4. Programming language
  5. Software
  6. Computer
  7. Information technology
  8. Area of technology
  9. Technology
  10.  Home

 View article source

 Discussion (0)

+ New discussion

There are no discussions about this article yet.

 Articles by others on the same topic (0)

There are currently no matching articles.
  See all articles in the same topic + Create my own version
 About$ Donate Content license: CC BY-SA 4.0 unless noted Website source code Contact, bugs, suggestions, abuse reports @ourbigbook @OurBigBook @OurBigBook