- if (TYPE_CODE (type1) == TYPE_CODE_DECFLOAT
- || TYPE_CODE (type2) == TYPE_CODE_DECFLOAT)
- {
- int len_v1, len_v2, len_v;
- enum bfd_endian byte_order_v1, byte_order_v2, byte_order_v;
- gdb_byte v1[16], v2[16];
- gdb_byte v[16];
-
- /* If only one type is decimal float, use its type.
- Otherwise use the bigger type. */
- if (TYPE_CODE (type1) != TYPE_CODE_DECFLOAT)
- result_type = type2;
- else if (TYPE_CODE (type2) != TYPE_CODE_DECFLOAT)
- result_type = type1;
- else if (TYPE_LENGTH (type2) > TYPE_LENGTH (type1))
- result_type = type2;
- else
- result_type = type1;
-
- len_v = TYPE_LENGTH (result_type);
- byte_order_v = gdbarch_byte_order (get_type_arch (result_type));
-
- value_args_as_decimal (arg1, arg2, v1, &len_v1, &byte_order_v1,
- v2, &len_v2, &byte_order_v2);
-
- switch (op)
- {
- case BINOP_ADD:
- case BINOP_SUB:
- case BINOP_MUL:
- case BINOP_DIV:
- case BINOP_EXP:
- decimal_binop (op, v1, len_v1, byte_order_v1,
- v2, len_v2, byte_order_v2,
- v, len_v, byte_order_v);
- break;
-
- default:
- error (_("Operation not valid for decimal floating point number."));
- }
-
- val = value_from_decfloat (result_type, v);
- }
- else if (TYPE_CODE (type1) == TYPE_CODE_FLT
- || TYPE_CODE (type2) == TYPE_CODE_FLT)