This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH FIX PR34210,35508 : Missing HI mode libgcc functions
- From: Andy H <hutchinsonandy at aim dot com>
- To: gcc-patches at gcc dot gnu dot org, rask at gcc dot gnu dot org
- Cc: "Weddington, Eric" <eweddington at cso dot atmel dot com>, Anatoly Sokolov <aesok at post dot ru>
- Date: Sat, 22 Mar 2008 20:22:33 -0400
- Subject: PATCH FIX PR34210,35508 : Missing HI mode libgcc functions
The attached patch creates 16bit libgcc functions currently missing for
AVR target.
_absvhi2 _addvhi3 _subvhi3 _mulvhi3 _negvhi2 _ffshi2 _clzhi2
_ctzhi2 _popcounthi2 _parityhi2
The method used is to compile libgcc using siditi-object.mk to define
LIBGCC2_UNITS_PER_WORD=2.
- as described by /Rask Ingemann Lambertsen in PR34210
/The patch creates libgcc/config/avr/t-avr, and modfies config.host to
include this fragment during libgcc build for avr target.
The patch resolves several testsuite FAILS caused by the missing
functions and the following PR's
/http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34210
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35508
Bootstrapped AVR target c,c++ on i686-pc-linux and i686-pc-cygwin
PLEASE let me know if there are additional maintainers that I should
ask for approval of this patch
Andy
/
Index: config.host
===================================================================
--- config.host (revision 132947)
+++ config.host (working copy)
@@ -77,6 +77,9 @@
arm*-*-*)
cpu_type=arm
;;
+avr-*-*)
+ cpu_type=avr
+ ;;
bfin*-*)
cpu_type=bfin
;;
@@ -243,6 +246,8 @@
avr-*-rtems*)
;;
avr-*-*)
+ # Make HImode functions for AVR
+ tmake_file=${cpu_type}/t-avr
;;
bfin*-elf*)
;;
Index: config/avr/t-avr
===================================================================
--- config/avr/t-avr (revision 0)
+++ config/avr/t-avr (revision 0)
@@ -0,0 +1,19 @@
+# Extra 16-bit integer functions.
+intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _ffsXX2 _clzXX2 \
+ _ctzXX2 _popcountXX2 _parityXX2
+hiintfuncs16 = $(subst XX,hi,$(intfuncs16))
+siintfuncs16 = $(subst XX,si,$(intfuncs16))
+
+iter-items := $(hiintfuncs16)
+iter-labels := $(siintfuncs16)
+iter-sizes := $(patsubst %,2,$(siintfuncs16)) $(patsubst %,2,$(hiintfuncs16))
+
+
+include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items))
+libgcc-objects += $(patsubst %,%$(objext),$(hiintfuncs16))
+
+ifeq ($(enable_shared),yes)
+libgcc-s-objects += $(patsubst %,%_s$(objext),$(hiintfuncs16))
+endif
+
+
Index: config/avr/t-avr
===================================================================
--- config/avr/t-avr (revision 0)
+++ config/avr/t-avr (revision 0)
@@ -0,0 +1,19 @@
+# Extra 16-bit integer functions.
+intfuncs16 = _absvXX2 _addvXX3 _subvXX3 _mulvXX3 _negvXX2 _ffsXX2 _clzXX2 \
+ _ctzXX2 _popcountXX2 _parityXX2
+hiintfuncs16 = $(subst XX,hi,$(intfuncs16))
+siintfuncs16 = $(subst XX,si,$(intfuncs16))
+
+iter-items := $(hiintfuncs16)
+iter-labels := $(siintfuncs16)
+iter-sizes := $(patsubst %,2,$(siintfuncs16)) $(patsubst %,2,$(hiintfuncs16))
+
+
+include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items))
+libgcc-objects += $(patsubst %,%$(objext),$(hiintfuncs16))
+
+ifeq ($(enable_shared),yes)
+libgcc-s-objects += $(patsubst %,%_s$(objext),$(hiintfuncs16))
+endif
+
+