Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
abf4747b
Commit
abf4747b
authored
Feb 24, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Simplify constant loading on ARM.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b1fe783a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
29 deletions
+34
-29
import.c
tools/winebuild/import.c
+22
-21
spec32.c
tools/winebuild/spec32.c
+12
-8
No files found.
tools/winebuild/import.c
View file @
abf4747b
...
...
@@ -1166,23 +1166,15 @@ static void output_delayed_import_thunks( const DLLSPEC *spec )
switch
(
target_cpu
)
{
case
CPU_x86
:
output
(
"
\t
movl $%d, %%eax
\n
"
,
(
idx
<<
16
)
|
j
);
output
(
"
\t
jmp %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
case
CPU_x86_64
:
output
(
"
\t
mov
q $%d,%%r
ax
\n
"
,
(
idx
<<
16
)
|
j
);
output
(
"
\t
mov
l $%d,%%e
ax
\n
"
,
(
idx
<<
16
)
|
j
);
output
(
"
\t
jmp %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
case
CPU_ARM
:
{
unsigned
int
mask
,
count
=
0
,
val
=
(
idx
<<
16
)
|
j
;
for
(
mask
=
0xff
;
mask
;
mask
<<=
8
)
if
(
val
&
mask
)
output
(
"
\t
%s IP,#%u
\n
"
,
count
++
?
"add"
:
"mov"
,
val
&
mask
);
if
(
!
count
)
output
(
"
\t
mov IP,#0
\n
"
);
output
(
"
\t
mov ip, #%u
\n
"
,
j
);
if
(
idx
)
output
(
"
\t
movt ip, #%u
\n
"
,
idx
);
output
(
"
\t
b %s
\n
"
,
asm_name
(
"__wine_delay_load_asm"
)
);
break
;
}
case
CPU_ARM64
:
if
(
idx
)
{
...
...
@@ -1370,12 +1362,15 @@ void output_stubs( DLLSPEC *spec )
}
else
{
output
(
"
\t
ldr r0,1f
\n
"
);
output
(
"
\t
ldr r1,1f+4
\n
"
);
output
(
"
\t
movw r0,:lower16:.L__wine_spec_file_name
\n
"
);
output
(
"
\t
movt r0,:upper16:.L__wine_spec_file_name
\n
"
);
if
(
exp_name
)
{
output
(
"
\t
movw r1,:lower16:.L%s_string
\n
"
,
name
);
output
(
"
\t
movt r1,:upper16:.L%s_string
\n
"
,
name
);
}
else
output
(
"
\t
mov r1,#%u
\n
"
,
odp
->
ordinal
);
output
(
"
\t
bl %s
\n
"
,
asm_name
(
"__wine_spec_unimplemented_stub"
)
);
output
(
"1:
\t
.long .L__wine_spec_file_name
\n
"
);
if
(
exp_name
)
output
(
"
\t
.long .L%s_string
\n
"
,
name
);
else
output
(
"
\t
.long %u
\n
"
,
odp
->
ordinal
);
}
break
;
case
CPU_ARM64
:
...
...
@@ -1823,15 +1818,21 @@ void output_syscalls( DLLSPEC *spec )
break
;
case
CPU_ARM
:
output
(
"
\t
push {r4,lr}
\n
"
);
output
(
"
\t
ldr r4, 3f
\n
"
);
output
(
"
\t
ldr ip, 2f
\n
"
);
if
(
UsePIC
)
output
(
"1:
\t
add ip, pc
\n
"
);
output
(
"
\t
mov r4, #%u
\n
"
,
i
);
if
(
UsePIC
)
{
output
(
"
\t
ldr ip, 2f
\n
"
);
output
(
"1:
\t
add ip, pc
\n
"
);
}
else
{
output
(
"
\t
movw ip, :lower16:%s
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output
(
"
\t
movt ip, :upper16:%s
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
}
output
(
"
\t
ldr ip, [ip]
\n
"
);
output
(
"
\t
blx ip
\n
"
);
output
(
"
\t
pop {r4,pc}
\n
"
);
if
(
UsePIC
)
output
(
"2:
\t
.long %s-1b-%u
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
),
thumb_mode
?
4
:
8
);
else
output
(
"2:
\t
.long %s
\n
"
,
asm_name
(
"__wine_syscall_dispatcher"
)
);
output
(
"3:
\t
.long %u
\n
"
,
i
);
break
;
case
CPU_ARM64
:
output
(
"
\t
stp x29, x30, [sp,#-16]!
\n
"
);
...
...
tools/winebuild/spec32.c
View file @
abf4747b
...
...
@@ -297,14 +297,12 @@ static void output_relay_debug( DLLSPEC *spec )
case
CPU_ARM
:
{
unsigned
int
mask
,
val
,
count
=
0
;
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
);
val
=
(
odp
->
u
.
func
.
args_str_offset
<<
16
)
|
(
i
-
spec
->
base
);
output
(
"
\t
.align %d
\n
"
,
get_alignment
(
4
)
);
if
(
thumb_mode
)
output
(
"
\t
.thumb_func
\n
"
);
output
(
"__wine_spec_relay_entry_point_%d:
\n
"
,
i
);
...
...
@@ -314,18 +312,24 @@ static void output_relay_debug( DLLSPEC *spec )
if
(
has_float
)
output
(
"
\t
vpush {s0-s15}
\n
"
);
output
(
"
\t
push {LR}
\n
"
);
output
(
"
\t
sub SP, #4
\n
"
);
for
(
mask
=
0xff
;
mask
;
mask
<<=
8
)
if
(
val
&
mask
)
output
(
"
\t
%s r1,#%u
\n
"
,
count
++
?
"add"
:
"mov"
,
val
&
mask
);
if
(
!
count
)
output
(
"
\t
mov r1,#0
\n
"
);
output
(
"
\t
ldr r0, 2f
\n
"
);
if
(
UsePIC
)
output
(
"1:
\t
add r0, PC
\n
"
);
output
(
"
\t
mov r1,#%u
\n
"
,
i
-
spec
->
base
);
output
(
"
\t
movt r1,#%u
\n
"
,
odp
->
u
.
func
.
args_str_offset
);
if
(
UsePIC
)
{
output
(
"
\t
ldr r0, 2f
\n
"
);
output
(
"1:
\t
add r0, PC
\n
"
);
}
else
{
output
(
"
\t
movw r0, :lower16:.L__wine_spec_relay_descr
\n
"
);
output
(
"
\t
movt r0, :upper16:.L__wine_spec_relay_descr
\n
"
);
}
output
(
"
\t
ldr IP, [r0, #4]
\n
"
);
output
(
"
\t
blx IP
\n
"
);
output
(
"
\t
ldr IP, [SP, #4]
\n
"
);
output
(
"
\t
add SP, #%u
\n
"
,
24
+
(
has_float
?
64
:
0
)
);
output
(
"
\t
bx IP
\n
"
);
if
(
UsePIC
)
output
(
"2:
\t
.long .L__wine_spec_relay_descr-1b-%u
\n
"
,
thumb_mode
?
4
:
8
);
else
output
(
"2:
\t
.long .L__wine_spec_relay_descr
\n
"
);
output_cfi
(
".cfi_endproc"
);
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment