;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; ;;; Microsoft Research Singularity ;;; ;;; Copyright (c) Microsoft Corporation. All rights reserved. ;;; ;;; This file contains ARM-specific assembly code. ;;; ; format_e.s ; ; Copyright (C) Advanced RISC Machines Limited, 1994. All rights reserved. ; ; RCS Revision: 1 ; Checkin Date: 2007/06/29 02:59:16 ; Revising Author GET fpe.asm AREA |.text|, CODE, READONLY SNaNInf EQU NaNInfExp_Single - EIExp_bias + SExp_bias DNaNInf EQU NaNInfExp_Double - EIExp_bias + DExp_bias ;============================================================================== [ :DEF: e2e_s EXPORT _e2e ; Convert a five-word internal value to a three word value ; ; Enters with the partly-constructed internal precision value in OP1sue, ; OP1mhi and OP1mlo, the exponent in RNDexp and the guard/sticky bits in ; Rarith. No truncation is needed, only rounding. [ :DEF: thumb CODE32 ] _e2e TST OP1sue,#Error_bit+Uncommon_bit BNE _e2e_error_or_uncommon MOVS Rtmp,Rarith,LSL #1 ;C<-round, Z<-"tied (or exact) case" BEQ _e2e_exact_or_tied _e2e_round_by_C ADDCSS OP1mlo,OP1mlo,#1 ;Increment low word ADDCSS OP1mhi,OP1mhi,#1 ;If carry out, increment high word MOVCS OP1mhi,#EIUnits_bit ;If mantissa overflow, adjust ADCS RNDexp,RNDexp,#0 ; mantissa and exponent BMI _e2e_underflow ;Check for overflow in the usual way ADD tmp,RNDexp,#1 BIC tmp,tmp,#Uncommon_bit CMP tmp,#1<