Commit 66e20043 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL
Browse files

Ensure exception error blocks are always available

For those machine types that don't need the C support code (currently, Cortex-A8 and A53) the SupportCode.s source file is skipped. However, the elementary functions want the exception error blocks contained within.
Transplant those error blocks into the globally visible Errors.s source file.

Version 0.16. Tagged as 'VFPSupport-0_16'
parent 66a155c8
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "0.15"
Module_Version SETA 15
Module_MajorVersion SETS "0.16"
Module_Version SETA 16
Module_MinorVersion SETS ""
Module_Date SETS "23 Jun 2021"
Module_ApplicationDate SETS "23-Jun-21"
Module_Date SETS "28 Jun 2021"
Module_ApplicationDate SETS "28-Jun-21"
Module_ComponentName SETS "VFPSupport"
Module_FullVersion SETS "0.15"
Module_HelpVersion SETS "0.15 (23 Jun 2021)"
Module_FullVersion SETS "0.16"
Module_HelpVersion SETS "0.16 (28 Jun 2021)"
END
/* (0.15)
/* (0.16)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 0.15
#define Module_MajorVersion_CMHG 0.16
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 23 Jun 2021
#define Module_Date_CMHG 28 Jun 2021
#define Module_MajorVersion "0.15"
#define Module_Version 15
#define Module_MajorVersion "0.16"
#define Module_Version 16
#define Module_MinorVersion ""
#define Module_Date "23 Jun 2021"
#define Module_Date "28 Jun 2021"
#define Module_ApplicationDate "23-Jun-21"
#define Module_ApplicationDate "28-Jun-21"
#define Module_ComponentName "VFPSupport"
#define Module_FullVersion "0.15"
#define Module_HelpVersion "0.15 (23 Jun 2021)"
#define Module_LibraryVersionInfo "0:15"
#define Module_FullVersion "0.16"
#define Module_HelpVersion "0.16 (28 Jun 2021)"
#define Module_LibraryVersionInfo "0:16"
......@@ -28,6 +28,13 @@
; VFPSupport errors
MakeInternatErrorBlock VFPSupport_IO,,IO
MakeInternatErrorBlock VFPSupport_DZ,,DZ
MakeInternatErrorBlock VFPSupport_OF,,OF
MakeInternatErrorBlock VFPSupport_UF,,UF
MakeInternatErrorBlock VFPSupport_IX,,IX
MakeInternatErrorBlock VFPSupport_ID,,ID
MakeInternatErrorBlock VFPSupport_NoHW,,E00
MakeInternatErrorBlock VFPSupport_BadHW,,E01
MakeInternatErrorBlock VFPSupport_FeatureUnavailable,,E02
......@@ -37,4 +44,41 @@
MakeInternatErrorBlock VFPSupport_Instanced,,E06
MakeInternatErrorBlock VFPSupport_BadFlags,,E07
EXPORT RaiseException
RaiseException
; Raise an exception from the elementary library functions
; These are different to the softfloat library in that they aren't called
; from an exception, they were called as APCS compliant functions in the
; foreground.
FMRX r3, FPSCR
AND r0, r0, #&FF ; Constrain cumulative bits
ORR r3, r3, r0 ; Mix them in
FMXR FPSCR, r3
TST r0, r3, LSR #8 ; See if a cumulative bit is also exception throwing
BXEQ lr
; We'll need R12 back, though APCS has probably junked it, but as exceptions
; are exceptional (!) a slow module name lookup doesn't hurt.
Push "r4-r6, lr"
MOV r6, r0
MOV r0, #ModHandReason_LookupName
ADRL r1, ModuleTitle
SWI XOS_Module ; Not expecting any trouble
MOV wp, r4
; Cause an actual error
TST r6, #FPSCR_IOC
ADRNE r0, ErrorBlock_VFPSupport_IO
TST r6, #FPSCR_DZC
ADRNE r0, ErrorBlock_VFPSupport_DZ
TST r6, #FPSCR_OFC
ADRNE r0, ErrorBlock_VFPSupport_OF
TST r6, #FPSCR_UFC
ADRNE r0, ErrorBlock_VFPSupport_UF
TST r6, #FPSCR_IXC
ADRNE r0, ErrorBlock_VFPSupport_IX
TST r6, #FPSCR_IDC
ADRNE r0, ErrorBlock_VFPSupport_ID
BL ReturnError_LR
Pull "r4-r6, lr"
SWI OS_GenerateError
END
......@@ -872,7 +872,10 @@ VFPSupportCode_$token
Debug x, "Throwing error $token"
ADRL r0, ErrorBlock_VFPSupport_$prefix.$token
B VFPSupportCode_Error
[ "$prefix"="SupCode_"
; The non-support code error blocks are shared with Errors.s
MakeInternatErrorBlock VFPSupport_$prefix.$token,,"$msg"
]
MEND
VFPSupportError SupCode_, NoContext,"S00"
......@@ -954,43 +957,6 @@ VFPSupportCode_Oops ROUT
|_Mod$Reloc$Off| * 0
ASSERT XCRelocOffset = 0
EXPORT RaiseException
RaiseException
; Raise an exception from the elementary library functions
; These are different to the softfloat library in that they aren't called
; from an exception, they were called as APCS compliant functions in the
; foreground.
FMRX r3, FPSCR
AND r0, r0, #&FF ; Constrain cumulative bits
ORR r3, r3, r0 ; Mix them in
FMXR FPSCR, r3
TST r0, r3, LSR #8 ; See if a cumulative bit is also exception throwing
BXEQ lr
; We'll need R12 back, though APCS has probably junked it, but as exceptions
; are exceptional (!) a slow module name lookup doesn't hurt.
Push "r4-r6, lr"
MOV r6, r0
MOV r0, #ModHandReason_LookupName
ADRL r1, ModuleTitle
SWI XOS_Module ; Not expecting any trouble
MOV wp, r4
; Cause an actual error
TST r6, #FPSCR_IOC
ADRNE r0, ErrorBlock_VFPSupport_IO
TST r6, #FPSCR_DZC
ADRNE r0, ErrorBlock_VFPSupport_DZ
TST r6, #FPSCR_OFC
ADRNE r0, ErrorBlock_VFPSupport_OF
TST r6, #FPSCR_UFC
ADRNE r0, ErrorBlock_VFPSupport_UF
TST r6, #FPSCR_IXC
ADRNE r0, ErrorBlock_VFPSupport_IX
TST r6, #FPSCR_IDC
ADRNE r0, ErrorBlock_VFPSupport_ID
BL ReturnError_LR
Pull "r4-r6, lr"
SWI OS_GenerateError
raise_subnormal
; Raise a subnormal exception
; All regs preserved
......
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