* configure.host: Change to microblaze*.

* libc/include/machine/ieeefp.h: Add __MICROBLAZEEL__.
	* libc/machine/microblaze/mb_endian.h: New file.
	* newlib/libc/machine/microblaze/strcmp.c: Add little endian support.
	* newlib/libc/machine/microblaze/strcpy.c: Likewise.
	* newlib/libc/machine/microblaze/strlen.c: Likewise.

	* configure.in: Change to microblaze*.
	* configure: Regenerate.
	* microblaze/xilinx.ld: Remove OUTPUT_FORMAT.
This commit is contained in:
Corinna Vinschen 2013-07-16 07:48:53 +00:00
parent f6ddaa2a29
commit 6041792ec6
11 changed files with 61 additions and 19 deletions

View File

@ -1,3 +1,9 @@
2013-07-16 David Holsgrove <david.holsgrove@xilinx.com>
* configure.in: Change to microblaze*.
* configure: Regenerate.
* microblaze/xilinx.ld: Remove OUTPUT_FORMAT.
2013-07-12 Marcus Shawcroft <marcus.shawcroft@arm.com>
* aarch64/cpu-init/rdimon-aem-el3.S (vectors): Page align.

2
libgloss/configure vendored
View File

@ -2504,7 +2504,7 @@ case "${target}" in
subdirs="$subdirs moxie"
;;
microblaze-*-*)
microblaze*-*-*)
subdirs="$subdirs microblaze"
;;

View File

@ -117,7 +117,7 @@ case "${target}" in
moxie-*-*)
AC_CONFIG_SUBDIRS([moxie])
;;
microblaze-*-*)
microblaze*-*-*)
AC_CONFIG_SUBDIRS([microblaze])
;;
mt-*-*)

View File

@ -1,6 +1,4 @@
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-microblaze", "",
"")
/*SEARCH_DIR("/proj/fv1/gnu_builds/head/mb/release/lin/mb/microblaze-xilinx-elf/lib");*/
/*SEARCH_DIR("/proj/fv1/gnu_builds/head/mb/release/lin/mb/microblaze-xilinx-elf/lib");*/
ENTRY(_start)

View File

@ -1,3 +1,12 @@
2013-07-16 David Holsgrove <david.holsgrove@xilinx.com>
* configure.host: Change to microblaze*.
* libc/include/machine/ieeefp.h: Add __MICROBLAZEEL__.
* libc/machine/microblaze/mb_endian.h: New file.
* newlib/libc/machine/microblaze/strcmp.c: Add little endian support.
* newlib/libc/machine/microblaze/strcpy.c: Likewise.
* newlib/libc/machine/microblaze/strlen.c: Likewise.
2013-07-09 Sabrina Ni <sabrina@andestech.com>
* libc/machine/nds32/Makefile.am (lib_a_SOURCES): Add abort.c, memcpy.S,

View File

@ -203,7 +203,7 @@ case "${host_cpu}" in
;;
mcore)
;;
microblaze)
microblaze*)
machine_dir=microblaze
;;
mep)
@ -479,7 +479,7 @@ case "${host}" in
default_newlib_io_long_long="yes"
newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES"
;;
microblaze-*-*)
microblaze*-*-*)
machine_dir=microblaze
;;
mips*-dec-*)
@ -696,7 +696,7 @@ case "${host}" in
mcore-*-*)
syscall_dir=syscalls
;;
microblaze-*-*)
microblaze*-*-*)
default_newlib_io_long_long="yes"
newlib_cflags="${newlib_cflags} -DMISSING_SYSCALL_NAMES -DSMALL_MEMORY -D_REENT_SMALL"
;;

View File

@ -364,7 +364,11 @@
#endif
#ifdef __MICROBLAZE__
#ifndef __MICROBLAZEEL__
#define __IEEE_BIG_ENDIAN
#else
#define __IEEE_LITTLE_ENDIAN
#endif
#endif
#ifdef __MSP430__

View File

@ -0,0 +1,15 @@
#ifndef _MB_ENDIAN_H
#define _MB_ENDIAN_H
/* Convenience macros for loading and store 4 bytes in a byte invariant way with
* a singe instruction. Endianess affects this and we rely on MicroBlaze
* load/store reverse instructions to do the trick on little-endian systems.
*/
#ifdef __LITTLE_ENDIAN__
#define LOAD4BYTES(rD,rA,rB) "\tlwr\t" rD ", " rA ", " rB "\n"
#define STORE4BYTES(rD,rA,rB) "\tswr\t" rD ", " rA ", " rB "\n"
#else
#define LOAD4BYTES(rD,rA,rB) "\tlw\t" rD ", " rA ", " rB "\n"
#define STORE4BYTES(rD,rA,rB) "\tsw\t" rD ", " rA ", " rB "\n"
#endif
#endif

View File

@ -138,16 +138,19 @@ _DEFUN (strcmp, (s1, s2),
#else
#include "mb_endian.h"
asm volatile (" \n\
or r9, r0, r0 /* Index register */ \n\
or r9, r0, r0 /* Index register */\n\
check_alignment: \n\
andi r3, r5, 3 \n\
andi r4, r6, 3 \n\
bnei r3, try_align_args \n\
bnei r4, regular_strcmp /* At this point we don't have a choice */ \n\
cmp_loop: \n\
lw r3, r5, r9 \n\
lw r4, r6, r9 \n\
cmp_loop: \n"
LOAD4BYTES("r3", "r5", "r9")
LOAD4BYTES("r4", "r6", "r9")
" \n\
pcmpbf r7, r3, r0 /* See if there is Null byte */ \n\
bnei r7, end_cmp_loop /* IF yes (r7 > 0) use byte compares in end_cmp_loop */ \n\
cmpu r7, r4, r3 /* ELSE compare whole word */ \n\

View File

@ -131,18 +131,22 @@ _DEFUN (strcpy, (dst0, src0),
#else
asm volatile (" \
or r9, r0, r0 /* Index register */ \n\
#include "mb_endian.h"
asm volatile (" \n\
or r9, r0, r0 /* Index register */ \n\
check_alignment: \n\
andi r3, r5, 3 \n\
andi r4, r6, 3 \n\
bnei r3, try_align_args \n\
bnei r4, regular_strcpy /* At this point we dont have a choice */ \n\
cpy_loop: \n\
lw r3, r6, r9 \n\
cpy_loop: \n"
LOAD4BYTES("r3", "r6", "r9")
" \n\
pcmpbf r4, r0, r3 \n\
bnei r4, cpy_bytes /* If r4 != 0, then null present within string */\n\
sw r3, r5, r9 \n\
bnei r4, cpy_bytes /* If r4 != 0, then null present within string */\n"
STORE4BYTES("r3", "r5", "r9")
" \n\
brid cpy_loop \n\
addik r9, r9, 4 \n\
cpy_bytes: \n\

View File

@ -120,13 +120,16 @@ _DEFUN (strlen, (str),
#else
#include "mb_endian.h"
asm volatile (" \n\
or r9, r0, r0 /* Index register */ \n\
check_alignment: \n\
andi r3, r5, 3 \n\
bnei r3, align_arg \n\
len_loop: \n\
lw r3, r5, r9 \n\
len_loop: \n"
LOAD4BYTES("r3", "r5", "r9")
" \n\
pcmpbf r4, r3, r0 \n\
bnei r4, end_len \n\
brid len_loop \n\