This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[patch, mips] Fix memcpy for mipsisa64-elf target
- From: "Steve Ellcey " <sellcey at mips dot com>
- To: <newlib at sourceware dot org>
- Cc: <stevenb dot gcc at gmail dot com>
- Date: Mon, 7 Jan 2013 09:30:23 -0800
- Subject: [patch, mips] Fix memcpy for mipsisa64-elf target
Steven Bosscher discovered a problem with my new MIPS memcpy.S routine
when built for the mipsisa64-elf target. I would like to check in this
fix for the problem.
The issue is that for the mipsisa64-elf target _MIPS_SIM is not defined
and we need to check for that.
I built mipsisa64-elf using this patch and also tested it on various other
mips targets including mips-mti-elf and mips-mti-linux.
OK to checkin?
Steve Ellcey
sellcey@mips.com
2013-01-07 Steve Ellcey <sellcey@mips.com>
* libc/machine/mips/memcpy.S (memcpy): Check if _MIPS_SIM is set.
diff --git a/newlib/libc/machine/mips/memcpy.S b/newlib/libc/machine/mips/memcpy.S
index fe7cb15..574f549 100644
--- a/newlib/libc/machine/mips/memcpy.S
+++ b/newlib/libc/machine/mips/memcpy.S
@@ -56,7 +56,7 @@
#endif
#endif
-#if (_MIPS_SIM == _ABI64) || (_MIPS_SIM == _ABIN32)
+#if defined(_MIPS_SIM) && ((_MIPS_SIM == _ABI64) || (_MIPS_SIM == _ABIN32))
#ifndef DISABLE_DOUBLE
#define USE_DOUBLE
#endif
@@ -203,7 +203,7 @@
#define REG1 t1
#define REG2 t2
#define REG3 t3
-#if _MIPS_SIM == _ABIO32
+#if defined(_MIPS_SIM) && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64)
# define REG4 t4
# define REG5 t5
# define REG6 t6