Commit 07248a44 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Don't claim to support software emulation of short vectors if the FPSCR...

Don't claim to support software emulation of short vectors if the FPSCR doesn't implement the LEN/STRIDE fields

Detail:
  In ARMv8, VFP short vectors are completely obsolete, to the point where implementations aren't even required to implement the FPSCR fields that control their operation.
  Our software short vector emulation relies on the hardware taking the undefined instruction vector when a VFP data processing op is executed with the LEN/STRIDE fields set to non-zero values; if those fields are hard-wired to zero then our emulation can never be run.
  File changes:
  - s/Module - Check whether FPSCR LEN+STRIDE fields are implemented before deciding whether to install the short vector support code
  - Test/test7,ffb - Refuse to run if short vectors aren't supported (whether hardware or software). Bail out early if we spot an FPSCR inconsistency.
Admin:
  Tested on Cortex-A53, Cortex-A7


Version 0.12. Tagged as 'VFPSupport-0_12'
parent dbed9538
No preview for this file type
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.11"
Module_Version SETA 11
Module_MajorVersion SETS "0.12"
Module_Version SETA 12
Module_MinorVersion SETS ""
Module_Date SETS "29 Feb 2016"
Module_ApplicationDate SETS "29-Feb-16"
Module_Date SETS "20 Feb 2017"
Module_ApplicationDate SETS "20-Feb-17"
Module_ComponentName SETS "VFPSupport"
Module_ComponentPath SETS "mixed/RiscOS/Sources/HWSupport/VFPSupport"
Module_FullVersion SETS "0.11"
Module_HelpVersion SETS "0.11 (29 Feb 2016)"
Module_FullVersion SETS "0.12"
Module_HelpVersion SETS "0.12 (20 Feb 2017)"
END
/* (0.11)
/* (0.12)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.11
#define Module_MajorVersion_CMHG 0.12
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 29 Feb 2016
#define Module_Date_CMHG 20 Feb 2017
#define Module_MajorVersion "0.11"
#define Module_Version 11
#define Module_MajorVersion "0.12"
#define Module_Version 12
#define Module_MinorVersion ""
#define Module_Date "29 Feb 2016"
#define Module_Date "20 Feb 2017"
#define Module_ApplicationDate "29-Feb-16"
#define Module_ApplicationDate "20-Feb-17"
#define Module_ComponentName "VFPSupport"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/VFPSupport"
#define Module_FullVersion "0.11"
#define Module_HelpVersion "0.11 (29 Feb 2016)"
#define Module_LibraryVersionInfo "0:11"
#define Module_FullVersion "0.12"
#define Module_HelpVersion "0.12 (20 Feb 2017)"
#define Module_LibraryVersionInfo "0:12"
......@@ -107,7 +107,7 @@ WSSize * :INDEX: @
Subarch_VFPv1_IMP * 0 ; VFPv1 arch with implementation defined subarch
Subarch_VFPv2_v1Sub * 1 ; VFPv2 arch with v1 common subarch (ARM1176JZF-S)
Subarch_VFPv3_v2Sub * 2 ; >=VFPv3 arch with v2 common subarch (Cortex-A7)
Subarch_VFPv3_NoSub * 3 ; >=VFPv3 arch with no subarch (Cortex-A8, Cortex-A9)
Subarch_VFPv3_NoSub * 3 ; >=VFPv3 arch with no subarch (Cortex-A8, Cortex-A9, Cortex-A53)
Subarch_VFPv3_v3Sub * 4 ; >=VFPv3 arch with v3 common subarch (Cortex-A15)
......@@ -472,9 +472,10 @@ InstallHandler ROUT
; * Cortex-A9: Support code required for short vector support. Indicated by Subarch_VFPv3_NoSub, no response to FPEXC EX, but response to DEX (+ MVFR0 indicates no short vector support)
; * Cortex-A7: Support code required for short vector support. Indicated by Subarch_VFPv3_v2Sub, no response to FPEXC EX, but response to DEX (+ MVFR0 indicates no short vector support)
; * Cortex-A15: Support code required for short vector support. Also requires special abort handler due to lack of DEX. Indicated by Subarch_VFPv3_v3Sub, no response to FPEXC EX & DEX bits (+ MVRF0 indicates no short vector support)
; * Cortex-A53: Support code not required. Indicated by Subarch_VFPv3_NoSub & no response to FPEXC EX & DEX bits. Also no possibility of emulating short vector support (FPSCR LEN/STRIDE is zero)
; So logic to follow is:
; * If EX or DEX supported, pick based around SubArch version
; * If MVFR0 indicates no short vector support, use special abort handler
; * If MVFR0 indicates no short vector support, and FPSCR LEN/STRIDE can be set, use special abort handler
; When testing for support, avoid setting both EX and DEX at once, as that's an invalid combination
MOV r10, #0 ; r10 is used as our 'support handler installed' flag
MOV r11, #FPEXC_EX
......@@ -491,7 +492,17 @@ InstallHandler ROUT
LDR r11, SoftMVFR0
TST r11, #&F<<24
BNE %FT80 ; (no support code needed at all)
; Short vector support required
; Short vectors not supported in hardware, install support code to emulate them if the FPSCR has LEN+STRIDE fields
MOV r11, #FPEXC_EN
myVMSR ,FPEXC,r11
MOV r11, #&310000 ; length 2, stride 2
myVMSR ,FPSCR,r11
myVMRS ,r10,FPSCR
TEQ r10,r11
MOV r10,#0
myVMSR ,FPEXC,r10
BNE %FT80 ; (short vector emulation not possible)
; Short vector emulation possible
ADRL r10, VFPSupportCode_SV
ADR r0, SupportHandlerTemplateSV
B %FT50
......
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