diff options
author | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-07-21 17:24:03 +0100 |
---|---|---|
committer | Jozef Lawrynowicz <jozef.l@mittosystems.com> | 2020-07-21 17:32:06 +0100 |
commit | 111afded7fdf46ce14972aa8a72c26c9a180ab70 (patch) | |
tree | f0b4b037a5a64c6180ce1bcaf85d9af80f26e909 /gcc | |
parent | df41897928b4879df9f38a40a0e22659076544c1 (diff) | |
download | gcc-111afded7fdf46ce14972aa8a72c26c9a180ab70.zip gcc-111afded7fdf46ce14972aa8a72c26c9a180ab70.tar.gz gcc-111afded7fdf46ce14972aa8a72c26c9a180ab70.tar.bz2 |
MSP430: Define NO_FUNCTION_CSE
Calling a constant function address costs the same number of clock
cycles as calling an address stored in a register. However, in terms of
instruction length, calling a constant address is more expensive.
Set NO_FUNCTION_CSE to true, only when optimizing for speed.
gcc/ChangeLog:
* config/msp430/msp430.h (NO_FUNCTION_CSE): Set to true at -O2 and
above.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/msp430/msp430.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/config/msp430/msp430.h b/gcc/config/msp430/msp430.h index f198981..e97e833 100644 --- a/gcc/config/msp430/msp430.h +++ b/gcc/config/msp430/msp430.h @@ -257,6 +257,11 @@ extern const char *msp430_get_linker_devices_include_path (int, const char **); msp430_return_addr_rtx (COUNT) #define SLOW_BYTE_ACCESS 0 + +/* Calling a constant function address costs the same number of clock + cycles as calling an address stored in a register. However, in terms of + instruction length, calling a constant address is more expensive. */ +#define NO_FUNCTION_CSE (optimize >= 2 && !optimize_size) /* Register Usage */ |