History

arm64: Fix loading from constant address

herman ten brugge committed 5 years ago

Commit ecdee4a1 parent 00d467d1 file · +10 −4Browse files

Unified · Split

arm64-gen.c+10−4
@@ -497,8 +497,11 @@ ST_FUNC void load(int r, SValue *sv) · 496 unmodified lines
497 }497 }
498 498
499 if (svr == (VT_CONST | VT_LVAL)) {499 if (svr == (VT_CONST | VT_LVAL)) {
500 arm64_sym(30, sv->sym, // use x30 for address500 if (sv->sym)
501 arm64_check_offset(0, arm64_type_size(svtt), sv->c.i));501 arm64_sym(30, sv->sym, // use x30 for address
502 arm64_check_offset(0, arm64_type_size(svtt), sv->c.i));
503 else
504 arm64_movimm (30, sv->c.i);
502 if (IS_FREG(r))505 if (IS_FREG(r))
503 arm64_ldrv(arm64_type_size(svtt), fltr(r), 30,506 arm64_ldrv(arm64_type_size(svtt), fltr(r), 30,
504 arm64_check_offset(1, arm64_type_size(svtt), sv->c.i));507 arm64_check_offset(1, arm64_type_size(svtt), sv->c.i));
@@ -612,8 +615,11 @@ ST_FUNC void store(int r, SValue *sv) · 107 unmodified lines
612 }615 }
613 616
614 if (svr == (VT_CONST | VT_LVAL)) {617 if (svr == (VT_CONST | VT_LVAL)) {
615 arm64_sym(30, sv->sym, // use x30 for address618 if (sv->sym)
616 arm64_check_offset(0, arm64_type_size(svtt), sv->c.i));619 arm64_sym(30, sv->sym, // use x30 for address
620 arm64_check_offset(0, arm64_type_size(svtt), sv->c.i));
621 else
622 arm64_movimm (30, sv->c.i);
617 if (IS_FREG(r))623 if (IS_FREG(r))
618 arm64_strv(arm64_type_size(svtt), fltr(r), 30,624 arm64_strv(arm64_type_size(svtt), fltr(r), 30,
619 arm64_check_offset(1, arm64_type_size(svtt), sv->c.i));625 arm64_check_offset(1, arm64_type_size(svtt), sv->c.i));

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