Skip to content

Commit 104f6d7

Browse files
alpsayinstephanosio
authored andcommitted
microblaze: apply gcc patches from meta-xilinx repository
This patchset fixes many known issues on gnu-toolchain for microblaze. But mainly the atomic-cas and binutils incorrect relocation issues. Patches obtained from https://github.com/xilinx/meta-xilinx/ repository, from meta-microblaze/recipes-devtools/gcc path. Below is a list of patches applied and squashed. Some patches that were already applied were reverted and re-applied to avoid conflicts. 0001-LOCAL-Testsuite-builtins-tests-require-fpic.patch 0002-LOCAL-Quick-fail-g-.dg-opt-memcpy1.C.patch 0003-LOCAL-For-dejagnu-static-testing-on-qemu-suppress-wa.patch 0004-Patch-testsuite-Add-MicroBlaze-to-target-supports-fo.patch 0005-Patch-testsuite-Update-MicroBlaze-strings-test.patch 0006-Patch-testsuite-Allow-MicroBlaze-.weakext-pattern-in.patch 0007-Patch-testsuite-Add-MicroBlaze-to-check_profiling_av.patch 0008-Patch-microblaze-Fix-atomic-side-effects.patch 0009-Patch-microblaze-Fix-atomic-boolean-return-value.patch 0010-Patch-microblaze-Fix-the-Microblaze-crash-with-msmal.patch 0011-Patch-microblaze-Added-ashrsi3_with_size_opt.patch 0012-Patch-microblaze-Use-bralid-for-profiler-calls.patch 0013-Patch-microblaze-Removed-moddi3-routinue.patch 0014-Patch-microblaze-Add-INIT_PRIORITY-support-Added.patch 0015-Patch-microblaze-Add-optimized-lshrsi3.patch 0016-Patch-microblaze-Add-cbranchsi4_reg.patch 0017-Patch-microblaze-Inline-Expansion-of-fsqrt-builtin.patch 0018-PATCH-microblaze.md-Improve-adddi3-and-subdi3-insn-d.patch 0019-Patch-microblaze-Update-ashlsi3-movsf-patterns.patch 0020-Patch-microblaze-8-stage-pipeline-for-microblaze.patch 0021-PATCH-21-53-Patch-microblaze-Correct-the-const-high-.patch 0022-Fix-microblaze-Fix-internal-compiler-error-with-msma.patch 0023-patch-microblaze-Fix-the-calculation-of-high-word-in.patch 0024-Patch-MicroBlaze-this-patch-has-1.Fixed-the-bug-in.patch 0025-Fixing-the-issue-with-the-builtin_alloc.patch 0026-Patch-Microblaze-Removed-fsqrt-generation-for-double.patch 0027-Patch-MicroBlaze-Intial-commit-of-64-bit-Microblaze.patch 0028-Intial-commit-for-64bit-MB-sources.patch 0029-Patch-MicroBlaze-re-arrangement-of-the-compare-branc.patch 0030-Patch-Microblaze-previous-commit-broke-the-handling-.patch 0031-Patch-Microblaze-Support-of-multilibs-with-m64.patch 0032-Patch-MicroBlaze-Fixed-issues-like.patch 0033-Patch-MicroBlaze.patch 0034-Added-double-arith-instructions.patch 0035-Fixed-the-issue-in-the-delay-slot-with-swap-instruct.patch 0036-Fixed-the-load-store-issue-with-the-32bit-arith-libr.patch 0037-extending-the-Dwarf-support-to-64bit-Microblaze.patch 0038-fixing-the-typo-errors-in-umodsi3-file.patch 0039-fixing-the-32bit-LTO-related-issue9-1014024.patch 0040-Fixed-the-missing-stack-adjustment-in-prologue-of-mo.patch 0041-Patch-Microblaze-corrected-SPN-for-dlong-instruction.patch 0042-fixing-the-long-long-long-mingw-toolchain-issue.patch 0043-Fix-the-MB-64-bug-of-handling-QI-objects.patch 0044-Patch-Microblaze-We-will-check-the-possibility-of-pe.patch 0045-Patch-MicroBlaze-fixed-typos-in-mul-div-and-mod-asse.patch 0046-Patch-microblaze-MB-64-removal-of-barrel-shift-instr.patch 0047-Added-new-MB-64-single-register-arithmetic-instructi.patch 0048-Patch-MicroBlaze-Added-support-for-64-bit-Immediate-.patch 0049-Patch-microblaze-Fix-Compiler-crash-with-freg-struct.patch 0050-Patch-microblaze-Add-TARGET_OPTION_OPTIMIZATION-and-.patch 0051-Patch-microblaze-Reducing-Stack-space-for-arguments.patch 0052-Patch-MicroBlaze.patch 0053-patch-microblaze64-Add-Zero_extended-instructions.patch Signed-off-by: Alp Sayin <alpsayin@gmail.com>
1 parent db5fcf3 commit 104f6d7

