diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a6a5d0f812c735fb1f562d685ddc01250b058c66..30d464433a3fe65d45dcd01f44b85bd923bb7894 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2007-12-15  Hans-Peter Nilsson  <hp@axis.com>
+
+	* configure.host (try_cpu settings): Set try_cpu=cris for crisv32.
+	* config/cpu/cris/atomicity.h (__exchange_and_add)
+	[__CRIS_arch_version >= 32]: Add support for CRIS v32.
+
 2007-12-15  Benjamin Kosnik  <bkoz@redhat.com>
 	    Paolo Carlini  <pcarlini@suse.de>
 	
diff --git a/libstdc++-v3/config/cpu/cris/atomicity.h b/libstdc++-v3/config/cpu/cris/atomicity.h
index da16a1aacee7ba79f0b3cf3c948f1bfc867dd4d4..56dd0edcdd595c7e42bd20709e9cb1a2c6057b26 100644
--- a/libstdc++-v3/config/cpu/cris/atomicity.h
+++ b/libstdc++-v3/config/cpu/cris/atomicity.h
@@ -37,7 +37,20 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
     int __tmp;
     _Atomic_word __result;
 
-#if (__CRIS_arch_version >= 10)
+#if (__CRIS_arch_version >= 32)
+  __asm__ __volatile__ (" clearf p	       \n"
+		       "0:		       \n"
+		       " move.d %4,%2	       \n"
+		       " move.d [%3],%0	       \n"
+		       " add.d %0,%2	       \n"
+		       " ax		       \n"
+		       " move.d %2,[%3]	       \n"
+		       " bcs 0b		       \n"
+		       " clearf p	       \n"
+		       :  "=&r" (__result), "=Q" (*__mem), "=&r" (__tmp)
+		       : "r" (__mem), "g" (__val), "Q" (*__mem)
+		       : "memory");
+#elif (__CRIS_arch_version >= 10)
     __asm__ __volatile__ (" clearf		\n"
 			"0:			\n"
 			" move.d %4,%2		\n"
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index 17421286f06a2e851faf051c3862b1c848b6b50f..c994b5e71455c90096b87783ccc18f63c76ddf5e 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -94,6 +94,9 @@ case "${host_cpu}" in
   arm* | xscale | ep9312)
     try_cpu=arm
     ;;
+  crisv32)
+    try_cpu=cris
+    ;;
   i[567]86 | x86_64)
     try_cpu=i486
     ;;