Skip to content

Commit a52cb5e

Browse files
Claudiu Zissulescuartemiy-volkov
authored andcommitted
arc64: add missing hook. Improves code gen for 32 bit
1 parent 00967a1 commit a52cb5e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

gcc/config/arc64/arc64.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,6 +2394,18 @@ arc_expand_compare_and_swap_qh (rtx bool_result, rtx result, rtx mem,
23942394
emit_move_insn (result, gen_lowpart (GET_MODE (result), res));
23952395
}
23962396

2397+
/* On some RISC architectures with 64-bit registers, the processor
2398+
also maintains 32-bit condition codes that make it possible to do
2399+
real 32-bit arithmetic, although the operations are performed on
2400+
the full registers. This hook needs to be define if
2401+
WORD_REGISTER_OPERATIONS is not defined to 1. */
2402+
2403+
static unsigned int
2404+
arc64_min_arithmeric_precision (void)
2405+
{
2406+
return 32;
2407+
}
2408+
23972409
/*
23982410
Global functions.
23992411
*/
@@ -3400,6 +3412,9 @@ arc64_allow_direct_access_p (rtx op)
34003412
#undef TARGET_MACHINE_DEPENDENT_REORG
34013413
#define TARGET_MACHINE_DEPENDENT_REORG arc64_reorg
34023414

3415+
#undef TARGET_MIN_ARITHMETIC_PRECISION
3416+
#define TARGET_MIN_ARITHMETIC_PRECISION arc64_min_arithmeric_precision
3417+
34033418
struct gcc_target targetm = TARGET_INITIALIZER;
34043419

34053420
#include "gt-arc64.h"

0 commit comments

Comments
 (0)