History

trivial jump size optimization

bellard committed 24 years ago

Commit 37489751 parent 1cb35571 file · +9 −2Browse files

Unified · Split

i386-gen.c+9−2
@@ -233,7 +233,7 @@ void load(int r, SValue *sv) · 232 unmodified lines
233233 } else if (v == VT_JMP || v == VT_JMPI) {
234234 t = v & 1;
235235 oad(0xb8 + r, t); /* mov $1, r */
236− oad(0xe9, 5); /* jmp after */
236+ o(0x05eb); /* jmp after */
237237 gsym(fc);
238238 oad(0xb8 + r, t ^ 1); /* mov $0, r */
239239 } else if (v != r) {
@@ -479,7 +479,14 @@ int gjmp(int t) · 239 unmodified lines
479479 /* generate a jump to a fixed address */
480480 void gjmp_addr(int a)
481481 {
482− oad(0xe9, a - ind - 5);
482+ int r;
483+ r = a - ind - 2;
484+ if (r == (char)r) {
485+ g(0xeb);
486+ g(r);
487+ } else {
488+ oad(0xe9, a - ind - 5);
489+ }
483490 }
484491
485492 /* generate a test. set 'inv' to invert test. Stack entry is popped */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t