diff options
author | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2013-02-08 16:02:47 +0000 |
---|---|---|
committer | Michael Eager <eager@gcc.gnu.org> | 2013-02-08 16:02:47 +0000 |
commit | 76ef61fbd9ed3f30a5553ddac1a1568fc52e6ab9 (patch) | |
tree | e89c91d4a2ac443eb8452695e07233cfe95d791e | |
parent | 5df813131d18e4db50fb4f9c940ff782b8496a94 (diff) | |
download | gcc-76ef61fbd9ed3f30a5553ddac1a1568fc52e6ab9.zip gcc-76ef61fbd9ed3f30a5553ddac1a1568fc52e6ab9.tar.gz gcc-76ef61fbd9ed3f30a5553ddac1a1568fc52e6ab9.tar.bz2 |
config.gcc (microblaze*-linux*): Add TARGET_BIG_ENDIAN_DEFAULT
gcc:
* config.gcc (microblaze*-linux*): Add TARGET_BIG_ENDIAN_DEFAULT
(microblaze*-*-elf): Likewise
* config/microblaze/linux.h: Add -mbig-endian / -mlittle-endian to
LINK_SPEC
* config/microblaze/microblaze-c.c: Add builtin defines for _LITTLE_ENDIAN
and _BIG_ENDIAN
* config/microblaze/microblaze.h: Add TARGET_ENDIAN_DEFAULT and add to
TARGET_DEFAULT flags.
Expand ASM_SPEC and LINK_SPEC.
Update BYTES_BIG_ENDIAN and WORDS_BIG_ENDIAN
* config/microblaze/microblaze.md: Update extendsidi2 and movdi_internal
instructions to use low-order / high-order reg print_operands
* config/microblaze/microblaze.opt: Add mbig-endian and mlittle-endian
options and inversemask / mask of LITTLE_ENDIAN
* config/microblaze/t-microblaze: Expand multilib options to include mlittle-
endian (le) and update exceptions patterns
gcc/testsuite:
* 20101011-1.c: Add __MICROBLAZE__ exception to set DO_TEST 0
From-SVN: r195893
-rw-r--r-- | gcc/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/config.gcc | 17 | ||||
-rw-r--r-- | gcc/config/microblaze/linux.h | 4 | ||||
-rw-r--r-- | gcc/config/microblaze/microblaze-c.c | 13 | ||||
-rw-r--r-- | gcc/config/microblaze/microblaze.h | 21 | ||||
-rw-r--r-- | gcc/config/microblaze/microblaze.md | 14 | ||||
-rw-r--r-- | gcc/config/microblaze/microblaze.opt | 8 | ||||
-rw-r--r-- | gcc/config/microblaze/t-microblaze | 6 | ||||
-rw-r--r-- | gcc/config/microblaze/t-microblaze-linux | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20101011-1.c | 3 |
11 files changed, 98 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 420f95d..513a794 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2013-02-08 Edgar E. Iglesias <edgar.iglesias@gmail.com> + + * config.gcc (microblaze*-linux*): Add TARGET_BIG_ENDIAN_DEFAULT + (microblaze*-*-elf): Likewise + * config/microblaze/linux.h: Add -mbig-endian / -mlittle-endian to + LINK_SPEC + * config/microblaze/microblaze-c.c: Add builtin defines for _LITTLE_ENDIAN + and _BIG_ENDIAN + * config/microblaze/microblaze.h: Add TARGET_ENDIAN_DEFAULT and add to + TARGET_DEFAULT flags. + Expand ASM_SPEC and LINK_SPEC. + Update BYTES_BIG_ENDIAN and WORDS_BIG_ENDIAN + * config/microblaze/microblaze.md: Update extendsidi2 and movdi_internal + instructions to use low-order / high-order reg print_operands + * config/microblaze/microblaze.opt: Add mbig-endian and mlittle-endian + options and inversemask / mask of LITTLE_ENDIAN + * config/microblaze/t-microblaze: Expand multilib options to include mlittle- + endian (le) and update exceptions patterns + 2013-02-08 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/56195 diff --git a/gcc/config.gcc b/gcc/config.gcc index b6a6ad0..fce3796 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1737,11 +1737,20 @@ mep-*-*) use_gcc_stdint=wrap ;; microblaze*-linux*) + case $target in + microblazeel-*) + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0" + ;; + microblaze-*) + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321" + ;; + esac tm_file="${tm_file} dbxelf.h gnu-user.h linux.h microblaze/linux.h" tm_file="${tm_file} glibc-stdint.h" c_target_objs="${c_target_objs} microblaze-c.o" cxx_target_objs="${cxx_target_objs} microblaze-c.o" tmake_file="${tmake_file} microblaze/t-microblaze" + tmake_file="${tmake_file} microblaze/t-microblaze-linux" ;; microblaze*-*-rtems*) tm_file="${tm_file} dbxelf.h" @@ -1752,6 +1761,14 @@ microblaze*-*-rtems*) tmake_file="${tmake_file} t-rtems microblaze/t-rtems" ;; microblaze*-*-elf) + case $target in + microblazeel-*) + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=0" + ;; + microblaze-*) + tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=4321" + ;; + esac tm_file="${tm_file} dbxelf.h newlib-stdint.h" c_target_objs="${c_target_objs} microblaze-c.o" cxx_target_objs="${cxx_target_objs} microblaze-c.o" diff --git a/gcc/config/microblaze/linux.h b/gcc/config/microblaze/linux.h index c0255f7..7455ec7 100644 --- a/gcc/config/microblaze/linux.h +++ b/gcc/config/microblaze/linux.h @@ -31,7 +31,9 @@ %{!static: \ %{rdynamic:-export-dynamic} \ -dynamic-linker %(dynamic_linker)} \ - %{static:-static}}" + %{static:-static}} \ + %{mbig-endian:-EB} \ + %{mlittle-endian:-EL}" /* For the microblaze-*-linux* subtarget. */ #undef TARGET_OS_CPP_BUILTINS diff --git a/gcc/config/microblaze/microblaze-c.c b/gcc/config/microblaze/microblaze-c.c index d22dc2a..a1a20b7 100644 --- a/gcc/config/microblaze/microblaze-c.c +++ b/gcc/config/microblaze/microblaze-c.c @@ -41,6 +41,19 @@ microblaze_cpp_define (cpp_reader *pfile) builtin_assert ("cpu=microblaze"); builtin_assert ("machine=microblaze"); builtin_define ("__MICROBLAZE__"); + builtin_define ("__microblaze__"); + if (TARGET_LITTLE_ENDIAN) + { + builtin_define ("_LITTLE_ENDIAN"); + builtin_define ("__LITTLE_ENDIAN__"); + builtin_define ("__MICROBLAZEEL__"); + } + else + { + builtin_define ("_BIG_ENDIAN"); + builtin_define ("__BIG_ENDIAN__"); + builtin_define ("__MICROBLAZEEB__"); + } if (!TARGET_SOFT_MUL) { if (!flag_iso) diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h index 78e3642..5b64e39 100644 --- a/gcc/config/microblaze/microblaze.h +++ b/gcc/config/microblaze/microblaze.h @@ -46,8 +46,17 @@ extern enum pipeline_type microblaze_pipe; #define OBJECT_FORMAT_ELF +#if TARGET_BIG_ENDIAN_DEFAULT +#define TARGET_ENDIAN_DEFAULT 0 +#define TARGET_ENDIAN_OPTION "mbig-endian" +#else +#define TARGET_ENDIAN_DEFAULT MASK_LITTLE_ENDIAN +#define TARGET_ENDIAN_OPTION "mlittle-endian" +#endif + /* Default target_flags if no switches are specified */ -#define TARGET_DEFAULT (MASK_SOFT_MUL | MASK_SOFT_DIV | MASK_SOFT_FLOAT) +#define TARGET_DEFAULT (MASK_SOFT_MUL | MASK_SOFT_DIV | MASK_SOFT_FLOAT \ + | TARGET_ENDIAN_DEFAULT) /* What is the default setting for -mcpu= . We set it to v4.00.a even though we are actually ahead. This is safest version that has generate code @@ -77,12 +86,16 @@ extern enum pipeline_type microblaze_pipe; #define TARGET_ASM_SPEC "" #define ASM_SPEC "\ -%(target_asm_spec)" +%(target_asm_spec) \ +%{mbig-endian:-EB} \ +%{mlittle-endian:-EL}" /* Extra switches sometimes passed to the linker. */ /* -xl-mode-xmdstub translated to -Zxl-mode-xmdstub -- deprecated. */ #define LINK_SPEC "%{shared:-shared} -N -relax \ + %{mbig-endian:-EB --oformat=elf32-microblaze} \ + %{mlittle-endian:-EL --oformat=elf32-microblazeel} \ %{Zxl-mode-xmdstub:-defsym _TEXT_START_ADDR=0x800} \ %{mxl-mode-xmdstub:-defsym _TEXT_START_ADDR=0x800} \ %{mxl-gp-opt:%{G*}} %{!mxl-gp-opt: -G 0} \ @@ -167,8 +180,8 @@ extern enum pipeline_type microblaze_pipe; /* Target machine storage layout */ #define BITS_BIG_ENDIAN 0 -#define BYTES_BIG_ENDIAN 1 -#define WORDS_BIG_ENDIAN 1 +#define BYTES_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0) +#define WORDS_BIG_ENDIAN (BYTES_BIG_ENDIAN) #define BITS_PER_UNIT 8 #define BITS_PER_WORD 32 #define UNITS_PER_WORD 4 diff --git a/gcc/config/microblaze/microblaze.md b/gcc/config/microblaze/microblaze.md index 8d4203d..69df592 100644 --- a/gcc/config/microblaze/microblaze.md +++ b/gcc/config/microblaze/microblaze.md @@ -822,14 +822,14 @@ "" { if (which_alternative == 0) - output_asm_insn ("addk\t%D0,r0,%1", operands); + output_asm_insn ("addk\t%L0,r0,%1", operands); else - output_asm_insn ("lw%i1\t%D0,%1", operands); + output_asm_insn ("lw%i1\t%L0,%1", operands); - output_asm_insn ("add\t%0,%D0,%D0", operands); - output_asm_insn ("addc\t%0,r0,r0", operands); - output_asm_insn ("beqi\t%0,.+8", operands); - return "addi\t%0,r0,0xffffffff"; + output_asm_insn ("add\t%M0,%L0,%L0", operands); + output_asm_insn ("addc\t%M0,r0,r0", operands); + output_asm_insn ("beqi\t%M0,.+8", operands); + return "addi\t%M0,r0,0xffffffff"; } [(set_attr "type" "multi,multi,multi") (set_attr "mode" "DI") @@ -887,7 +887,7 @@ case 0: return "addk\t%0,%1\n\taddk\t%D0,%d1"; case 1: - return "addik\t%0,r0,%h1\n\taddik\t%D0,r0,%j1 #li => la"; + return "addik\t%M0,r0,%h1\n\taddik\t%L0,r0,%j1 #li => la"; case 2: return "addk\t%0,r0,r0\n\taddk\t%D0,r0,r0"; case 3: diff --git a/gcc/config/microblaze/microblaze.opt b/gcc/config/microblaze/microblaze.opt index e597a94..fc7d0cd 100644 --- a/gcc/config/microblaze/microblaze.opt +++ b/gcc/config/microblaze/microblaze.opt @@ -55,6 +55,14 @@ mmemcpy Target Mask(MEMCPY) Don't optimize block moves, use memcpy +mbig-endian +Target Report RejectNegative InverseMask(LITTLE_ENDIAN) +Assume target CPU is configured as big endian + +mlittle-endian +Target Report RejectNegative Mask(LITTLE_ENDIAN) +Assume target CPU is configured as little endian + mxl-soft-mul Target Mask(SOFT_MUL) Use the soft multiply emulation (default) diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze index cb49636..41fa9a9 100644 --- a/gcc/config/microblaze/t-microblaze +++ b/gcc/config/microblaze/t-microblaze @@ -1,6 +1,8 @@ -MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high -MULTILIB_DIRNAMES = bs m mh +MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high mlittle-endian +MULTILIB_DIRNAMES = bs m mh le MULTILIB_EXCEPTIONS = *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high +MULTILIB_EXCEPTIONS += *mxl-barrel-shift/mxl-multiply-high/mlittle-endian +MULTILIB_EXCEPTIONS += mxl-multiply-high/mlittle-endian # Extra files microblaze-c.o: $(srcdir)/config/microblaze/microblaze-c.c \ diff --git a/gcc/config/microblaze/t-microblaze-linux b/gcc/config/microblaze/t-microblaze-linux new file mode 100644 index 0000000..e8e8f3c8 --- /dev/null +++ b/gcc/config/microblaze/t-microblaze-linux @@ -0,0 +1,3 @@ +MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high +MULTILIB_DIRNAMES = bs m mh +MULTILIB_EXCEPTIONS = *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5872f36..d816f18 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-02-08 Edgar E. Iglesias <edgar.iglesias@gmail.com> + + * 20101011-1.c: Add __MICROBLAZE__ exception to set DO_TEST 0 + 2013-02-08 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/56195 diff --git a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c index 76b9f06..8d82183 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20101011-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20101011-1.c @@ -29,6 +29,9 @@ /* Not all Linux kernels deal correctly the breakpoints generated by MIPS16 divisions by zero. They show up as a SIGTRAP instead. */ # define DO_TEST 0 +#elif defined (__MICROBLAZE__) +/* We cannot rely on division by zero generating a trap. */ +# define DO_TEST 0 #elif defined (__epiphany__) /* Epiphany does not have hardware division, and the software implementation has truly undefined behaviour for division by 0. */ |