2008-02-13 Thiago Jung Bauermann * amd64-tdep.c (amd64_classify): Add support for decimal float types. * i386-tdep.c (i386_return_value): Make 128-bit decimal float use the struct return convention. diff -r 4210c09bccd5 -r ada730f9adc3 gdb/amd64-tdep.c --- a/gdb/amd64-tdep.c Mon Feb 11 03:15:07 2008 -0800 +++ b/gdb/amd64-tdep.c Wed Feb 13 14:03:14 2008 -0200 @@ -364,15 +364,19 @@ amd64_classify (struct type *type, enum && (len == 1 || len == 2 || len == 4 || len == 8)) class[0] = AMD64_INTEGER; - /* Arguments of types float, double and __m64 are in class SSE. */ - else if (code == TYPE_CODE_FLT && (len == 4 || len == 8)) + /* Arguments of types float, double, _Decimal32, _Decimal64 and __m64 + are in class SSE. */ + else if ((code == TYPE_CODE_FLT || code == TYPE_CODE_DECFLOAT) + && (len == 4 || len == 8)) /* FIXME: __m64 . */ class[0] = AMD64_SSE; - /* Arguments of types __float128 and __m128 are split into two - halves. The least significant ones belong to class SSE, the most + /* Arguments of types __float128, _Decimal128 and __m128 are split into + two halves. The least significant ones belong to class SSE, the most significant one to class SSEUP. */ - /* FIXME: __float128, __m128. */ + else if (code == TYPE_CODE_DECFLOAT && len == 16) + /* FIXME: __float128, __m128. */ + class[0] = AMD64_SSE, class[1] = AMD64_SSEUP; /* The 64-bit mantissa of arguments of type long double belongs to class X87, the 16-bit exponent plus 6 bytes of padding belongs to diff -r 4210c09bccd5 -r ada730f9adc3 gdb/i386-tdep.c --- a/gdb/i386-tdep.c Mon Feb 11 03:15:07 2008 -0800 +++ b/gdb/i386-tdep.c Wed Feb 13 14:03:14 2008 -0200 @@ -1579,10 +1579,12 @@ i386_return_value (struct gdbarch *gdbar { enum type_code code = TYPE_CODE (type); - if ((code == TYPE_CODE_STRUCT - || code == TYPE_CODE_UNION - || code == TYPE_CODE_ARRAY) - && !i386_reg_struct_return_p (gdbarch, type)) + if (((code == TYPE_CODE_STRUCT + || code == TYPE_CODE_UNION + || code == TYPE_CODE_ARRAY) + && !i386_reg_struct_return_p (gdbarch, type)) + /* 128-bit decimal float uses the struct return convention. */ + || (code == TYPE_CODE_DECFLOAT && TYPE_LENGTH (type) == 16)) { /* The System V ABI says that: