This commit was generated by cvs2svn to track changes on a CVS vendor
[deliverable/binutils-gdb.git] / sim / common / sim-endian.c
index 24dc7c5a945bcb4f38ae4fa06fbd6097e90aa6b0..36820284ffda2ba4c11649e46cdbd30a5669832b 100644 (file)
 #include "sim-n-endian.h"
 #undef N
 
+
+INLINE_SIM_ENDIAN\
+(unsigned_8)
+sim_endian_split_16 (unsigned_16 word, int w)
+{
+  if (CURRENT_HOST_BYTE_ORDER == LITTLE_ENDIAN)
+    {
+      return word.a[1 - w];
+    }
+  else
+    {
+      return word.a[w];
+    }
+}
+
+
+INLINE_SIM_ENDIAN\
+(unsigned_16)
+sim_endian_join_16 (unsigned_8 h, unsigned_8 l)
+
+{
+  unsigned_16 word;
+  if (CURRENT_HOST_BYTE_ORDER == LITTLE_ENDIAN)
+    {
+      word.a[0] = l;
+      word.a[1] = h;
+    }
+  else
+    {
+      word.a[0] = h;
+      word.a[1] = l;
+    }
+  return word;
+}
+
+
+
 #endif /* _SIM_ENDIAN_C_ */
This page took 0.023589 seconds and 4 git commands to generate.