History

Enable vla_test-run on all targets

Fix gen_vla_sp_save/gen_vla_sp_restore in riscv64-gen.c

herman ten brugge committed 3 years ago

Commit ac9eeea1 parent 657262c2 files · +14 −5Browse files

Unified · Split

2 files
  1. riscv64-gen.c +14 −2
  2. tests/Makefile +0 −3
riscv64-gen.c+14−2
@@ -1382,12 +1382,24 @@ ST_FUNC void ggoto(void) · 1381 unmodified lines
13821382
13831383 ST_FUNC void gen_vla_sp_save(int addr)
13841384 {
1385− ES(0x23, 3, 8, 2, addr); // sd sp, fc(s0)
1385+ if (((unsigned)addr + (1 << 11)) >> 12) {
1386+ o(0x37 | (5 << 7) | ((0x800 + addr) & 0xfffff000)); //lui t0,upper(addr)
1387+ ER(0x33, 0, 5, 5, 8, 0); // add t0, t0, s0
1388+ ES(0x23, 3, 5, 2, (int)addr << 20 >> 20); // sd sp, fc(t0)
1389+ }
1390+ else
1391+ ES(0x23, 3, 8, 2, addr); // sd sp, fc(s0)
13861392 }
13871393
13881394 ST_FUNC void gen_vla_sp_restore(int addr)
13891395 {
1390− EI(0x03, 3, 2, 8, addr); // ld sp, fc(s0)
1396+ if (((unsigned)addr + (1 << 11)) >> 12) {
1397+ o(0x37 | (5 << 7) | ((0x800 + addr) & 0xfffff000)); //lui t0,upper(addr)
1398+ ER(0x33, 0, 5, 5, 8, 0); // add t0, t0, s0
1399+ EI(0x03, 3, 2, 5, (int)addr << 20 >> 20); // ld sp, fc(t0)
1400+ }
1401+ else
1402+ EI(0x03, 3, 2, 8, addr); // ld sp, fc(s0)
13911403 }
13921404
13931405 ST_FUNC void gen_vla_alloc(CType *type, int align)
tests/Makefile+0−3
@@ -32,9 +32,6 @@ endif · 31 unmodified lines
3232 ifeq ($(CONFIG_dll),no)
3333 TESTS := $(filter-out dlltest, $(TESTS))
3434 endif
35−ifeq (,$(filter arm64 i386 x86_64,$(ARCH)))
36− TESTS := $(filter-out vla_test-run,$(TESTS))
37−endif
3835 ifeq (-$(CONFIG_arm_eabi)-$(CONFIG_arm_vfp)-,-yes--)
3936 TESTS := $(filter-out test3 test1b,$(TESTS))
4037 endif

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