notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #543 from gameblabla/hle_fies_corruption_libretro
[pcsx_rearmed.git]
/
libpcsxcore
/
gte_arm.S
diff --git
a/libpcsxcore/gte_arm.S
b/libpcsxcore/gte_arm.S
index
8700f69
..
d6fc1ab
100644
(file)
--- a/
libpcsxcore/gte_arm.S
+++ b/
libpcsxcore/gte_arm.S
@@
-5,37
+5,37
@@
* See the COPYING file in the top-level directory.
*/
* See the COPYING file in the top-level directory.
*/
-/* .equiv HAVE_ARMV7, 1 */
+#include "arm_features.h"
.text
.align 2
.macro sgnxt16 rd rs
.text
.align 2
.macro sgnxt16 rd rs
-.if HAVE_ARMV7
+#ifdef HAVE_ARMV6
sxth \rd, \rs
sxth \rd, \rs
-
.
else
+
#
else
lsl \rd, \rs, #16
asr \rd, \rd, #16
lsl \rd, \rs, #16
asr \rd, \rd, #16
-
.
endif
+
#
endif
.endm
@ prepare work reg for ssatx
@ in: wr reg, bit to saturate to
.macro ssatx_prep wr bit
.endm
@ prepare work reg for ssatx
@ in: wr reg, bit to saturate to
.macro ssatx_prep wr bit
-
.if !
HAVE_ARMV7
+
#ifndef
HAVE_ARMV7
mov \wr, #(1<<(\bit-1))
mov \wr, #(1<<(\bit-1))
-
.
endif
+
#
endif
.endm
.macro ssatx rd wr bit
.endm
.macro ssatx rd wr bit
-.if HAVE_ARMV7
+#ifdef HAVE_ARMV6
ssat \rd, #\bit, \rd
ssat \rd, #\bit, \rd
-
.
else
+
#
else
cmp \rd, \wr
subge \rd, \wr, #1
cmn \rd, \wr
rsblt \rd, \wr, #0
cmp \rd, \wr
subge \rd, \wr, #1
cmn \rd, \wr
rsblt \rd, \wr, #0
-
.
endif
+
#
endif
.endm
@ prepare work reg for ssatx0 (sat to 0..2^(bit-1))
.endm
@ prepare work reg for ssatx0 (sat to 0..2^(bit-1))
@@
-52,17
+52,19
@@
.endm
.macro usat16_ rd rs
.endm
.macro usat16_ rd rs
-.if HAVE_ARMV7
+#ifdef HAVE_ARMV6
usat \rd, #16, \rs
usat \rd, #16, \rs
-
.
else
+
#
else
subs \rd, \rs, #0
movlt \rd, #0
cmp \rd, #0x10000
movge \rd, #0x0ff00
orrge \rd, #0x000ff
subs \rd, \rs, #0
movlt \rd, #0
cmp \rd, #0x10000
movge \rd, #0x0ff00
orrge \rd, #0x000ff
-
.
endif
+
#
endif
.endm
.endm
+#ifdef HAVE_ARMV5
+
.macro udiv_ rd rm rs
lsl \rm, #16
clz \rd, \rs
.macro udiv_ rd rm rs
lsl \rm, #16
clz \rd, \rs
@@
-146,8
+148,7
@@
.endm
.endm
-.global gteRTPS_nf_arm @ r0=CP2 (d,c),
-gteRTPS_nf_arm:
+FUNCTION(gteRTPS_nf_arm): @ r0=CP2 (d,c),
push {r4-r11,lr}
ldmia r0, {r8,r9} @ VXYZ(0)
push {r4-r11,lr}
ldmia r0, {r8,r9} @ VXYZ(0)
@@
-180,7
+181,7
@@
gteRTPS_nf_arm:
pop {r0, r12}
.endif
1:
pop {r0, r12}
.endif
1:
- ldrd r6,
[r0,#4*(32+24)]
@ gteOFXY
+ ldrd r6,
r7, [r0, #4*(32+24)]
@ gteOFXY
cmp r9, #0x20000
add r1, r0, #4*12 @ gteSXY0
movhs r9, #0x20000
cmp r9, #0x20000
add r1, r0, #4*12 @ gteSXY0
movhs r9, #0x20000
@@
-192,7
+193,7
@@
gteRTPS_nf_arm:
mov r3, r7, asr #31
smlal r7, r3, r11, r9
lsr r6, #16
mov r3, r7, asr #31
smlal r7, r3, r11, r9
lsr r6, #16
- /* gteDQA, gteDQB */ ldrd r10,[r0, #4*(32+27)]
+ /* gteDQA, gteDQB */ ldrd r10,
r11,
[r0, #4*(32+27)]
orr r6, r2, lsl #16 @ (gteOFX + gteIR1 * q) >> 16
ssatx_prep r2, 11
lsr r7, #16
orr r6, r2, lsl #16 @ (gteOFX + gteIR1 * q) >> 16
ssatx_prep r2, 11
lsr r7, #16
@@
-213,8
+214,7
@@
gteRTPS_nf_arm:
.size gteRTPS_nf_arm, .-gteRTPS_nf_arm
.size gteRTPS_nf_arm, .-gteRTPS_nf_arm
-.global gteRTPT_nf_arm @ r0=CP2 (d,c),
-gteRTPT_nf_arm:
+FUNCTION(gteRTPT_nf_arm): @ r0=CP2 (d,c),
ldr r1, [r0, #4*19] @ gteSZ3
push {r4-r11,lr}
str r1, [r0, #4*16] @ gteSZ0
ldr r1, [r0, #4*19] @ gteSZ3
push {r4-r11,lr}
str r1, [r0, #4*16] @ gteSZ0
@@
-222,7
+222,7
@@
gteRTPT_nf_arm:
rtpt_arm_loop:
add r1, r0, lr, lsl #1
rtpt_arm_loop:
add r1, r0, lr, lsl #1
- ldrd r8,
[r1]
@ VXYZ(v)
+ ldrd r8,
r9, [r1]
@ VXYZ(v)
do_rtpx_mac
ssatx_prep r6, 16
do_rtpx_mac
ssatx_prep r6, 16
@@
-251,7
+251,7
@@
rtpt_arm_loop:
1: cmp r9, #0x20000
add r1, r0, #4*12
movhs r9, #0x20000
1: cmp r9, #0x20000
add r1, r0, #4*12
movhs r9, #0x20000
- ldrd r6,
[r0,#4*(32+24)]
@ gteOFXY
+ ldrd r6,
r7, [r0,#4*(32+24)]
@ gteOFXY
/* quotient */ subhs r9, #1
mov r2, r6, asr #31
smlal r6, r2, r10, r9
/* quotient */ subhs r9, #1
mov r2, r6, asr #31
smlal r6, r2, r10, r9
@@
-270,7
+270,7
@@
rtpt_arm_loop:
cmp lr, #12
blt rtpt_arm_loop
cmp lr, #12
blt rtpt_arm_loop
- ldrd r4, [r0, #4*(32+27)] @ gteDQA, gteDQB
+ ldrd r4,
r5,
[r0, #4*(32+27)] @ gteDQA, gteDQB
add r1, r0, #4*9 @ gteIR1
mla r3, r4, r9, r5 @ gteDQB + gteDQA * q
stmia r1, {r10,r11,r12} @ gteIR123 save
add r1, r0, #4*9 @ gteIR1
mla r3, r4, r9, r5 @ gteDQB + gteDQA * q
stmia r1, {r10,r11,r12} @ gteIR123 save
@@
-358,13
+358,11
@@
rtpt_arm_loop:
bx lr
.endm
bx lr
.endm
-.global gteMVMVA_part_arm
-gteMVMVA_part_arm:
+FUNCTION(gteMVMVA_part_arm):
mvma_op 1
.size gteMVMVA_part_arm, .-gteMVMVA_part_arm
mvma_op 1
.size gteMVMVA_part_arm, .-gteMVMVA_part_arm
-.global gteMVMVA_part_nf_arm
-gteMVMVA_part_nf_arm:
+FUNCTION(gteMVMVA_part_nf_arm):
mvma_op 0
.size gteMVMVA_part_nf_arm, .-gteMVMVA_part_nf_arm
mvma_op 0
.size gteMVMVA_part_nf_arm, .-gteMVMVA_part_nf_arm
@@
-374,8
+372,7
@@
gteMVMVA_part_nf_arm:
@ r0 = CP2 (d,c) (must preserve)
@ r4,r5 = VXYZ(v) packed
@ r6 = &MX11(mx)
@ r0 = CP2 (d,c) (must preserve)
@ r4,r5 = VXYZ(v) packed
@ r6 = &MX11(mx)
-.global gteMVMVA_part_cv3sh12_arm
-gteMVMVA_part_cv3sh12_arm:
+FUNCTION(gteMVMVA_part_cv3sh12_arm):
push {r8-r9}
ldmia r6!,{r7-r9} @ MX1*,MX2*
smulbb r1, r7, r4 @ MX11 * vx
push {r8-r9}
ldmia r6!,{r7-r9} @ MX1*,MX2*
smulbb r1, r7, r4 @ MX11 * vx
@@
-408,9
+405,9
@@
gteMVMVA_part_cv3sh12_arm:
bx lr
.size gteMVMVA_part_cv3sh12_arm, .-gteMVMVA_part_cv3sh12_arm
bx lr
.size gteMVMVA_part_cv3sh12_arm, .-gteMVMVA_part_cv3sh12_arm
+#endif /* HAVE_ARMV5 */
-.global gteNCLIP_arm @ r0=CP2 (d,c),
-gteNCLIP_arm:
+FUNCTION(gteNCLIP_arm): @ r0=CP2 (d,c),
push {r4-r6,lr}
ldrsh r4, [r0, #4*12+2]
ldrsh r5, [r0, #4*13+2]
push {r4-r6,lr}
ldrsh r4, [r0, #4*12+2]
ldrsh r5, [r0, #4*13+2]
@@
-430,12
+427,12
@@
gteNCLIP_arm:
movs r2, r1, lsl #1
adc r5, r5
cmp r5, #0
movs r2, r1, lsl #1
adc r5, r5
cmp r5, #0
-
.i
f HAVE_ARMV7
+
#ifde
f HAVE_ARMV7
movtgt lr, #((1<<31)|(1<<16))>>16
movtgt lr, #((1<<31)|(1<<16))>>16
-
.
else
+
#
else
movgt lr, #(1<<31)
orrgt lr, #(1<<16)
movgt lr, #(1<<31)
orrgt lr, #(1<<16)
-
.
endif
+
#
endif
cmn r5, #1
orrmi lr, r6
str r1, [r0, #4*24]
cmn r5, #1
orrmi lr, r6
str r1, [r0, #4*24]
@@
-460,7
+457,12
@@
gteNCLIP_arm:
rsblt r2, r1, #0
.endif
str r2, [r0, #4*9]
rsblt r2, r1, #0
.endif
str r2, [r0, #4*9]
- ldrd r2, [r0, #4*26] @ gteMAC23
+#ifdef HAVE_ARMV5
+ ldrd r2, r3, [r0, #4*26] @ gteMAC23
+#else
+ ldr r2, [r0, #4*26]
+ ldr r3, [r0, #4*27]
+#endif
orrlt r12, #(1<<31)|(1<<24)
cmp r2, r1
subge r2, r1, #1
orrlt r12, #(1<<31)|(1<<24)
cmp r2, r1
subge r2, r1, #1
@@
-486,24
+488,26
@@
gteNCLIP_arm:
rsblt r3, r1, #0
.endif
orrlt r12, #1<<22
rsblt r3, r1, #0
.endif
orrlt r12, #1<<22
- strd r2, [r0, #4*10] @ gteIR23
+#ifdef HAVE_ARMV5
+ strd r2, r3, [r0, #4*10] @ gteIR23
+#else
+ str r2, [r0, #4*10]
+ str r3, [r0, #4*11]
+#endif
str r12,[r0, #4*(32+31)] @ gteFLAG
bx lr
.endm
str r12,[r0, #4*(32+31)] @ gteFLAG
bx lr
.endm
-.global gteMACtoIR_lm0 @ r0=CP2 (d,c)
-gteMACtoIR_lm0:
+FUNCTION(gteMACtoIR_lm0): @ r0=CP2 (d,c)
gteMACtoIR 0
.size gteMACtoIR_lm0, .-gteMACtoIR_lm0
gteMACtoIR 0
.size gteMACtoIR_lm0, .-gteMACtoIR_lm0
-.global gteMACtoIR_lm1 @ r0=CP2 (d,c)
-gteMACtoIR_lm1:
+FUNCTION(gteMACtoIR_lm1): @ r0=CP2 (d,c)
gteMACtoIR 1
.size gteMACtoIR_lm1, .-gteMACtoIR_lm1
gteMACtoIR 1
.size gteMACtoIR_lm1, .-gteMACtoIR_lm1
-.global gteMACtoIR_lm0_nf @ r0=CP2 (d,c)
-gteMACtoIR_lm0_nf:
+FUNCTION(gteMACtoIR_lm0_nf): @ r0=CP2 (d,c)
add r12, r0, #4*25
ldmia r12, {r1-r3}
ssatx_prep r12, 16
add r12, r0, #4*25
ldmia r12, {r1-r3}
ssatx_prep r12, 16
@@
-516,8
+520,7
@@
gteMACtoIR_lm0_nf:
.size gteMACtoIR_lm0_nf, .-gteMACtoIR_lm0_nf
.size gteMACtoIR_lm0_nf, .-gteMACtoIR_lm0_nf
-.global gteMACtoIR_lm1_nf @ r0=CP2 (d,c)
-gteMACtoIR_lm1_nf:
+FUNCTION(gteMACtoIR_lm1_nf): @ r0=CP2 (d,c)
add r12, r0, #4*25
ldmia r12, {r1-r3}
ssatx0_prep r12, 16
add r12, r0, #4*25
ldmia r12, {r1-r3}
ssatx0_prep r12, 16
@@
-531,8
+534,7
@@
gteMACtoIR_lm1_nf:
.if 0
.if 0
-.global gteMVMVA_test
-gteMVMVA_test:
+FUNCTION(gteMVMVA_test):
push {r4-r7,lr}
push {r1}
and r2, r1, #0x18000 @ v
push {r4-r7,lr}
push {r1}
and r2, r1, #0x18000 @ v