Skip to content

Commit

Permalink
Arm64 : Adjust Fortran nested Hack to use bit 1 on aarch64, add to C
Browse files Browse the repository at this point in the history
This addresses Issue #32 by adjusting the nested function hack to use
bit 1 rather than bit 2.

NOTE: that Arm reserve both bits 0 and 1 for furture use, so that this
is no less a hack than using bit 2 - but it might be a somewhat more
compatible hack.

Tested with the example in Issue #32 (otherwise, there's no real change
in the testsuite).
  • Loading branch information
iains committed Feb 20, 2021
1 parent a39175b commit 2b9ca8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions gcc/c/c-lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ enum c_language_kind c_language = clk_c;
#undef LANG_HOOKS_INIT_TS
#define LANG_HOOKS_INIT_TS c_common_init_ts

#undef LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS
#define LANG_HOOKS_CUSTOM_FUNCTION_DESCRIPTORS true

#if CHECKING_P
#undef LANG_HOOKS_RUN_LANG_SELFTESTS
#define LANG_HOOKS_RUN_LANG_SELFTESTS selftest::run_c_tests
Expand Down
4 changes: 2 additions & 2 deletions gcc/config/aarch64/aarch64.c
Original file line number Diff line number Diff line change
Expand Up @@ -24750,9 +24750,9 @@ aarch64_libgcc_floating_mode_supported_p
#define TARGET_DWARF_POLY_INDETERMINATE_VALUE \
aarch64_dwarf_poly_indeterminate_value

/* The architecture reserves bits 0 and 1 so use bit 2 for descriptors. */
/* The architecture reserves bits 0 and 1 but hack 1 for now. */
#undef TARGET_CUSTOM_FUNCTION_DESCRIPTORS
#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 4
#define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2

#undef TARGET_HARD_REGNO_NREGS
#define TARGET_HARD_REGNO_NREGS aarch64_hard_regno_nregs
Expand Down
4 changes: 1 addition & 3 deletions gcc/config/aarch64/aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@

#define STACK_BOUNDARY 128

/* Custom function descriptors use bit 2 so function alignment must be
at least 64 to work with this. */
#define FUNCTION_BOUNDARY 64
#define FUNCTION_BOUNDARY 32

#define EMPTY_FIELD_BOUNDARY 32

Expand Down

0 comments on commit 2b9ca8f

Please sign in to comment.