Skip to content

Avoid optimizing workload away#4

Open
7FM wants to merge 1 commit intogchamp20:masterfrom
7FM:more_fixes
Open

Avoid optimizing workload away#4
7FM wants to merge 1 commit intogchamp20:masterfrom
7FM:more_fixes

Conversation

@7FM
Copy link
Copy Markdown

@7FM 7FM commented Jul 24, 2025

Clang without volatile:

8000111c <workload_task>:
8000111c: ff010113         addi    sp, sp, -0x10
80001120: 00112623         sw    ra, 0xc(sp)
80001124: 060000ef         jal    0x80001184 <no_task_yield>
80001128: ffdff06f         j    0x80001124 <workload_task+0x8>

With volatile:

8000111c <workload_task>:
8000111c: e5010113         addi    sp, sp, -0x1b0
80001120: 1a112623         sw    ra, 0x1ac(sp)
80001124: 1a812423         sw    s0, 0x1a8(sp)
80001128: 1a912223         sw    s1, 0x1a4(sp)
8000112c: 1b212023         sw    s2, 0x1a0(sp)
80001130: 19312e23         sw    s3, 0x19c(sp)
80001134: 19412c23         sw    s4, 0x198(sp)
80001138: 00000413         li    s0, 0x0
8000113c: 00810493         addi    s1, sp, 0x8
80001140: 51eb8537         lui    a0, 0x51eb8
80001144: e7000913         li    s2, -0x190
80001148: 51f50993         addi    s3, a0, 0x51f
8000114c: 00030a37         lui    s4, 0x30
80001150: 03343533         mulhu    a0, s0, s3
80001154: 00555513         srli    a0, a0, 0x5
80001158: 03250533         mul    a0, a0, s2
8000115c: 00a48533         add    a0, s1, a0
80001160: 01452023         sw    s4, 0x0(a0)
80001164: 068000ef         jal    0x800011cc <no_task_yield>
80001168: 00140413         addi    s0, s0, 0x1
8000116c: 00448493         addi    s1, s1, 0x4
80001170: fe1ff06f         j    0x80001150 <workload_task+0x34>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant