Add org.gnu.gdb.i386.avx.
[deliverable/binutils-gdb.git] / sim / common / cgen-ops.h
index 063bf7af4a3ee7d0cef583b21abe5f31f92fb46a..b6f38cfd33dac3d59d8a1c1427d4dc4a2d0b0a5b 100644 (file)
@@ -1,5 +1,5 @@
 /* Semantics ops support for CGEN-based simulators.
-   Copyright (C) 1996, 1997, 1998, 1999, 2002, 2007, 2008
+   Copyright (C) 1996, 1997, 1998, 1999, 2002, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
    Contributed by Cygnus Solutions.
 
@@ -404,7 +404,10 @@ SUBWORDXFSI (XF in, int word)
   /* Note: typedef struct { SI parts[3]; } XF; */
   union { XF in; SI out[3]; } x;
   x.in = in;
-  return x.out[word];
+  if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
+    return x.out[word];
+  else
+    return x.out[2 - word];
 }
 
 SEMOPS_INLINE SI
@@ -413,16 +416,16 @@ SUBWORDTFSI (TF in, int word)
   /* Note: typedef struct { SI parts[4]; } TF; */
   union { TF in; SI out[4]; } x;
   x.in = in;
-  return x.out[word];
+  if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
+    return x.out[word];
+  else
+    return x.out[3 - word];
 }
 
 SEMOPS_INLINE DI
 JOINSIDI (SI x0, SI x1)
 {
-  if (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN)
-    return MAKEDI (x0, x1);
-  else
-    return MAKEDI (x1, x0);
+  return MAKEDI (x0, x1);
 }
 
 SEMOPS_INLINE DF
This page took 0.022677 seconds and 4 git commands to generate.