gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Namespaces | Macros | Functions | Variables
fplib.cc File Reference
#include <stdint.h>
#include <cassert>
#include "fplib.hh"

Go to the source code of this file.

Namespaces

 ArmISA
 

Macros

#define FPLIB_RN   0
 
#define FPLIB_RP   1
 
#define FPLIB_RM   2
 
#define FPLIB_RZ   3
 
#define FPLIB_FZ   4
 
#define FPLIB_DN   8
 
#define FPLIB_AHP   16
 
#define FPLIB_IDC   128
 
#define FPLIB_IXC   16
 
#define FPLIB_UFC   8
 
#define FPLIB_OFC   4
 
#define FPLIB_DZC   2
 
#define FPLIB_IOC   1
 

Functions

static uint16_t ArmISA::lsl16 (uint16_t x, uint32_t shift)
 
static uint16_t ArmISA::lsr16 (uint16_t x, uint32_t shift)
 
static uint32_t ArmISA::lsl32 (uint32_t x, uint32_t shift)
 
static uint32_t ArmISA::lsr32 (uint32_t x, uint32_t shift)
 
static uint64_t ArmISA::lsl64 (uint64_t x, uint32_t shift)
 
static uint64_t ArmISA::lsr64 (uint64_t x, uint32_t shift)
 
static void ArmISA::lsl128 (uint64_t *r0, uint64_t *r1, uint64_t x0, uint64_t x1, uint32_t shift)
 
static void ArmISA::lsr128 (uint64_t *r0, uint64_t *r1, uint64_t x0, uint64_t x1, uint32_t shift)
 
static void ArmISA::mul62x62 (uint64_t *x0, uint64_t *x1, uint64_t a, uint64_t b)
 
static void ArmISA::mul64x32 (uint64_t *x0, uint64_t *x1, uint64_t a, uint32_t b)
 
static void ArmISA::add128 (uint64_t *x0, uint64_t *x1, uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1)
 
static void ArmISA::sub128 (uint64_t *x0, uint64_t *x1, uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1)
 
static int ArmISA::cmp128 (uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1)
 
static uint16_t ArmISA::fp16_normalise (uint16_t mnt, int *exp)
 
static uint32_t ArmISA::fp32_normalise (uint32_t mnt, int *exp)
 
static uint64_t ArmISA::fp64_normalise (uint64_t mnt, int *exp)
 
static void ArmISA::fp128_normalise (uint64_t *mnt0, uint64_t *mnt1, int *exp)
 
static uint16_t ArmISA::fp16_pack (uint16_t sgn, uint16_t exp, uint16_t mnt)
 
static uint32_t ArmISA::fp32_pack (uint32_t sgn, uint32_t exp, uint32_t mnt)
 
static uint64_t ArmISA::fp64_pack (uint64_t sgn, uint64_t exp, uint64_t mnt)
 
static uint16_t ArmISA::fp16_zero (int sgn)
 
static uint32_t ArmISA::fp32_zero (int sgn)
 
static uint64_t ArmISA::fp64_zero (int sgn)
 
static uint16_t ArmISA::fp16_max_normal (int sgn)
 
static uint32_t ArmISA::fp32_max_normal (int sgn)
 
static uint64_t ArmISA::fp64_max_normal (int sgn)
 
static uint16_t ArmISA::fp16_infinity (int sgn)
 
static uint32_t ArmISA::fp32_infinity (int sgn)
 
static uint64_t ArmISA::fp64_infinity (int sgn)
 
static uint16_t ArmISA::fp16_defaultNaN ()
 
static uint32_t ArmISA::fp32_defaultNaN ()
 
static uint64_t ArmISA::fp64_defaultNaN ()
 
static void ArmISA::fp16_unpack (int *sgn, int *exp, uint16_t *mnt, uint16_t x, int mode, int *flags)
 
static void ArmISA::fp32_unpack (int *sgn, int *exp, uint32_t *mnt, uint32_t x, int mode, int *flags)
 
static void ArmISA::fp64_unpack (int *sgn, int *exp, uint64_t *mnt, uint64_t x, int mode, int *flags)
 
static uint32_t ArmISA::fp32_process_NaN (uint32_t a, int mode, int *flags)
 
static uint64_t ArmISA::fp64_process_NaN (uint64_t a, int mode, int *flags)
 
static uint32_t ArmISA::fp32_process_NaNs (uint32_t a, uint32_t b, int mode, int *flags)
 
static uint64_t ArmISA::fp64_process_NaNs (uint64_t a, uint64_t b, int mode, int *flags)
 
static uint32_t ArmISA::fp32_process_NaNs3 (uint32_t a, uint32_t b, uint32_t c, int mode, int *flags)
 
static uint64_t ArmISA::fp64_process_NaNs3 (uint64_t a, uint64_t b, uint64_t c, int mode, int *flags)
 
