diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-03-14 19:47:44 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-03-14 19:47:44 +0000 |
| commit | 2451699c35f87a134144c2d61490653bf2bf4f5c (patch) | |
| tree | d7d6b1b6c5a1871e961a11e5ab0661f003f57c19 /scripts/benchmark.py | |
| parent | sixel: sixel_overwrite_at_cursor(): early exit when the image list is empty (diff) | |
term: term_print(): assume we’re *not* at the right margin
That is, assume we can, and should, increment the cursor column.
This changes the emitted assembly from:
518fb: 8b 8b f8 05 00 00 mov 0x5f8(%rbx),%ecx
51901: ff c9 dec %ecx
51903: 39 d1 cmp %edx,%ecx
51905: 7e 11 jle 51918 <term_print.constprop.0+0x78>
51907: ff c2 inc %edx
51909: 89 50 10 mov %edx,0x10(%rax)
5190c: 5b pop %rbx
5190d: 5d pop %rbp
5190e: 41 5c pop %r12
51910: c3 ret
51911: 0f 1f 80 00 00 00 00 nopl 0x0(%rax)
51918: c6 40 18 01 movb $0x1,0x18(%rax)
5191c: 5b pop %rbx
5191d: 5d pop %rbp
5191e: 41 5c pop %r12
51920: c3 ret
To:
5191c: 41 8d 50 01 lea 0x1(%r8),%edx
51920: 89 50 10 mov %edx,0x10(%rax)
51923: 3b 93 f8 05 00 00 cmp 0x5f8(%rbx),%edx
51929: 0f 8d 21 01 00 00 jge 51a50 <term_print.constprop.0+0x190>
5192f: 5b pop %rbx
51930: 5d pop %rbp
51931: 41 5c pop %r12
51933: c3 ret
...
51a50: c6 40 18 01 movb $0x1,0x18(%rax)
51a54: 44 89 40 10 mov %r8d,0x10(%rax)
51a58: 5b pop %rbx
51a59: 5d pop %rbp
51a5a: 41 5c pop %r12
51a5c: c3 ret
I.e. it cuts the normal path from 10 instructions down to 8. It
increases the "bad" path with one extra instruction.
Diffstat (limited to 'scripts/benchmark.py')
0 files changed, 0 insertions, 0 deletions
