;
;	Name: riscosfp.s
;
;	FPA trap control for the SQLite RISC OS VFS.  SQLite relies on IEEE
;	overflow to Inf (e.g. 1e308*10), which traps by default under
;	SharedCLibrary.  Clears the IVO, DVZ and OFL trap enables, as
;	!SampleEd's fp_start does.
;

	AREA |C$$code|, CODE, READONLY

	EXPORT |riscos_fp_traps_off|
	EXPORT |riscos_fp_restore|

; unsigned int riscos_fp_traps_off(void) - returns the previous FPSR
|riscos_fp_traps_off|
	RFS r0
	BIC r1,r0,#&70000
	WFS r1
	MOV pc,lr

; void riscos_fp_restore(unsigned int fpsr)
|riscos_fp_restore|
	WFS r0
	MOV pc,lr

	END