static uint16_t ArmISA::fp16_round_ (int sgn, int exp, uint16_t mnt, int rm, int mode, int *flags)
 
static uint32_t ArmISA::fp32_round_ (int sgn, int exp, uint32_t mnt, int rm, int mode, int *flags)
 
static uint32_t ArmISA::fp32_round (int sgn, int exp, uint32_t mnt, int mode, int *flags)
 
static uint64_t ArmISA::fp64_round_ (int sgn, int exp, uint64_t mnt, int rm, int mode, int *flags)
 
static uint64_t ArmISA::fp64_round (int sgn, int exp, uint64_t mnt, int mode, int *flags)
 
static int ArmISA::fp32_compare_eq (uint32_t a, uint32_t b, int mode, int *flags)
 
static int ArmISA::fp32_compare_ge (uint32_t a, uint32_t b, int mode, int *flags)
 
static int ArmISA::fp32_compare_gt (uint32_t a, uint32_t b, int mode, int *flags)
 
static int ArmISA::fp64_compare_eq (uint64_t a, uint64_t b, int mode, int *flags)
 
static int ArmISA::fp64_compare_ge (uint64_t a, uint64_t b, int mode, int *flags)
 
static int ArmISA::fp64_compare_gt (uint64_t a, uint64_t b, int mode, int *flags)
 
static uint32_t ArmISA::fp32_add (uint32_t a, uint32_t b, int neg, int mode, int *flags)
 
static uint64_t ArmISA::fp64_add (uint64_t a, uint64_t b, int neg, int mode, int *flags)
 
static uint32_t ArmISA::fp32_mul (uint32_t a, uint32_t b, int mode, int *flags)
 
static uint64_t ArmISA::fp64_mul (uint64_t a, uint64_t b, int mode, int *flags)
 
static uint32_t ArmISA::fp32_muladd (uint32_t a, uint32_t b, uint32_t c, int scale, int mode, int *flags)
 
static uint64_t ArmISA::fp64_muladd (uint64_t a, uint64_t b, uint64_t c, int scale, int mode, int *flags)
 
static uint32_t ArmISA::fp32_div (uint32_t a, uint32_t b, int mode, int *flags)
 
static uint64_t ArmISA::fp64_div (uint64_t a, uint64_t b, int mode, int *flags)
 
static void ArmISA::set_fpscr0 (FPSCR &fpscr, int flags)
 
static uint32_t ArmISA::fp32_sqrt (uint32_t a, int mode, int *flags)
 
static uint64_t ArmISA::fp64_sqrt (uint64_t a, int mode, int *flags)
 
static int ArmISA::modeConv (FPSCR fpscr)
 
static void ArmISA::set_fpscr (FPSCR &fpscr, int flags)
 
template<>
bool ArmISA::fplibCompareEQ (uint32_t a, uint32_t b, FPSCR &fpscr)
 
template<>
bool ArmISA::fplibCompareGE (uint32_t a, uint32_t b, FPSCR &fpscr)
 
template<>
bool ArmISA::fplibCompareGT (uint32_t a, uint32_t b, FPSCR &fpscr)
 
template<>
bool ArmISA::fplibCompareEQ (uint64_t a, uint64_t b, FPSCR &fpscr)
 
template<>
bool ArmISA::fplibCompareGE (uint64_t a, uint64_t b, FPSCR &fpscr)
 
