winebuild: Remove some no longer used code for ARM platforms.

This commit is contained in:
Alexandre Julliard 2024-02-05 20:44:04 +01:00
parent bbce5d014d
commit e25b1ab7e9
3 changed files with 15 additions and 120 deletions

View file

@ -778,19 +778,9 @@ static void output_import_thunk( const char *name, const char *table, int pos )
output( "\tjmpq *%s+%d(%%rip)\n", table, pos );
break;
case CPU_ARM:
if (UsePIC)
{
output( "\tldr ip, 2f\n");
output( "1:\tadd ip, pc\n" );
output( "\tldr pc, [ip]\n");
output( "2:\t.long %s+%u-1b-%u\n", table, pos, thumb_mode ? 4 : 8 );
}
else
{
output( "\tldr ip, 1f\n");
output( "\tldr pc, [ip]\n");
output( "1:\t.long %s+%u\n", table, pos );
}
output( "\tldr ip, 1f\n");
output( "\tldr pc, [ip]\n");
output( "1:\t.long %s+%u\n", table, pos );
break;
case CPU_ARM64:
output( "\tadrp x16, %s\n", arm64_page( table ) );
@ -1088,39 +1078,7 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output( "\tjmp *%%rax\n" );
break;
case CPU_ARM:
output( "\tpush {r0-r3,FP,LR}\n" );
output( "\tmov r1,IP\n" );
output( "\tldr r0, 1f\n");
if (UsePIC) output( "2:\tadd r0, pc\n" );
output( "\tbl %s\n", asm_name("__delayLoadHelper2") );
output( "\tmov IP,r0\n");
output( "\tpop {r0-r3,FP,LR}\n" );
output( "\tbx IP\n");
if (UsePIC)
output( "1:\t.long .L__wine_spec_delay_imports+%u-2b-%u\n", pos, thumb_mode ? 4 : 8 );
else
output( "1:\t.long .L__wine_spec_delay_imports+%u\n", pos );
break;
case CPU_ARM64:
output( "\tstp x29, x30, [sp,#-80]!\n" );
output( "\tmov x29, sp\n" );
output( "\tstp x0, x1, [sp,#16]\n" );
output( "\tstp x2, x3, [sp,#32]\n" );
output( "\tstp x4, x5, [sp,#48]\n" );
output( "\tstp x6, x7, [sp,#64]\n" );
output( "\tmov x1, x16\n" );
output( "\tadrp x0, %s\n", arm64_page(".L__wine_spec_delay_imports") );
output( "\tadd x0, x0, #%s\n", arm64_pageoff(".L__wine_spec_delay_imports") );
if (pos) output( "\tadd x0, x0, #%u\n", pos );
output( "\tbl %s\n", asm_name("__delayLoadHelper2") );
output( "\tmov x16, x0\n" );
output( "\tldp x0, x1, [sp,#16]\n" );
output( "\tldp x2, x3, [sp,#32]\n" );
output( "\tldp x4, x5, [sp,#48]\n" );
output( "\tldp x6, x7, [sp,#64]\n" );
output( "\tldp x29, x30, [sp],#80\n" );
output( "\tbr x16\n" );
break;
case CPU_ARM64EC:
assert( 0 );
break;
@ -1134,7 +1092,6 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
struct import_func *func = &import->imports[j];
const char *name = func->name ? func->name : func->export_name;
if (thumb_mode) output( "\t.thumb_func\n" );
output( "__wine_delay_imp_%s_%s:\n", import->c_name, name );
switch (target.cpu)
{
@ -1153,26 +1110,7 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
output( "\tjmp %s\n", asm_name(module_func) );
break;
case CPU_ARM:
if (UsePIC)
{
output( "\tldr ip, 2f\n");
output( "1:\tadd ip, pc\n" );
output( "\tb %s\n", asm_name(module_func) );
output( "2:\t.long .L__wine_delay_IAT+%u-1b-%u\n", iat_pos, thumb_mode ? 4 : 8 );
}
else
{
output( "\tldr ip, 1f\n");
output( "\tb %s\n", asm_name(module_func) );
output( "1:\t.long .L__wine_delay_IAT+%u\n", iat_pos );
}
break;
case CPU_ARM64:
output( "\tadrp x16, %s\n", arm64_page(".L__wine_delay_IAT") );
output( "\tadd x16, x16, #%s\n", arm64_pageoff(".L__wine_delay_IAT") );
if (iat_pos) output( "\tadd x16, x16, #%u\n", iat_pos );
output( "\tb %s\n", asm_name(module_func) );
break;
case CPU_ARM64EC:
assert( 0 );
break;
@ -1318,29 +1256,15 @@ void output_stubs( DLLSPEC *spec )
output_seh( ".seh_endproc" );
break;
case CPU_ARM:
if (UsePIC)
output( "\tmovw r0,:lower16:.L__wine_spec_file_name\n");
output( "\tmovt r0,:upper16:.L__wine_spec_file_name\n");
if (exp_name)
{
output( "\tldr r0,3f\n");
output( "1:\tadd r0,PC\n");
output( "\tldr r1,3f+4\n");
if (exp_name) output( "2:\tadd r1,PC\n");
output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") );
output( "3:\t.long .L__wine_spec_file_name-1b-%u\n", thumb_mode ? 4 : 8 );
if (exp_name) output( "\t.long .L%s_string-2b-%u\n", name, thumb_mode ? 4 : 8 );
else output( "\t.long %u\n", odp->ordinal );
}
else
{
output( "\tmovw r0,:lower16:.L__wine_spec_file_name\n");
output( "\tmovt r0,:upper16:.L__wine_spec_file_name\n");
if (exp_name)
{
output( "\tmovw r1,:lower16:.L%s_string\n", name );
output( "\tmovt r1,:upper16:.L%s_string\n", name );
}
else output( "\tmov r1,#%u\n", odp->ordinal );
output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") );
output( "\tmovw r1,:lower16:.L%s_string\n", name );
output( "\tmovt r1,:upper16:.L%s_string\n", name );
}
else output( "\tmov r1,#%u\n", odp->ordinal );
output( "\tbl %s\n", asm_name("__wine_spec_unimplemented_stub") );
break;
case CPU_ARM64:
case CPU_ARM64EC:

View file

@ -245,7 +245,6 @@ static void output_relay_debug( DLLSPEC *spec )
/* then the relay thunks */
output( "\t.text\n" );
if (thumb_mode) output( "\t.thumb_func\n" );
output( "__wine_spec_relay_entry_points:\n" );
output( "\tnop\n" ); /* to avoid 0 offset */
@ -296,9 +295,8 @@ static void output_relay_debug( DLLSPEC *spec )
{
int j, has_float = 0;
if (strcmp( float_abi_option, "soft" ))
for (j = 0; j < odp->u.func.nb_args && !has_float; j++)
has_float = is_float_arg( odp, j );
for (j = 0; j < odp->u.func.nb_args && !has_float; j++)
has_float = is_float_arg( odp, j );
output( "\t.balign 4\n" );
output( "__wine_spec_relay_entry_point_%d:\n", i );
@ -309,22 +307,13 @@ static void output_relay_debug( DLLSPEC *spec )
output( "\tsub SP, #4\n");
output( "\tmovw r1,#%u\n", i - spec->base );
output( "\tmovt r1,#%u\n", odp->u.func.args_str_offset );
if (UsePIC)
{
output( "\tldr r0, 2f\n");
output( "1:\tadd r0, PC\n");
}
else
{
output( "\tmovw r0, :lower16:.L__wine_spec_relay_descr\n" );
output( "\tmovt r0, :upper16:.L__wine_spec_relay_descr\n" );
}
output( "\tmovw r0, :lower16:.L__wine_spec_relay_descr\n" );
output( "\tmovt r0, :upper16:.L__wine_spec_relay_descr\n" );
output( "\tldr IP, [r0, #4]\n");
output( "\tblx IP\n");
output( "\tldr IP, [SP, #4]\n" );
output( "\tadd SP, #%u\n", 24 + (has_float ? 64 : 0) );
output( "\tbx IP\n");
if (UsePIC) output( "2:\t.long .L__wine_spec_relay_descr-1b-%u\n", thumb_mode ? 4 : 8 );
break;
}

View file

@ -466,11 +466,6 @@ void output_standard_file_header(void)
output( "\t.globl @feat.00\n" );
output( ".set @feat.00, 1\n" );
}
if (thumb_mode)
{
output( "\t.syntax unified\n" );
output( "\t.thumb\n" );
}
}
/* dump a byte stream into the assembly code */
@ -849,22 +844,9 @@ void output_function_header( const char *func, int global )
if (target.cpu == CPU_ARM64EC) output( ".section .text,\"xr\",discard,%s\n\t", name );
output( "\t.def %s\n\t.scl 2\n\t.type 32\n\t.endef\n", name );
if (global) output( "\t.globl %s\n", name );
if (thumb_mode) output( "\t.thumb_func\n" );
break;
default:
switch (target.cpu)
{
case CPU_ARM:
output( "\t.type %s,%%function\n", name );
if (thumb_mode) output( "\t.thumb_func\n" );
break;
case CPU_ARM64:
output( "\t.type %s,%%function\n", name );
break;
default:
output( "\t.type %s,@function\n", name );
break;
}
output( "\t.type %s,@function\n", name );
if (global) output( "\t.globl %s\n\t.hidden %s\n", name, name );
break;
}