gem5  v22.1.0.0
Functions
intmath.test.cc File Reference
#include <gtest/gtest.h>
#include <tuple>
#include "base/intmath.hh"

Go to the source code of this file.

Functions

 TEST (IntmathTest, isPowerOf2)
 
 TEST (IntmathTest, floorLog2)
 
 TEST (IntmathTest, ceilLog2)
 
 TEST (IntmathTest, divCeil)
 
 TEST (IntmathTest, mulUnsignedNarrow)
 
 TEST (IntmathTest, mulSignedNarrow)
 
 TEST (IntmathTest, mulUnsignedMid)
 
 TEST (IntmathTest, mulSignedMid)
 
 TEST (IntmathTest, mulUnsignedWide)
 
 TEST (IntmathTest, mulSignedWide)
 
 TEST (IntmathTest, roundUp)
 
 TEST (IntmathTest, roundDown)
 
 TEST (IntmathTest, Log2i)
 This is testing if log2i actually works. More...
 
 TEST (IntmathDeathTest, Log2iDeath)
 This is testing the assertions: what if invalid arguments are provided to log2i: More...
 

Function Documentation

◆ TEST() [1/14]

TEST ( IntmathDeathTest  ,
Log2iDeath   
)

This is testing the assertions: what if invalid arguments are provided to log2i:

1) value = 0 2) value < 0 3) value is not a power of 2

Definition at line 307 of file intmath.test.cc.

References gem5::log2i().

◆ TEST() [2/14]

TEST ( IntmathTest  ,
ceilLog2   
)

Definition at line 96 of file intmath.test.cc.

References gem5::ceilLog2().

◆ TEST() [3/14]

TEST ( IntmathTest  ,
divCeil   
)

Definition at line 109 of file intmath.test.cc.

References gem5::divCeil().

◆ TEST() [4/14]

TEST ( IntmathTest  ,
floorLog2   
)

Definition at line 60 of file intmath.test.cc.

References gem5::floorLog2().

◆ TEST() [5/14]

TEST ( IntmathTest  ,
isPowerOf2   
)

Definition at line 47 of file intmath.test.cc.

References gem5::isPowerOf2().

◆ TEST() [6/14]

TEST ( IntmathTest  ,
Log2i   
)

This is testing if log2i actually works.

at every iteration value is multiplied by 2 (left shift) and expected is incremented by one. This until value reaches becomes negative (by left shifting) which is when expected points to the MSB

Definition at line 289 of file intmath.test.cc.

References expected(), and gem5::log2i().

◆ TEST() [7/14]

TEST ( IntmathTest  ,
mulSignedMid   
)

Definition at line 187 of file intmath.test.cc.

References gem5::ArmISA::a, and gem5::ArmISA::b.

◆ TEST() [8/14]

TEST ( IntmathTest  ,
mulSignedNarrow   
)

Definition at line 141 of file intmath.test.cc.

References gem5::ArmISA::a, and gem5::ArmISA::b.

◆ TEST() [9/14]

TEST ( IntmathTest  ,
mulSignedWide   
)

Definition at line 239 of file intmath.test.cc.

References gem5::ArmISA::a, and gem5::ArmISA::b.

◆ TEST() [10/14]

TEST ( IntmathTest  ,
mulUnsignedMid   
)

Definition at line 164 of file intmath.test.cc.

References gem5::ArmISA::a, and gem5::ArmISA::b.

◆ TEST() [11/14]

TEST ( IntmathTest  ,
mulUnsignedNarrow   
)

Definition at line 118 of file intmath.test.cc.

References gem5::ArmISA::a, and gem5::ArmISA::b.

◆ TEST() [12/14]

TEST ( IntmathTest  ,
mulUnsignedWide   
)

Definition at line 210 of file intmath.test.cc.

References gem5::ArmISA::a, and gem5::ArmISA::b.

◆ TEST() [13/14]

TEST ( IntmathTest  ,
roundDown   
)

Definition at line 276 of file intmath.test.cc.

References gem5::roundDown().

◆ TEST() [14/14]

TEST ( IntmathTest  ,
roundUp   
)

Definition at line 268 of file intmath.test.cc.

References gem5::roundUp().


Generated on Wed Dec 21 2022 10:22:53 for gem5 by doxygen 1.9.1