template<>
bool ArmISA::fplibCompareGT (uint64_t a, uint64_t b, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibAbs (uint32_t op)
 
template<>
uint64_t ArmISA::fplibAbs (uint64_t op)
 
template<>
uint32_t ArmISA::fplibAdd (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibAdd (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
int ArmISA::fplibCompare (uint32_t op1, uint32_t op2, bool signal_nans, FPSCR &fpscr)
 
template<>
int ArmISA::fplibCompare (uint64_t op1, uint64_t op2, bool signal_nans, FPSCR &fpscr)
 
static uint16_t ArmISA::fp16_FPConvertNaN_32 (uint32_t op)
 
static uint16_t ArmISA::fp16_FPConvertNaN_64 (uint64_t op)
 
static uint32_t ArmISA::fp32_FPConvertNaN_16 (uint16_t op)
 
static uint32_t ArmISA::fp32_FPConvertNaN_64 (uint64_t op)
 
static uint64_t ArmISA::fp64_FPConvertNaN_16 (uint16_t op)
 
static uint64_t ArmISA::fp64_FPConvertNaN_32 (uint32_t op)
 
static uint32_t ArmISA::fp32_FPOnePointFive (int sgn)
 
static uint64_t ArmISA::fp64_FPOnePointFive (int sgn)
 
static uint32_t ArmISA::fp32_FPThree (int sgn)
 
static uint64_t ArmISA::fp64_FPThree (int sgn)
 
static uint32_t ArmISA::fp32_FPTwo (int sgn)
 
static uint64_t ArmISA::fp64_FPTwo (int sgn)
 
template<>
uint16_t ArmISA::fplibConvert (uint32_t op, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint16_t ArmISA::fplibConvert (uint64_t op, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibConvert (uint16_t op, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibConvert (uint64_t op, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibConvert (uint16_t op, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibConvert (uint32_t op, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibMulAdd (uint32_t addend, uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibMulAdd (uint64_t addend, uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibDiv (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibDiv (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
static uint32_t ArmISA::fp32_repack (int sgn, int exp, uint32_t mnt)
 
static uint64_t ArmISA::fp64_repack (int sgn, int exp, uint64_t mnt)
 
static void ArmISA::fp32_minmaxnum (uint32_t *op1, uint32_t *op2, int sgn)
 
static void ArmISA::fp64_minmaxnum (uint64_t *op1, uint64_t *op2, int sgn)
 
template<>
uint32_t ArmISA::fplibMax (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibMax (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibMaxNum (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibMaxNum (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibMin (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibMin (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibMinNum (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibMinNum (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibMul (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibMul (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibMulX (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibMulX (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibNeg (uint32_t op)
 
template<>
uint64_t ArmISA::fplibNeg (uint64_t op)
 
template<>
uint32_t ArmISA::fplibRSqrtEstimate (uint32_t op, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibRSqrtEstimate (uint64_t op, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibRSqrtStepFused (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibRSqrtStepFused (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibRecipStepFused (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibRecipEstimate (uint32_t op, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibRecipEstimate (uint64_t op, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibRecipStepFused (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibRecpX (uint32_t op, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibRecpX (uint64_t op, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibRoundInt (uint32_t op, FPRounding rounding, bool exact, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibRoundInt (uint64_t op, FPRounding rounding, bool exact, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibSqrt (uint32_t op, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibSqrt (uint64_t op, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibSub (uint32_t op1, uint32_t op2, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibSub (uint64_t op1, uint64_t op2, FPSCR &fpscr)
 
static uint64_t ArmISA::FPToFixed_64 (int sgn, int exp, uint64_t mnt, bool u, FPRounding rounding, int *flags)
 
static uint32_t ArmISA::FPToFixed_32 (int sgn, int exp, uint64_t mnt, bool u, FPRounding rounding, int *flags)
 
template<>
uint32_t ArmISA::fplibFPToFixed (uint32_t op, int fbits, bool u, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint32_t ArmISA::fplibFPToFixed (uint64_t op, int fbits, bool u, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibFPToFixed (uint32_t op, int fbits, bool u, FPRounding rounding, FPSCR &fpscr)
 
template<>
uint64_t ArmISA::fplibFPToFixed (uint64_t op, int fbits, bool u, FPRounding rounding, FPSCR &fpscr)
 
static uint32_t ArmISA::fp32_cvtf (uint64_t a, int fbits, int u, int mode, int *flags)
 
static uint64_t ArmISA::fp64_cvtf (uint64_t a, int fbits, int u, int mode, int *flags)
 
template<>
uint32_t ArmISA::fplibFixedToFP (uint64_t op, int fbits, bool u, FPRounding rounding, FPSCR &fpscr)
 Floating-point convert from fixed-point. More...
 
template<>
uint64_t ArmISA::fplibFixedToFP (uint64_t op, int fbits, bool u, FPRounding rounding, FPSCR &fpscr)
 Floating-point convert from fixed-point. More...
 

Variables

static const uint8_t ArmISA::recip_sqrt_estimate [256]
 

Macro Definition Documentation

#define FPLIB_AHP   16

Definition at line 56 of file fplib.cc.

Referenced by ArmISA::fp16_round_().

#define FPLIB_DN   8

Definition at line 55 of file fplib.cc.

Referenced by ArmISA::fp32_process_NaN(), and ArmISA::fp64_process_NaN().

#define FPLIB_DZC   2
#define FPLIB_FZ   4
#define FPLIB_IDC   128
#define FPLIB_IOC   1
#define FPLIB_IXC   16
#define FPLIB_OFC   4
#define FPLIB_RM   2

Definition at line 52 of file fplib.cc.

Referenced by ArmISA::fp16_round_(), ArmISA::fp32_round_(), and ArmISA::fp64_round_().

#define FPLIB_RN   0

Definition at line 50 of file fplib.cc.

Referenced by ArmISA::fp16_round_(), ArmISA::fp32_round_(), and ArmISA::fp64_round_().

#define FPLIB_RP   1

Definition at line 51 of file fplib.cc.

Referenced by ArmISA::fp16_round_(), ArmISA::fp32_round_(), and ArmISA::fp64_round_().

#define FPLIB_RZ   3

Definition at line 53 of file fplib.cc.

#define FPLIB_UFC   8

Generated on Fri Jun 9 2017 13:03:55 for gem5 by doxygen 1.8.6