X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fcommon%2Fcgen-ops.h;h=e8cce1b60b3c201e8d4e99f2813e63fb7116ea4c;hb=87f83f20023bf366c14ec4e0fd307948d96caaee;hp=87ca4836ba6225349036a3093add6aa7019a5299;hpb=e2882c85786571175a0b0bfc3bcd2f14620b1ea3;p=deliverable%2Fbinutils-gdb.git diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h index 87ca4836ba..e8cce1b60b 100644 --- a/sim/common/cgen-ops.h +++ b/sim/common/cgen-ops.h @@ -1,5 +1,5 @@ /* Semantics ops support for CGEN-based simulators. - Copyright (C) 1996-2018 Free Software Foundation, Inc. + Copyright (C) 1996-2020 Free Software Foundation, Inc. Contributed by Cygnus Solutions. This file is part of the GNU Simulators. @@ -404,7 +404,7 @@ SUBWORDXFSI (XF in, int word) /* Note: typedef struct { SI parts[3]; } XF; */ union { XF in; SI out[3]; } x; x.in = in; - if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG) return x.out[word]; else return x.out[2 - word]; @@ -416,7 +416,7 @@ SUBWORDTFSI (TF in, int word) /* Note: typedef struct { SI parts[4]; } TF; */ union { TF in; SI out[4]; } x; x.in = in; - if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG) return x.out[word]; else return x.out[3 - word]; @@ -432,7 +432,7 @@ SEMOPS_INLINE DF JOINSIDF (SI x0, SI x1) { union { SI in[2]; DF out; } x; - if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG) x.in[0] = x0, x.in[1] = x1; else x.in[1] = x0, x.in[0] = x1; @@ -443,7 +443,7 @@ SEMOPS_INLINE XF JOINSIXF (SI x0, SI x1, SI x2) { union { SI in[3]; XF out; } x; - if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG) x.in[0] = x0, x.in[1] = x1, x.in[2] = x2; else x.in[2] = x0, x.in[1] = x1, x.in[0] = x2; @@ -454,7 +454,7 @@ SEMOPS_INLINE TF JOINSITF (SI x0, SI x1, SI x2, SI x3) { union { SI in[4]; TF out; } x; - if (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG) + if (HOST_BYTE_ORDER == BFD_ENDIAN_BIG) x.in[0] = x0, x.in[1] = x1, x.in[2] = x2, x.in[3] = x3; else x.in[3] = x0, x.in[2] = x1, x.in[1] = x2, x.in[0] = x3; @@ -647,6 +647,38 @@ MUL1OFSI (USI a, USI b) return res; } +SEMOPS_INLINE BI +ADDCFDI (DI a, DI b, BI c) +{ + DI tmp = ADDDI (a, ADDDI (b, c)); + BI res = ((UDI) tmp < (UDI) a) || (c && tmp == a); + return res; +} + +SEMOPS_INLINE BI +ADDOFDI (DI a, DI b, BI c) +{ + DI tmp = ADDDI (a, ADDDI (b, c)); + BI res = (((a < 0) == (b < 0)) + && ((a < 0) != (tmp < 0))); + return res; +} + +SEMOPS_INLINE BI +SUBCFDI (DI a, DI b, BI c) +{ + BI res = ((UDI) a < (UDI) b) || (c && a == b); + return res; +} + +SEMOPS_INLINE BI +SUBOFDI (DI a, DI b, BI c) +{ + DI tmp = SUBDI (a, ADDSI (b, c)); + BI res = (((a < 0) != (b < 0)) + && ((a < 0) != (tmp < 0))); + return res; +} #else SI ADDCSI (SI, SI, BI); @@ -669,6 +701,10 @@ UBI SUBCFQI (QI, QI, BI); UBI SUBOFQI (QI, QI, BI); BI MUL1OFSI (SI a, SI b); BI MUL2OFSI (SI a, SI b); +BI ADDCFDI (DI a, DI b, BI c); +BI ADDOFDI (DI a, DI b, BI c); +BI SUBCFDI (DI a, DI b, BI c); +BI SUBOFDI (DI a, DI b, BI c); #endif