Base: Fixed shift amount in genrand() to work with large numbers
Base: Fixed shift amount in genrand() to work with large numbers

The previous version didn't work correctly with max integer values (2^31-1 for
32-bit, 2^63-1 for 64bit version), causing "shift" to become -1.  For smaller
numbers, it wouldn't have caused functional errors, but would have resulted in
more than necessary loops in the while loop.  Special-cased cases when (max + 1
== 0) to prevent the ceilLog2 functions from failing.

KuroeKurose/gem5,austinharris/gem5-riscv,aclifton/cpeg853-gem5,gedare/gem5,SanchayanMaity/gem5,rjschof/gem5,powerjg/gem5-ci-test,cancro7/gem5,briancoutinho0905/2dsampling,HwisooSo/gemV-update,samueldotj/TeeRISC-Simulator,samueldotj/TeeRISC-Simulator,TUD-OS/gem5-dtu,powerjg/gem5-ci-test,cancro7/gem5,powerjg/gem5-ci-test,briancoutinho0905/2dsampling,kaiyuanl/gem5,samueldotj/TeeRISC-Simulator,gedare/gem5,cancro7/gem5,Weil0ng/gem5,joerocklin/gem5,KuroeKurose/gem5,gem5/gem5,markoshorro/gem5,yb-kim/gemV,yb-kim/gemV,Weil0ng/gem5,sobercoder/gem5,rjschof/gem5,kaiyuanl/gem5,gem5/gem5,gem5/gem5,HwisooSo/gemV-update,KuroeKurose/gem5,kaiyuanl/gem5,zlfben/gem5,austinharris/gem5-riscv,samueldotj/TeeRISC-Simulator,qizenguf/MLC-STT,yb-kim/gemV,zlfben/gem5,rjschof/gem5,markoshorro/gem5,rallylee/gem5,rjschof/gem5,sobercoder/gem5,qizenguf/MLC-STT,powerjg/gem5-ci-test,powerjg/gem5-ci-test,TUD-OS/gem5-dtu,cancro7/gem5,SanchayanMaity/gem5,rallylee/gem5,HwisooSo/gemV-update,Weil0ng/gem5,Weil0ng/gem5,aclifton/cpeg853-gem5,sobercoder/gem5,austinharris/gem5-riscv,briancoutinho0905/2dsampling,TUD-OS/gem5-dtu,cancro7/gem5,aclifton/cpeg853-gem5,zlfben/gem5,aclifton/cpeg853-gem5,kaiyuanl/gem5,gem5/gem5,rjschof/gem5,gedare/gem5,markoshorro/gem5,qizenguf/MLC-STT,joerocklin/gem5,SanchayanMaity/gem5,KuroeKurose/gem5,joerocklin/gem5,kaiyuanl/gem5,Weil0ng/gem5,joerocklin/gem5,KuroeKurose/gem5,kaiyuanl/gem5,HwisooSo/gemV-update,samueldotj/TeeRISC-Simulator,austinharris/gem5-riscv,cancro7/gem5,aclifton/cpeg853-gem5,Weil0ng/gem5,joerocklin/gem5,TUD-OS/gem5-dtu,powerjg/gem5-ci-test,samueldotj/TeeRISC-Simulator,austinharris/gem5-riscv,rallylee/gem5,zlfben/gem5,yb-kim/gemV,rallylee/gem5,briancoutinho0905/2dsampling,kaiyuanl/gem5,HwisooSo/gemV-update,TUD-OS/gem5-dtu,KuroeKurose/gem5,gem5/gem5,sobercoder/gem5,gem5/gem5,markoshorro/gem5,rallylee/gem5,qizenguf/MLC-STT,yb-kim/gemV,yb-kim/gemV,markoshorro/gem5,rjschof/gem5,rjschof/gem5,austinharris/gem5-riscv,qizenguf/MLC-STT,rallylee/gem5,TUD-OS/gem5-dtu,Weil0ng/gem5,gedare/gem5,qizenguf/MLC-STT,rallylee/gem5,HwisooSo/gemV-update,KuroeKurose/gem5,aclifton/cpeg853-gem5,briancoutinho0905/2dsampling,SanchayanMaity/gem5,zlfben/gem5,yb-kim/gemV,zlfben/gem5,markoshorro/gem5,gedare/gem5,SanchayanMaity/gem5,yb-kim/gemV,SanchayanMaity/gem5,sobercoder/gem5,briancoutinho0905/2dsampling,aclifton/cpeg853-gem5,zlfben/gem5,joerocklin/gem5,SanchayanMaity/gem5,HwisooSo/gemV-update,austinharris/gem5-riscv,powerjg/gem5-ci-test,gedare/gem5,TUD-OS/gem5-dtu,joerocklin/gem5,gedare/gem5,samueldotj/TeeRISC-Simulator,qizenguf/MLC-STT,cancro7/gem5,sobercoder/gem5,briancoutinho0905/2dsampling,markoshorro/gem5,gem5/gem5,joerocklin/gem5,sobercoder/gem5