######################################################################################
#  fpHPPA.s (Basic Interval Arithmetic Subroutines Level 0 - Rounding Control)
#
#  Version:                     1.1
#  Date:                        2/2/94
#  Author:                      O. Knueppel
#
#  Architecture: HP-PA
######################################################################################

	.VERSION	"Rounding Mode Switch for HP-PA"
	
        .SPACE  $TEXT$,SORT=8
        .SUBSPA $CODE$,QUAD=0,ALIGN=4,ACCESS=44,CODE_ONLY,SORT=24
BiasRoundDown
        .PROC
        .CALLINFO CALLER,FRAME=0
        .ENTRY
	LDIL	LR'CwRoundDown,%r23
	LDO	RR'CwRoundDown+16(%r23),%r31
	BV	%r0(%r2)
	.EXIT
	FLDWS	-16(0,%r31),%fr0L
        .PROCEND


        .SPACE  $TEXT$
        .SUBSPA $CODE$,QUAD=0,ALIGN=4,ACCESS=44,CODE_ONLY,SORT=24
BiasRoundUp
        .PROC
        .CALLINFO CALLER,FRAME=0
        .ENTRY
	LDIL	LR'CwRoundUp,%r23
	LDO	RR'CwRoundUp+16(%r23),%r31
	BV	%r0(%r2)
	.EXIT
	FLDWS	-16(0,%r31),%fr0L
        .PROCEND


        .SPACE  $TEXT$
        .SUBSPA $CODE$,QUAD=0,ALIGN=4,ACCESS=44,CODE_ONLY,SORT=24
BiasRoundNear
        .PROC
        .CALLINFO CALLER,FRAME=0
        .ENTRY
	LDIL	LR'CwRoundNear,%r23
	LDO	RR'CwRoundNear+16(%r23),%r31
	BV	%r0(%r2)
	.EXIT
	FLDWS	-16(0,%r31),%fr0L
        .PROCEND


        .SPACE  $TEXT$
        .SUBSPA $CODE$
        .SUBSPA $CODE$
        .SUBSPA $CODE$
        .SPACE  $PRIVATE$,SORT=16
        .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31,SORT=16
        .SUBSPA $SHORTDATA$,QUAD=1,ALIGN=8,ACCESS=31,SORT=24
CwRoundDown
	.ALIGN	4
	.WORD	0x81e00
CwRoundUp
	.ALIGN	4
	.WORD	0x81c00
CwRoundNear
	.ALIGN	4
	.WORD	0x81800
        .SPACE  $TEXT$
        .SUBSPA $CODE$
        .EXPORT BiasRoundDown,ENTRY,PRIV_LEV=3
        .SUBSPA $CODE$
        .EXPORT BiasRoundUp,ENTRY,PRIV_LEV=3
        .SUBSPA $CODE$
        .EXPORT BiasRoundNear,ENTRY,PRIV_LEV=3
        .END
