mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-28 08:10:25 +08:00
Enable variable-length arrays on arm64.
arm64-gen.c: Implement gen_vla_sp_save, gen_vla_sp_restore, gen_vla_alloc. tests/Makefile: Run vla_test on arm64.
This commit is contained in:
parent
35e715a1e3
commit
f4082851ea
14
arm64-gen.c
14
arm64-gen.c
@ -1820,15 +1820,23 @@ ST_FUNC void gen_clear_cache(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ST_FUNC void gen_vla_sp_save(int addr) {
|
ST_FUNC void gen_vla_sp_save(int addr) {
|
||||||
tcc_error("variable length arrays unsupported for this target");
|
uint32_t r = intr(get_reg(RC_INT));
|
||||||
|
o(0x910003e0 | r); // mov x(r),sp
|
||||||
|
arm64_strx(3, r, 29, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ST_FUNC void gen_vla_sp_restore(int addr) {
|
ST_FUNC void gen_vla_sp_restore(int addr) {
|
||||||
tcc_error("variable length arrays unsupported for this target");
|
uint32_t r = intr(get_reg(RC_INT));
|
||||||
|
arm64_ldrx(0, 3, r, 29, addr);
|
||||||
|
o(0x9100001f | r << 5); // mov sp,x(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
ST_FUNC void gen_vla_alloc(CType *type, int align) {
|
ST_FUNC void gen_vla_alloc(CType *type, int align) {
|
||||||
tcc_error("variable length arrays unsupported for this target");
|
uint32_t r = intr(gv(RC_INT));
|
||||||
|
o(0x91003c00 | r | r << 5); // add x(r),x(r),#15
|
||||||
|
o(0x927cec00 | r | r << 5); // bic x(r),x(r),#15
|
||||||
|
o(0xcb2063ff | r << 16); // sub sp,sp,x(r)
|
||||||
|
vpop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* end of A64 code generator */
|
/* end of A64 code generator */
|
||||||
|
@ -41,8 +41,7 @@ endif
|
|||||||
ifeq ($(TARGETOS),Darwin)
|
ifeq ($(TARGETOS),Darwin)
|
||||||
TESTS := $(filter-out hello-exe test3 $(BTESTS),$(TESTS))
|
TESTS := $(filter-out hello-exe test3 $(BTESTS),$(TESTS))
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),i386)
|
ifeq (,$(filter arm64 i386 x86-64,$(ARCH)))
|
||||||
else ifneq ($(ARCH),x86-64)
|
|
||||||
TESTS := $(filter-out vla_test-run,$(TESTS))
|
TESTS := $(filter-out vla_test-run,$(TESTS))
|
||||||
endif
|
endif
|
||||||
ifeq ($(CONFIG_arm_eabi),yes)
|
ifeq ($(CONFIG_arm_eabi),yes)
|
||||||
|
Loading…
Reference in New Issue
Block a user