Commit 451d5043 authored by Alexandre Julliard's avatar Alexandre Julliard

winebuild: Add int64, int128 and float argument types.

parent e0188c83
......@@ -68,7 +68,10 @@ enum arg_type
ARG_PTR, /* pointer */
ARG_STR, /* pointer to Ansi string */
ARG_WSTR, /* pointer to Unicode string */
ARG_DOUBLE, /* floating point double */
ARG_INT64, /* 64-bit integer */
ARG_INT128, /* 128-bit integer */
ARG_FLOAT, /* 32-bit float */
ARG_DOUBLE, /* 64-bit float */
ARG_MAXARG = ARG_DOUBLE
};
......
......@@ -82,6 +82,9 @@ static const char * const ArgNames[ARG_MAXARG + 1] =
"ptr", /* ARG_PTR */
"str", /* ARG_STR */
"wstr", /* ARG_WSTR */
"int64", /* ARG_INT64 */
"int128", /* ARG_INT128 */
"float", /* ARG_FLOAT */
"double" /* ARG_DOUBLE */
};
......
......@@ -78,11 +78,14 @@ static const char *get_args_str( const ORDDEF *odp )
case ARG_SWORD: strcat( buffer, "s" ); break;
case ARG_SEGSTR: strcat( buffer, "T" ); break;
case ARG_STR: strcat( buffer, "t" ); break;
case ARG_DOUBLE: strcat( buffer, "ll" ); break;
case ARG_LONG:
case ARG_FLOAT:
case ARG_SEGPTR: strcat( buffer, "l" ); break;
case ARG_PTR:
case ARG_WSTR: strcat( buffer, "p" ); break;
case ARG_WSTR:
case ARG_INT128: strcat( buffer, "p" ); break;
case ARG_INT64:
case ARG_DOUBLE: strcat( buffer, "ll" ); break;
}
}
return buffer;
......@@ -288,8 +291,11 @@ static int get_function_argsize( const ORDDEF *odp )
case ARG_PTR:
case ARG_STR:
case ARG_WSTR:
case ARG_FLOAT:
case ARG_INT128:
argsize += 4;
break;
case ARG_INT64:
case ARG_DOUBLE:
argsize += 8;
break;
......@@ -362,7 +368,7 @@ static void output_call16_function( ORDDEF *odp )
/* preserve 16-byte stack alignment */
stack_words += odp->u.func.nb_args;
for (i = 0; i < odp->u.func.nb_args; i++)
if (odp->u.func.args[i] == ARG_DOUBLE) stack_words++;
if (odp->u.func.args[i] == ARG_DOUBLE || odp->u.func.args[i] == ARG_INT64) stack_words++;
if ((odp->flags & FLAG_REGISTER) || (odp->type == TYPE_VARARGS)) stack_words++;
if (stack_words % 4) output( "\tsubl $%d,%%esp\n", 16 - 4 * (stack_words % 4) );
......@@ -398,12 +404,14 @@ static void output_call16_function( ORDDEF *odp )
if (odp->type == TYPE_PASCAL) pos += 2;
break;
case ARG_INT64:
case ARG_DOUBLE:
if (odp->type != TYPE_PASCAL) pos -= 4;
output( "\tpushl %d(%%ecx)\n", pos );
if (odp->type == TYPE_PASCAL) pos += 4;
/* fall through */
case ARG_LONG:
case ARG_FLOAT:
case ARG_SEGPTR:
case ARG_SEGSTR:
if (odp->type != TYPE_PASCAL) pos -= 4;
......@@ -414,6 +422,7 @@ static void output_call16_function( ORDDEF *odp )
case ARG_PTR:
case ARG_STR:
case ARG_WSTR:
case ARG_INT128:
if (odp->type != TYPE_PASCAL) pos -= 4;
output( "\tmovzwl %d(%%ecx),%%edx\n", pos + 2 ); /* sel */
output( "\tshr $3,%%edx\n" );
......@@ -707,6 +716,9 @@ static void output_module16( DLLSPEC *spec )
case ARG_PTR: type = ARG16_PTR; break;
case ARG_STR: type = ARG16_STR; break;
case ARG_WSTR: type = ARG16_PTR; break;
case ARG_FLOAT: type = ARG16_LONG; break;
case ARG_INT128: type = ARG16_PTR; break;
case ARG_INT64:
case ARG_DOUBLE:
type = ARG16_LONG;
arg_types[pos / 10] |= type << (3 * (pos % 10));
......
......@@ -117,7 +117,9 @@ static void output_relay_debug( DLLSPEC *spec )
{
case ARG_STR: mask |= 1 << (2 * pos++); break;
case ARG_WSTR: mask |= 2 << (2 * pos++); break;
case ARG_INT64:
case ARG_DOUBLE: pos += 8 / get_ptr_size(); break;
case ARG_INT128: pos += (target_cpu == CPU_x86) ? 4 : 1; break;
default: pos++; break;
}
}
......
......@@ -899,9 +899,18 @@ unsigned int get_args_size( const ORDDEF *odp )
{
switch (odp->u.func.args[i])
{
case ARG_INT64:
case ARG_DOUBLE:
size += 8;
break;
case ARG_INT128:
/* int128 is passed as pointer on x86_64 */
if (target_cpu != CPU_x86_64)
{
size += 16;
break;
}
/* fall through */
default:
size += get_ptr_size();
break;
......
......@@ -343,10 +343,19 @@ should be one or several of:
(16-bit signed word)
.TP
.B long
(32-bit value)
(pointer-sized integer value)
.TP
.B int64
(64-bit integer value)
.TP
.B int128
(128-bit integer value)
.TP
.B float
(32-bit floating point value)
.TP
.B double
(64-bit value)
(64-bit floating point value)
.TP
.B ptr
(linear pointer)
......@@ -363,8 +372,8 @@ should be one or several of:
.B segstr
(segmented pointer to a null-terminated ASCII string).
.HP
.RB Only\ ptr ,\ str ,\ wstr ,\ long\ and\ double
are valid for Win32 functions.
Note: The 16-bit and segmented pointer types are only valid for Win16
functions.
.RE
.PP
.I handler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment