changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: bcm64: use MOVP instruction for saving and restoring registers

changeset 7222: 761a37c3fc9a
parent 7221: d98974bc6c16
child 7223: f6786e3ba3da
author: cinap_lenrek@felloff.net
date: Thu, 09 May 2019 11:11:45 +0200
files: sys/src/9/bcm64/fns.h sys/src/9/bcm64/l.s
description: bcm64: use MOVP instruction for saving and restoring registers
     1.1--- a/sys/src/9/bcm64/fns.h
     1.2+++ b/sys/src/9/bcm64/fns.h
     1.3@@ -17,7 +17,6 @@ extern void noteret(void);
     1.4 extern void returnto(void*);
     1.5 extern void fpsaveregs(void*);
     1.6 extern void fploadregs(void*);
     1.7-extern void magic(void);
     1.8 
     1.9 extern void setttbr(uintptr pa);
    1.10 extern uintptr getfar(void);
     2.1--- a/sys/src/9/bcm64/l.s
     2.2+++ b/sys/src/9/bcm64/l.s
     2.3@@ -334,17 +334,6 @@ TEXT setttbr(SB), 1, $-4
     2.4 
     2.5 	B	cacheiinv(SB)
     2.6 
     2.7-TEXT magic(SB), 1, $-4
     2.8-	DSB	$SY
     2.9-	ISB	$SY
    2.10-	DSB	$SY
    2.11-	ISB	$SY
    2.12-	DSB	$SY
    2.13-	ISB	$SY
    2.14-	DSB	$SY
    2.15-	ISB	$SY
    2.16-	RETURN
    2.17-
    2.18 /*
    2.19  * TLB maintenance operations.
    2.20  * these broadcast to all cpu's in the cluser
    2.21@@ -421,10 +410,8 @@ TEXT vsys0(SB), 1, $-4
    2.22 	CMPW	$0x15, R17	// SVC trap?
    2.23 	BNE	_itsatrap	// nope.
    2.24 
    2.25-	MOV	R26, 224(RSP)	// special
    2.26-	MOV	R27, 232(RSP)	// special
    2.27-	MOV	R28, 240(RSP)	// sb
    2.28-	MOV	R29, 248(RSP)	// special
    2.29+	MOVP	R26, R27, 224(RSP)
    2.30+	MOVP	R28, R29, 240(RSP)
    2.31 
    2.32 	MRS	SP_EL0, R1
    2.33 	MRS	ELR_EL1, R2
    2.34@@ -456,10 +443,8 @@ TEXT forkret(SB), 1, $-4
    2.35 	MSR	R2, ELR_EL1
    2.36 	MSR	R3, SPSR_EL1
    2.37 
    2.38-	MOV	224(RSP), R26	// special
    2.39-	MOV	232(RSP), R27	// special
    2.40-	MOV	240(RSP), R28	// sb
    2.41-	MOV	248(RSP), R29	// special
    2.42+	MOVP	224(RSP), R26, R27
    2.43+	MOVP	240(RSP), R28, R29
    2.44 
    2.45 	MOV	256(RSP), R30	// link
    2.46 
    2.47@@ -468,38 +453,24 @@ TEXT forkret(SB), 1, $-4
    2.48 
    2.49 TEXT itsatrap<>(SB), 1, $-4
    2.50 _itsatrap:
    2.51-	MOV	R1, 24(RSP)
    2.52-	MOV	R2, 32(RSP)
    2.53-	MOV	R3, 40(RSP)
    2.54-	MOV	R4, 48(RSP)
    2.55-	MOV	R5, 56(RSP)
    2.56-	MOV	R6, 64(RSP)
    2.57-	MOV	R7, 72(RSP)
    2.58-	MOV	R8, 80(RSP)
    2.59-	MOV	R9, 88(RSP)
    2.60-	MOV	R10, 96(RSP)
    2.61-	MOV	R11, 104(RSP)
    2.62-	MOV	R12, 112(RSP)
    2.63-	MOV	R13, 120(RSP)
    2.64-	MOV	R14, 128(RSP)
    2.65-	MOV	R15, 136(RSP)
    2.66-	MOV	R16, 144(RSP)
    2.67+	MOVP	R1, R2, 24(RSP)
    2.68+	MOVP	R3, R4, 40(RSP)
    2.69+	MOVP	R5, R6, 56(RSP)
    2.70+	MOVP	R7, R8, 72(RSP)
    2.71+	MOVP	R9, R10, 88(RSP)
    2.72+	MOVP	R11, R12, 104(RSP)
    2.73+	MOVP	R13, R14, 120(RSP)
    2.74+	MOVP	R15, R16, 136(RSP)
    2.75 
    2.76-	MOV	R18, 160(RSP)
    2.77-	MOV	R19, 168(RSP)
    2.78-	MOV	R20, 176(RSP)
    2.79-	MOV	R21, 184(RSP)
    2.80-	MOV	R22, 192(RSP)
    2.81-	MOV	R23, 200(RSP)
    2.82-	MOV	R24, 208(RSP)
    2.83-	MOV	R25, 216(RSP)
    2.84+	MOVP	R18, R19, 160(RSP)
    2.85+	MOVP	R20, R21, 176(RSP)
    2.86+	MOVP	R22, R23, 192(RSP)
    2.87+	MOVP	R24, R25, 208(RSP)
    2.88 
    2.89 // trap/irq/fiq/serr from EL0
    2.90 TEXT vtrap0(SB), 1, $-4
    2.91-	MOV	R26, 224(RSP)	// special
    2.92-	MOV	R27, 232(RSP)	// special
    2.93-	MOV	R28, 240(RSP)	// sb
    2.94-	MOV	R29, 248(RSP)	// special
    2.95+	MOVP	R26, R27, 224(RSP)
    2.96+	MOVP	R28, R29, 240(RSP)
    2.97 
    2.98 	MRS	SP_EL0, R1
    2.99 	MRS	ELR_EL1, R2
   2.100@@ -530,38 +501,23 @@ TEXT noteret(SB), 1, $-4
   2.101 	MSR	R2, ELR_EL1
   2.102 	MSR	R3, SPSR_EL1
   2.103 
   2.104-	MOV	224(RSP), R26	// special
   2.105-	MOV	232(RSP), R27	// special
   2.106-	MOV	240(RSP), R28	// sb
   2.107-	MOV	248(RSP), R29	// special
   2.108+	MOVP	224(RSP), R26, R27
   2.109+	MOVP	240(RSP), R28, R29
   2.110 
   2.111 _intrreturn:
   2.112-	MOV	16(RSP), R0
   2.113-	MOV	24(RSP), R1
   2.114-	MOV	32(RSP), R2
   2.115-	MOV	40(RSP), R3
   2.116-	MOV	48(RSP), R4
   2.117-	MOV	56(RSP), R5
   2.118-	MOV	64(RSP), R6
   2.119-	MOV	72(RSP), R7
   2.120-	MOV	80(RSP), R8
   2.121-	MOV	88(RSP), R9
   2.122-	MOV	96(RSP), R10
   2.123-	MOV	104(RSP), R11
   2.124-	MOV	112(RSP), R12
   2.125-	MOV	120(RSP), R13
   2.126-	MOV	128(RSP), R14
   2.127-	MOV	136(RSP), R15
   2.128-	MOV	144(RSP), R16
   2.129-	MOV	152(RSP), R17
   2.130-	MOV	160(RSP), R18
   2.131-	MOV	168(RSP), R19
   2.132-	MOV	176(RSP), R20
   2.133-	MOV	184(RSP), R21
   2.134-	MOV	192(RSP), R22
   2.135-	MOV	200(RSP), R23
   2.136-	MOV	208(RSP), R24
   2.137-	MOV	216(RSP), R25
   2.138+	MOVP	16(RSP), R0, R1
   2.139+	MOVP	32(RSP), R2, R3
   2.140+	MOVP	48(RSP), R4, R5
   2.141+	MOVP	64(RSP), R6, R7
   2.142+	MOVP	80(RSP), R8, R9
   2.143+	MOVP	96(RSP), R10, R11
   2.144+	MOVP	112(RSP), R12, R13
   2.145+	MOVP	128(RSP), R14, R15
   2.146+	MOVP	144(RSP), R16, R17
   2.147+	MOVP	160(RSP), R18, R19
   2.148+	MOVP	176(RSP), R20, R21
   2.149+	MOVP	192(RSP), R22, R23
   2.150+	MOVP	208(RSP), R24, R25
   2.151 
   2.152 	MOV	256(RSP), R30	// link
   2.153 
   2.154@@ -612,32 +568,19 @@ TEXT vsys(SB), 1, $-4
   2.155 TEXT vtrap(SB), 1, $-4
   2.156 	SUB	$TRAPFRAMESIZE, RSP
   2.157 
   2.158-	MOV	R0, 16(RSP)
   2.159-	MOV	R1, 24(RSP)
   2.160-	MOV	R2, 32(RSP)
   2.161-	MOV	R3, 40(RSP)
   2.162-	MOV	R4, 48(RSP)
   2.163-	MOV	R5, 56(RSP)
   2.164-	MOV	R6, 64(RSP)
   2.165-	MOV	R7, 72(RSP)
   2.166-	MOV	R8, 80(RSP)
   2.167-	MOV	R9, 88(RSP)
   2.168-	MOV	R10, 96(RSP)
   2.169-	MOV	R11, 104(RSP)
   2.170-	MOV	R12, 112(RSP)
   2.171-	MOV	R13, 120(RSP)
   2.172-	MOV	R14, 128(RSP)
   2.173-	MOV	R15, 136(RSP)
   2.174-	MOV	R16, 144(RSP)
   2.175-	MOV	R17, 152(RSP)
   2.176-	MOV	R18, 160(RSP)
   2.177-	MOV	R19, 168(RSP)
   2.178-	MOV	R20, 176(RSP)
   2.179-	MOV	R21, 184(RSP)
   2.180-	MOV	R22, 192(RSP)
   2.181-	MOV	R23, 200(RSP)
   2.182-	MOV	R24, 208(RSP)
   2.183-	MOV	R25, 216(RSP)
   2.184+	MOVP	R0, R1, 16(RSP)
   2.185+	MOVP	R2, R3, 32(RSP)
   2.186+	MOVP	R4, R5, 48(RSP)
   2.187+	MOVP	R6, R7, 64(RSP)
   2.188+	MOVP	R8, R9, 80(RSP)
   2.189+	MOVP	R10, R11, 96(RSP)
   2.190+	MOVP	R12, R13, 112(RSP)
   2.191+	MOVP	R14, R15, 128(RSP)
   2.192+	MOVP	R16, R17, 144(RSP)
   2.193+	MOVP	R18, R19, 160(RSP)
   2.194+	MOVP	R20, R21, 176(RSP)
   2.195+	MOVP	R22, R23, 192(RSP)
   2.196+	MOVP	R24, R25, 208(RSP)
   2.197 
   2.198 	MOV	R30, 256(RSP)	// link
   2.199 
   2.200@@ -649,32 +592,19 @@ TEXT vtrap(SB), 1, $-4
   2.201 TEXT virq(SB), 1, $-4
   2.202 	SUB	$TRAPFRAMESIZE, RSP
   2.203 
   2.204-	MOV	R0, 16(RSP)
   2.205-	MOV	R1, 24(RSP)
   2.206-	MOV	R2, 32(RSP)
   2.207-	MOV	R3, 40(RSP)
   2.208-	MOV	R4, 48(RSP)
   2.209-	MOV	R5, 56(RSP)
   2.210-	MOV	R6, 64(RSP)
   2.211-	MOV	R7, 72(RSP)
   2.212-	MOV	R8, 80(RSP)
   2.213-	MOV	R9, 88(RSP)
   2.214-	MOV	R10, 96(RSP)
   2.215-	MOV	R11, 104(RSP)
   2.216-	MOV	R12, 112(RSP)
   2.217-	MOV	R13, 120(RSP)
   2.218-	MOV	R14, 128(RSP)
   2.219-	MOV	R15, 136(RSP)
   2.220-	MOV	R16, 144(RSP)
   2.221-	MOV	R17, 152(RSP)
   2.222-	MOV	R18, 160(RSP)
   2.223-	MOV	R19, 168(RSP)
   2.224-	MOV	R20, 176(RSP)
   2.225-	MOV	R21, 184(RSP)
   2.226-	MOV	R22, 192(RSP)
   2.227-	MOV	R23, 200(RSP)
   2.228-	MOV	R24, 208(RSP)
   2.229-	MOV	R25, 216(RSP)
   2.230+	MOVP	R0, R1, 16(RSP)
   2.231+	MOVP	R2, R3, 32(RSP)
   2.232+	MOVP	R4, R5, 48(RSP)
   2.233+	MOVP	R6, R7, 64(RSP)
   2.234+	MOVP	R8, R9, 80(RSP)
   2.235+	MOVP	R10, R11, 96(RSP)
   2.236+	MOVP	R12, R13, 112(RSP)
   2.237+	MOVP	R14, R15, 128(RSP)
   2.238+	MOVP	R16, R17, 144(RSP)
   2.239+	MOVP	R18, R19, 160(RSP)
   2.240+	MOVP	R20, R21, 176(RSP)
   2.241+	MOVP	R22, R23, 192(RSP)
   2.242+	MOVP	R24, R25, 208(RSP)
   2.243 
   2.244 	MOV	R30, 256(RSP)	// link
   2.245 
   2.246@@ -686,32 +616,19 @@ TEXT virq(SB), 1, $-4
   2.247 TEXT vfiq(SB), 1, $-4
   2.248 	SUB	$TRAPFRAMESIZE, RSP
   2.249 
   2.250-	MOV	R0, 16(RSP)
   2.251-	MOV	R1, 24(RSP)
   2.252-	MOV	R2, 32(RSP)
   2.253-	MOV	R3, 40(RSP)
   2.254-	MOV	R4, 48(RSP)
   2.255-	MOV	R5, 56(RSP)
   2.256-	MOV	R6, 64(RSP)
   2.257-	MOV	R7, 72(RSP)
   2.258-	MOV	R8, 80(RSP)
   2.259-	MOV	R9, 88(RSP)
   2.260-	MOV	R10, 96(RSP)
   2.261-	MOV	R11, 104(RSP)
   2.262-	MOV	R12, 112(RSP)
   2.263-	MOV	R13, 120(RSP)
   2.264-	MOV	R14, 128(RSP)
   2.265-	MOV	R15, 136(RSP)
   2.266-	MOV	R16, 144(RSP)
   2.267-	MOV	R17, 152(RSP)
   2.268-	MOV	R18, 160(RSP)
   2.269-	MOV	R19, 168(RSP)
   2.270-	MOV	R20, 176(RSP)
   2.271-	MOV	R21, 184(RSP)
   2.272-	MOV	R22, 192(RSP)
   2.273-	MOV	R23, 200(RSP)
   2.274-	MOV	R24, 208(RSP)
   2.275-	MOV	R25, 216(RSP)
   2.276+	MOVP	R0, R1, 16(RSP)
   2.277+	MOVP	R2, R3, 32(RSP)
   2.278+	MOVP	R4, R5, 48(RSP)
   2.279+	MOVP	R6, R7, 64(RSP)
   2.280+	MOVP	R8, R9, 80(RSP)
   2.281+	MOVP	R10, R11, 96(RSP)
   2.282+	MOVP	R12, R13, 112(RSP)
   2.283+	MOVP	R14, R15, 128(RSP)
   2.284+	MOVP	R16, R17, 144(RSP)
   2.285+	MOVP	R18, R19, 160(RSP)
   2.286+	MOVP	R20, R21, 176(RSP)
   2.287+	MOVP	R22, R23, 192(RSP)
   2.288+	MOVP	R24, R25, 208(RSP)
   2.289 
   2.290 	MOV	R30, 256(RSP)	// link
   2.291 	MOV	$(2<<32), R0	// type fiq
   2.292@@ -722,32 +639,19 @@ TEXT vfiq(SB), 1, $-4
   2.293 TEXT vserr(SB), 1, $-4
   2.294 	SUB	$TRAPFRAMESIZE, RSP
   2.295 
   2.296-	MOV	R0, 16(RSP)
   2.297-	MOV	R1, 24(RSP)
   2.298-	MOV	R2, 32(RSP)
   2.299-	MOV	R3, 40(RSP)
   2.300-	MOV	R4, 48(RSP)
   2.301-	MOV	R5, 56(RSP)
   2.302-	MOV	R6, 64(RSP)
   2.303-	MOV	R7, 72(RSP)
   2.304-	MOV	R8, 80(RSP)
   2.305-	MOV	R9, 88(RSP)
   2.306-	MOV	R10, 96(RSP)
   2.307-	MOV	R11, 104(RSP)
   2.308-	MOV	R12, 112(RSP)
   2.309-	MOV	R13, 120(RSP)
   2.310-	MOV	R14, 128(RSP)
   2.311-	MOV	R15, 136(RSP)
   2.312-	MOV	R16, 144(RSP)
   2.313-	MOV	R17, 152(RSP)
   2.314-	MOV	R18, 160(RSP)
   2.315-	MOV	R19, 168(RSP)
   2.316-	MOV	R20, 176(RSP)
   2.317-	MOV	R21, 184(RSP)
   2.318-	MOV	R22, 192(RSP)
   2.319-	MOV	R23, 200(RSP)
   2.320-	MOV	R24, 208(RSP)
   2.321-	MOV	R25, 216(RSP)
   2.322+	MOVP	R0, R1, 16(RSP)
   2.323+	MOVP	R2, R3, 32(RSP)
   2.324+	MOVP	R4, R5, 48(RSP)
   2.325+	MOVP	R6, R7, 64(RSP)
   2.326+	MOVP	R8, R9, 80(RSP)
   2.327+	MOVP	R10, R11, 96(RSP)
   2.328+	MOVP	R12, R13, 112(RSP)
   2.329+	MOVP	R14, R15, 128(RSP)
   2.330+	MOVP	R16, R17, 144(RSP)
   2.331+	MOVP	R18, R19, 160(RSP)
   2.332+	MOVP	R20, R21, 176(RSP)
   2.333+	MOVP	R22, R23, 192(RSP)
   2.334+	MOVP	R24, R25, 208(RSP)
   2.335 
   2.336 	MOV	R30, 256(RSP)	// link
   2.337