Package: cbmc
Version: 4.5
Severity: important
Tags: patch

This patch add support with mips abi n32, n64, tested on mips64el already.

Regards,
Sphinx Jiang
--- a/src/util/config.cpp
+++ b/src/util/config.cpp
@@ -463,13 +463,26 @@
 
 void configt::ansi_ct::set_arch_spec_mips(const irep_idt &subarch)
 {
-  set_ILP32();
   arch=ARCH_MIPS;
-  if(subarch=="mipsel")
+  if(subarch=="mipsel"    || 
+     subarch=="mips"      ||
+     subarch=="mipsn32el" ||
+     subarch=="mipsn32")
+   {
+    set_ILP32();
+    long_double_width=8*8;
+   }
+  else
+   {
+    set_LP64();
+    long_double_width=16*8;
+   }
+  if(subarch=="mipsel"     ||
+     subarch=="mipsn32el"  ||
+     subarch=="mips64el")
     endianness=IS_LITTLE_ENDIAN;
   else
     endianness=IS_BIG_ENDIAN;
-  long_double_width=8*8;
   char_is_unsigned=false;
 
   switch(mode)
@@ -836,7 +849,11 @@
           arch=="armhf" ||
           arch=="arm")
     ansi_c.set_arch_spec_arm(arch);
-  else if(arch=="mipsel" ||
+  else if(arch=="mips64el"  ||
+	  arch=="mipsn32el" ||
+	  arch=="mipsel"    ||
+	  arch=="mips64"    ||
+	  arch=="mipsn32"   ||
           arch=="mips")
     ansi_c.set_arch_spec_mips(arch);
   else if(arch=="powerpc" ||
@@ -1064,9 +1081,21 @@
     this_arch="arm";
     #endif
   #elif __mipsel__
-  this_arch="mipsel";
+    #if _MIPS_SIM==_ABIO32
+    this_arch="mipsel";
+    #elif _MIPS_SIM==_ABIN32
+    this_arch="mipsn32el";
+    #else
+    this_arch="mips64el";
+    #endif
   #elif __mips__
-  this_arch="mips";
+    #if _MIPS_SIM==_ABIO32
+    this_arch="mips";
+    #elif _MIPS_SIM==_ABIN32
+    this_arch="mipsn32";
+    #else
+    this_arch="mips64";
+    #endif
   #elif __powerpc__
   this_arch="powerpc";
   #elif __ppc64__

Reply via email to