This commit was generated by cvs2svn to track changes on a CVS vendor
[deliverable/binutils-gdb.git] / sim / common / sim-n-endian.h
index 840b467ddb260b7f90c22d3c89335bd5eeb3e7e5..c53e05a9a1749f9f13c3f5b102c7f53ba17fa849 100644 (file)
@@ -23,6 +23,8 @@
 #error "N must be #defined"
 #endif
 
+#include "symcat.h"
+
 /* NOTE: See end of file for #undef */
 #define unsigned_N XCONCAT2(unsigned_,N)
 #define endian_t2h_N XCONCAT2(endian_t2h_,N)
@@ -35,6 +37,7 @@
 #define endian_le2h_N XCONCAT2(endian_le2h_,N)
 #define offset_N XCONCAT2(offset_,N)
 
+/* TAGS: endian_t2h_1 endian_t2h_2 endian_t2h_4 endian_t2h_8 endian_t2h_16 */
 
 INLINE_SIM_ENDIAN\
 (unsigned_N)
@@ -48,6 +51,7 @@ endian_t2h_N(unsigned_N raw_in)
   }
 }
 
+/* TAGS: endian_h2t_1 endian_h2t_2 endian_h2t_4 endian_h2t_8 endian_h2t_16 */
 
 INLINE_SIM_ENDIAN\
 (unsigned_N)
@@ -61,6 +65,7 @@ endian_h2t_N(unsigned_N raw_in)
   }
 }
 
+/* TAGS: swap_1 swap_2 swap_4 swap_8 swap_16 */
 
 INLINE_SIM_ENDIAN\
 (unsigned_N)
@@ -69,7 +74,7 @@ swap_N(unsigned_N raw_in)
   _SWAP_N(return,raw_in);
 }
 
-
+/* TAGS: endian_h2be_1 endian_h2be_2 endian_h2be_4 endian_h2be_8 endian_h2be_16 */
 
 INLINE_SIM_ENDIAN\
 (unsigned_N)
@@ -83,6 +88,7 @@ endian_h2be_N(unsigned_N raw_in)
   }
 }
 
+/* TAGS: endian_be2h_1 endian_be2h_2 endian_be2h_4 endian_be2h_8 endian_be2h_16 */
 
 INLINE_SIM_ENDIAN\
 (unsigned_N)
@@ -96,6 +102,7 @@ endian_be2h_N(unsigned_N raw_in)
   }
 }
 
+/* TAGS: endian_h2le_1 endian_h2le_2 endian_h2le_4 endian_h2le_8 endian_h2le_16 */
 
 INLINE_SIM_ENDIAN\
 (unsigned_N)
@@ -109,6 +116,7 @@ endian_h2le_N(unsigned_N raw_in)
   }
 }
 
+/* TAGS: endian_le2h_1 endian_le2h_2 endian_le2h_4 endian_le2h_8 endian_le2h_16 */
 
 INLINE_SIM_ENDIAN\
 (unsigned_N)
@@ -122,26 +130,28 @@ endian_le2h_N(unsigned_N raw_in)
   }
 }
 
-
+/* TAGS: offset_1 offset_2 offset_4 offset_8 offset_16 */
 
 INLINE_SIM_ENDIAN\
 (void*)
-offset_N(unsigned_N *x,
-        int sizeof_word,
-        int word)
+offset_N (unsigned_N *x,
+         unsigned sizeof_word,
+         unsigned word)
 {
   char *in = (char*)x;
   char *out;
-  int offset = sizeof_word * word;
-  ASSERT(offset + sizeof_word <= sizeof(unsigned_N));
-  ASSERT(word < (sizeof_word / sizeof(unsigned_N)));
-  ASSERT((sizeof(unsigned_N) % sizeof_word) == 0);
-  if (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN) {
-    out = in + sizeof(unsigned_N) - offset;
-  }
-  else {
-    out = in + offset;
-  }
+  unsigned offset = sizeof_word * word;
+  ASSERT (offset + sizeof_word <= sizeof(unsigned_N));
+  ASSERT (word < (sizeof (unsigned_N) / sizeof_word));
+  ASSERT ((sizeof (unsigned_N) % sizeof_word) == 0);
+  if (WITH_HOST_BYTE_ORDER == LITTLE_ENDIAN)
+    {
+      out = in + sizeof (unsigned_N) - offset - sizeof_word;
+    }
+  else
+    {
+      out = in + offset;
+    }
   return out;
 }
 
This page took 0.024044 seconds and 4 git commands to generate.