aboutsummaryrefslogtreecommitdiff
path: root/soft-fp/single.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-10-09 17:05:26 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-10-09 17:05:26 +0000
commit5c0508a318af0a6c8be2a4cb2e3b76896218bf35 (patch)
treebb4d0c9b22bad8ba022828c8a36dfeb69f511244 /soft-fp/single.h
parenta736ec370a05e4b37e6101eb3168bf8dc4c5af13 (diff)
downloadglibc-5c0508a318af0a6c8be2a4cb2e3b76896218bf35.zip
glibc-5c0508a318af0a6c8be2a4cb2e3b76896218bf35.tar.gz
glibc-5c0508a318af0a6c8be2a4cb2e3b76896218bf35.tar.bz2
soft-fp: Use parentheses around macro arguments.
This patch cleans up the soft-fp code to use parentheses around macro arguments (where possible; many macro arguments are identifiers used with ## rather than arbitrary expressions, so cannot be put in parentheses). (I'm not aware of any bugs caused by the lack of parentheses, but this is generally good practice. The patch is not exhaustive regarding internal macros where the arguments always come directly from the mantissa of a floating-point number, although probably those should be cleaned up in this regard as well.) Tested for powerpc-nofpu that the installed shared libraries are unchanged by this patch. * soft-fp/double.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_D): Use parentheses around macro arguments. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_DP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_RAW_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_RAW_DP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_DP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_DP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_DP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_DP): Likewise. [_FP_W_TYPE_SIZE < 64] (_FP_SQRT_MEAT_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_EQ_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_UNORD_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_TO_INT_D): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_FROM_INT_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_DP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_RAW_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_RAW_DP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_DP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_DP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_DP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_DP): Likewise. [_FP_W_TYPE_SIZE >= 64] (_FP_SQRT_MEAT_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_EQ_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_UNORD_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_D): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_FROM_INT_D): Likewise. * soft-fp/extended.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_EP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_EP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_EP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_EP): Likewise. [_FP_W_TYPE_SIZE < 64] (_FP_SQRT_MEAT_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_EQ_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_UNORD_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_TO_INT_E): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_FROM_INT_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_EP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_EP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_EP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_EP): Likewise. [_FP_W_TYPE_SIZE >= 64] (_FP_SQRT_MEAT_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_EQ_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_UNORD_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_FROM_INT_E): Likewise. * soft-fp/op-1.h (_FP_FRAC_SRST_1): Likewise. (_FP_FRAC_SRS_1): Likewise. (_FP_FRAC_CLZ_1): Likewise. (_FP_MUL_MEAT_1_imm): Likewise. (_FP_MUL_MEAT_1_wide): Likewise. (_FP_MUL_MEAT_1_hard): Likewise. (_FP_SQRT_MEAT_1): Likewise. (_FP_FRAC_ASSEMBLE_1): Likewise. (_FP_FRAC_DISASSEMBLE_1): Likewise. * soft-fp/op-2.h (_FP_FRAC_CLZ_2): Likewise. (__FP_CLZ_2): Likewise. (_FP_MUL_MEAT_2_wide): Likewise. (_FP_MUL_MEAT_2_wide_3mul): Likewise. (_FP_MUL_MEAT_2_gmp): Likewise. (_FP_MUL_MEAT_2_120_240_double): Likewise. (_FP_SQRT_MEAT_2): Likewise. (_FP_FRAC_ASSEMBLE_2): Likewise. (_FP_FRAC_DISASSEMBLE_2): Likewise. * soft-fp/op-4.h (_FP_FRAC_SRS_4): Likewise. (_FP_FRAC_CLZ_4): Likewise. (_FP_MUL_MEAT_4_wide): Likewise. (_FP_MUL_MEAT_4_gmp): Likewise. (_FP_SQRT_MEAT_4): Likewise. (_FP_FRAC_ASSEMBLE_4): Likewise. (_FP_FRAC_DISASSEMBLE_4): Likewise. * soft-fp/op-common.h (_FP_CMP): Likewise. (_FP_CMP_EQ): Likewise. (_FP_CMP_UNORD): Likewise. (_FP_TO_INT): Likewise. (_FP_FROM_INT): Likewise. [!__FP_CLZ] (__FP_CLZ): Likewise. (_FP_DIV_HELP_imm): Likewise. * soft-fp/quad.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_QP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_RAW_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_RAW_QP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_QP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_SEMIRAW_QP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_QP): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_PACK_SEMIRAW_QP): Likewise. [_FP_W_TYPE_SIZE < 64] (_FP_SQRT_MEAT_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_EQ_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_CMP_UNORD_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_TO_INT_Q): Likewise. [_FP_W_TYPE_SIZE < 64] (FP_FROM_INT_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_QP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_RAW_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_RAW_QP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_QP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_SEMIRAW_QP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_QP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_PACK_SEMIRAW_QP): Likewise. [_FP_W_TYPE_SIZE >= 64] (_FP_SQRT_MEAT_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_EQ_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_CMP_UNORD_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_TO_INT_Q): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_FROM_INT_Q): Likewise. * soft-fp/single.h (FP_UNPACK_RAW_S): Likewise. (FP_UNPACK_RAW_SP): Likewise. (FP_PACK_RAW_S): Likewise. (FP_PACK_RAW_SP): Likewise. (FP_UNPACK_S): Likewise. (FP_UNPACK_SP): Likewise. (FP_UNPACK_SEMIRAW_S): Likewise. (FP_UNPACK_SEMIRAW_SP): Likewise. (FP_PACK_S): Likewise. (FP_PACK_SP): Likewise. (FP_PACK_SEMIRAW_S): Likewise. (FP_PACK_SEMIRAW_SP): Likewise. (_FP_SQRT_MEAT_S): Likewise. (FP_CMP_S): Likewise. (FP_CMP_EQ_S): Likewise. (FP_CMP_UNORD_S): Likewise. (FP_TO_INT_S): Likewise. (FP_FROM_INT_S): Likewise.
Diffstat (limited to 'soft-fp/single.h')
-rw-r--r--soft-fp/single.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/soft-fp/single.h b/soft-fp/single.h
index efa8294..086a558 100644
--- a/soft-fp/single.h
+++ b/soft-fp/single.h
@@ -83,21 +83,21 @@ union _FP_UNION_S
};
#define FP_DECL_S(X) _FP_DECL (1, X)
-#define FP_UNPACK_RAW_S(X, val) _FP_UNPACK_RAW_1 (S, X, val)
-#define FP_UNPACK_RAW_SP(X, val) _FP_UNPACK_RAW_1_P (S, X, val)
-#define FP_PACK_RAW_S(val, X) _FP_PACK_RAW_1 (S, val, X)
+#define FP_UNPACK_RAW_S(X, val) _FP_UNPACK_RAW_1 (S, X, (val))
+#define FP_UNPACK_RAW_SP(X, val) _FP_UNPACK_RAW_1_P (S, X, (val))
+#define FP_PACK_RAW_S(val, X) _FP_PACK_RAW_1 (S, (val), X)
#define FP_PACK_RAW_SP(val, X) \
do \
{ \
if (!FP_INHIBIT_RESULTS) \
- _FP_PACK_RAW_1_P (S, val, X); \
+ _FP_PACK_RAW_1_P (S, (val), X); \
} \
while (0)
#define FP_UNPACK_S(X, val) \
do \
{ \
- _FP_UNPACK_RAW_1 (S, X, val); \
+ _FP_UNPACK_RAW_1 (S, X, (val)); \
_FP_UNPACK_CANONICAL (S, 1, X); \
} \
while (0)
@@ -105,7 +105,7 @@ union _FP_UNION_S
#define FP_UNPACK_SP(X, val) \
do \
{ \
- _FP_UNPACK_RAW_1_P (S, X, val); \
+ _FP_UNPACK_RAW_1_P (S, X, (val)); \
_FP_UNPACK_CANONICAL (S, 1, X); \
} \
while (0)
@@ -113,7 +113,7 @@ union _FP_UNION_S
#define FP_UNPACK_SEMIRAW_S(X, val) \
do \
{ \
- _FP_UNPACK_RAW_1 (S, X, val); \
+ _FP_UNPACK_RAW_1 (S, X, (val)); \
_FP_UNPACK_SEMIRAW (S, 1, X); \
} \
while (0)
@@ -121,7 +121,7 @@ union _FP_UNION_S
#define FP_UNPACK_SEMIRAW_SP(X, val) \
do \
{ \
- _FP_UNPACK_RAW_1_P (S, X, val); \
+ _FP_UNPACK_RAW_1_P (S, X, (val)); \
_FP_UNPACK_SEMIRAW (S, 1, X); \
} \
while (0)
@@ -130,7 +130,7 @@ union _FP_UNION_S
do \
{ \
_FP_PACK_CANONICAL (S, 1, X); \
- _FP_PACK_RAW_1 (S, val, X); \
+ _FP_PACK_RAW_1 (S, (val), X); \
} \
while (0)
@@ -139,7 +139,7 @@ union _FP_UNION_S
{ \
_FP_PACK_CANONICAL (S, 1, X); \
if (!FP_INHIBIT_RESULTS) \
- _FP_PACK_RAW_1_P (S, val, X); \
+ _FP_PACK_RAW_1_P (S, (val), X); \
} \
while (0)
@@ -147,7 +147,7 @@ union _FP_UNION_S
do \
{ \
_FP_PACK_SEMIRAW (S, 1, X); \
- _FP_PACK_RAW_1 (S, val, X); \
+ _FP_PACK_RAW_1 (S, (val), X); \
} \
while (0)
@@ -156,7 +156,7 @@ union _FP_UNION_S
{ \
_FP_PACK_SEMIRAW (S, 1, X); \
if (!FP_INHIBIT_RESULTS) \
- _FP_PACK_RAW_1_P (S, val, X); \
+ _FP_PACK_RAW_1_P (S, (val), X); \
} \
while (0)
@@ -167,7 +167,7 @@ union _FP_UNION_S
#define FP_MUL_S(R, X, Y) _FP_MUL (S, 1, R, X, Y)
#define FP_DIV_S(R, X, Y) _FP_DIV (S, 1, R, X, Y)
#define FP_SQRT_S(R, X) _FP_SQRT (S, 1, R, X)
-#define _FP_SQRT_MEAT_S(R, S, T, X, Q) _FP_SQRT_MEAT_1 (R, S, T, X, Q)
+#define _FP_SQRT_MEAT_S(R, S, T, X, Q) _FP_SQRT_MEAT_1 (R, S, T, X, (Q))
#if _FP_W_TYPE_SIZE < 64
# define FP_FMA_S(R, X, Y, Z) _FP_FMA (S, 1, 2, R, X, Y, Z)
@@ -175,12 +175,12 @@ union _FP_UNION_S
# define FP_FMA_S(R, X, Y, Z) _FP_FMA (S, 1, 1, R, X, Y, Z)
#endif
-#define FP_CMP_S(r, X, Y, un, ex) _FP_CMP (S, 1, r, X, Y, un, ex)
-#define FP_CMP_EQ_S(r, X, Y, ex) _FP_CMP_EQ (S, 1, r, X, Y, ex)
-#define FP_CMP_UNORD_S(r, X, Y, ex) _FP_CMP_UNORD (S, 1, r, X, Y, ex)
+#define FP_CMP_S(r, X, Y, un, ex) _FP_CMP (S, 1, (r), X, Y, (un), (ex))
+#define FP_CMP_EQ_S(r, X, Y, ex) _FP_CMP_EQ (S, 1, (r), X, Y, (ex))
+#define FP_CMP_UNORD_S(r, X, Y, ex) _FP_CMP_UNORD (S, 1, (r), X, Y, (ex))
-#define FP_TO_INT_S(r, X, rsz, rsg) _FP_TO_INT (S, 1, r, X, rsz, rsg)
-#define FP_FROM_INT_S(X, r, rs, rt) _FP_FROM_INT (S, 1, X, r, rs, rt)
+#define FP_TO_INT_S(r, X, rsz, rsg) _FP_TO_INT (S, 1, (r), X, (rsz), (rsg))
+#define FP_FROM_INT_S(X, r, rs, rt) _FP_FROM_INT (S, 1, X, (r), (rs), rt)
#define _FP_FRAC_HIGH_S(X) _FP_FRAC_HIGH_1 (X)
#define _FP_FRAC_HIGH_RAW_S(X) _FP_FRAC_HIGH_1 (X)