Menu

#3922 Potential bug in cycle counting for mos6502

closed-invalid
None
Simulator
5
2026-01-19
2026-01-17
No

while comparing the runtime effect of some codegen changes I found a ucsim behavior that I am unable to explain.

I attached 2 version of the rotate2_size_16_andCase_1_xorLiteral_1_rotateLeft_0_structVar_1 including the asm and the ixh

the ref version is shorter and by analyzing the asm outpush should be also faster.
however according to ucsim the ref implementation takes 167 cycles more.

4 Attachments

Discussion

  • Daniel Drotos

    Daniel Drotos - 2026-01-19
    • status: open --> closed-invalid
    • assigned_to: Daniel Drotos
     
  • Daniel Drotos

    Daniel Drotos - 2026-01-19

    Difference comes from branch instructions where destination is on other page. Ref executes more like branches, and they need 1 extra cycle to execute.

     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.
Try Free →