register int len;
struct type *type1, *type2, *valptrtype;
- COERCE_ARRAY (arg1);
- COERCE_ARRAY (arg2);
+ COERCE_NUMBER (arg1);
+ COERCE_NUMBER (arg2);
type1 = check_typedef (VALUE_TYPE (arg1));
type2 = check_typedef (VALUE_TYPE (arg2));
value_ptr arg1, arg2;
{
struct type *type1, *type2;
- COERCE_ARRAY (arg1);
- COERCE_ARRAY (arg2);
+ COERCE_NUMBER (arg1);
+ COERCE_NUMBER (arg2);
type1 = check_typedef (VALUE_TYPE (arg1));
type2 = check_typedef (VALUE_TYPE (arg2));
byte = *((char*)VALUE_CONTENTS (array) + offset);
bit_index = index % TARGET_CHAR_BIT;
byte >>= (BITS_BIG_ENDIAN ? TARGET_CHAR_BIT - 1 - bit_index : bit_index);
- v = value_from_longest (builtin_type_int, byte & 1);
+ v = value_from_longest (LA_BOOL_TYPE, byte & 1);
VALUE_BITPOS (v) = bit_index;
VALUE_BITSIZE (v) = 1;
VALUE_LVAL (v) = VALUE_LVAL (array);
value_ptr arg1, arg2;
{
struct type *type1, *type2;
- if (op == BINOP_ASSIGN)
+ if (op == BINOP_ASSIGN || op == BINOP_CONCAT)
return 0;
type1 = check_typedef (VALUE_TYPE (arg1));
type2 = check_typedef (VALUE_TYPE (arg2));
char tstr[13], mangle_tstr[13];
int static_memfuncp;
+ COERCE_REF (arg1);
COERCE_ENUM (arg1);
/* now we know that what we have to do is construct our
struct type *type1 = check_typedef (VALUE_TYPE (arg1));
struct type *type2 = check_typedef (VALUE_TYPE (arg2));
+ COERCE_VARYING_ARRAY (arg1, type1);
+ COERCE_VARYING_ARRAY (arg2, type2);
+
/* First figure out if we are dealing with two values to be concatenated
or a repeat count and a value to be repeated. INVAL1 is set to the
first of two concatenated values, or the repeat count. INVAL2 is set
register value_ptr val;
struct type *type1, *type2;
+ COERCE_REF (arg1);
+ COERCE_REF (arg2);
COERCE_ENUM (arg1);
COERCE_ENUM (arg2);
type1 = check_typedef (VALUE_TYPE (arg1));
/* FIXME-if-picky-about-floating-accuracy: Should be doing this
in target format. real.c in GCC probably has the necessary
code. */
- double v1, v2, v;
+ DOUBLEST v1, v2, v;
v1 = value_as_double (arg1);
v2 = value_as_double (arg2);
switch (op)
error ("Integer-only operation on floating point number.");
}
- val = allocate_value (builtin_type_double);
+ /* If either arg was long double, make sure that value is also long
+ double. */
+
+ if (TYPE_LENGTH(type1) * 8 > TARGET_DOUBLE_BIT
+ || TYPE_LENGTH(type2) * 8 > TARGET_DOUBLE_BIT)
+ val = allocate_value (builtin_type_long_double);
+ else
+ val = allocate_value (builtin_type_double);
+
store_floating (VALUE_CONTENTS_RAW (val), TYPE_LENGTH (VALUE_TYPE (val)),
v);
}
register char *p;
struct type *type1;
- COERCE_ARRAY (arg1);
+ COERCE_NUMBER (arg1);
type1 = check_typedef (VALUE_TYPE (arg1));
if (TYPE_CODE (type1) == TYPE_CODE_FLT)
enum type_code code1;
enum type_code code2;
- COERCE_ARRAY (arg1);
- COERCE_ARRAY (arg2);
+ COERCE_NUMBER (arg1);
+ COERCE_NUMBER (arg2);
type1 = check_typedef (VALUE_TYPE (arg1));
type2 = check_typedef (VALUE_TYPE (arg2));
register enum type_code code2;
struct type *type1, *type2;
- COERCE_ARRAY (arg1);
- COERCE_ARRAY (arg2);
+ COERCE_NUMBER (arg1);
+ COERCE_NUMBER (arg2);
type1 = check_typedef (VALUE_TYPE (arg1));
type2 = check_typedef (VALUE_TYPE (arg2));
{
register struct type *type;
+ COERCE_REF (arg1);
COERCE_ENUM (arg1);
type = check_typedef (VALUE_TYPE (arg1));
value_complement (arg1)
register value_ptr arg1;
{
+ COERCE_REF (arg1);
COERCE_ENUM (arg1);
if (TYPE_CODE (check_typedef (VALUE_TYPE (arg1))) != TYPE_CODE_INT)