38 files changed

+3012
-381
lines changed

gcc/common/config/microblaze/microblaze-common.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,20 @@
2424
#include "common/common-target.h"
2525
#include "common/common-target-def.h"
2626

27+
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
28+
static const struct default_options microblaze_option_optimization_table[] =
29+
{
30+
/* Turn off ivopts by default. It messes up cse.
31+
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 }, */
32+
{ OPT_LEVELS_ALL, OPT_fivopts, NULL, 0 },
33+
{ OPT_LEVELS_NONE, 0, NULL, 0 }
34+
};
35+
36+
2737
#undef TARGET_DEFAULT_TARGET_FLAGS
2838
#define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT
2939

40+
#undef TARGET_OPTION_OPTIMIZATION_TABLE
41+
#define TARGET_OPTION_OPTIMIZATION_TABLE microblaze_option_optimization_table
42+
3043
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;

gcc/config/microblaze/constraints.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
(and (match_code "const_int")
5353
(match_test "ival > 0 && ival < 0x10000")))
5454

55+
(define_constraint "K"
56+
"A constant in the range -9223372036854775808 to 9223372036854775807 (inclusive)."
57+
(and (match_code "const_int")
58+
(match_test "ival > (long long)-9223372036854775808 && ival < (long long)9223372036854775807")))
59+
60+
5561
;; Define floating point constraints
5662

5763
(define_constraint "G"

gcc/config/microblaze/microblaze-c.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,11 @@ microblaze_cpp_define (cpp_reader *pfile)
100100
builtin_define ("HAVE_HW_FPU_SQRT");
101101
builtin_define ("__HAVE_HW_FPU_SQRT__");
102102
}
103+
if (TARGET_MB_64)
104+
{
105+
builtin_define ("__microblaze64");
106+
builtin_define ("__arch64__");
107+
builtin_define ("__microblaze64__");
108+
builtin_define ("__MICROBLAZE64__");
109+
}
103110
}

gcc/config/microblaze/microblaze-protos.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ extern int microblaze_expand_shift (rtx *);
3333
extern bool microblaze_expand_move (machine_mode, rtx *);
3434
extern bool microblaze_expand_block_move (rtx, rtx, rtx, rtx);
3535
extern void microblaze_expand_divide (rtx *);
36-
extern void microblaze_expand_conditional_branch (machine_mode, rtx *);
36+
extern void microblaze_expand_conditional_branch (enum machine_mode, rtx *);
3737
extern void microblaze_expand_conditional_branch_reg (machine_mode, rtx *);
3838
extern void microblaze_expand_conditional_branch_sf (rtx *);
39+
extern void microblaze_expand_conditional_branch_df (rtx *);
3940
extern int microblaze_can_use_return_insn (void);
4041
extern void print_operand (FILE *, rtx, int);
4142
extern void print_operand_address (FILE *, rtx);
@@ -59,6 +60,7 @@ extern int symbol_mentioned_p (rtx);
5960
extern int label_mentioned_p (rtx);
6061
extern bool microblaze_cannot_force_const_mem (machine_mode, rtx);
6162
extern void microblaze_eh_return (rtx op0);
63+
int microblaze_reg_parm_stack_space(tree fun);
6264
#endif /* RTX_CODE */
6365

6466
/* Declare functions in microblaze-c.cc. */

0 commit comments

Comments
 (0)