summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts/fplib.cc
diff options
context:
space:
mode:
authorNathanael Premillieu <nathananel.premillieu@arm.com>2015-11-22 05:10:18 -0500
committerNathanael Premillieu <nathananel.premillieu@arm.com>2015-11-22 05:10:18 -0500
commitbbdd7cecb90704cf33277816e18aaf2b8e2ff8c2 (patch)
tree7a6aece3974e2a78859e973f7405032ec582a6b8 /src/arch/arm/insts/fplib.cc
parent6adb728fb4238992e5f07ca5db1f9c0aac30df6a (diff)
downloadgem5-bbdd7cecb90704cf33277816e18aaf2b8e2ff8c2.tar.xz
arm: Fix fplib 128-bit shift operators
Appease clang.
Diffstat (limited to 'src/arch/arm/insts/fplib.cc')
-rw-r--r--src/arch/arm/insts/fplib.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/arch/arm/insts/fplib.cc b/src/arch/arm/insts/fplib.cc
index 98410dd38..e01644887 100644
--- a/src/arch/arm/insts/fplib.cc
+++ b/src/arch/arm/insts/fplib.cc
@@ -101,7 +101,10 @@ lsr64(uint64_t x, uint32_t shift)
static inline void
lsl128(uint64_t *r0, uint64_t *r1, uint64_t x0, uint64_t x1, uint32_t shift)
{
- if (shift < 64) {
+ if (shift == 0) {
+ *r1 = x1;
+ *r0 = x0;
+ } else if (shift < 64) {
*r1 = x1 << shift | x0 >> (64 - shift);
*r0 = x0 << shift;
} else if (shift < 128) {
@@ -116,7 +119,10 @@ lsl128(uint64_t *r0, uint64_t *r1, uint64_t x0, uint64_t x1, uint32_t shift)
static inline void
lsr128(uint64_t *r0, uint64_t *r1, uint64_t x0, uint64_t x1, uint32_t shift)
{
- if (shift < 64) {
+ if (shift == 0) {
+ *r1 = x1;
+ *r0 = x0;
+ } else if (shift < 64) {
*r0 = x0 >> shift | x1 << (64 - shift);
*r1 = x1 >> shift;
} else if (shift < 128) {