summaryrefslogtreecommitdiff
path: root/tests/test-progs
diff options
context:
space:
mode:
authorAlec Roelke <ar4jc@virginia.edu>2017-12-02 12:58:14 -0500
committerAlec Roelke <ar4jc@virginia.edu>2018-01-10 16:07:02 +0000
commite22894353869092c9da4977ec9ef74afa94cf57a (patch)
treeb0a3df8042d1939818e54a7a473af8eed0364710 /tests/test-progs
parent78524bda5606e1b60615f57ebd6bfe5bcdd71afb (diff)
downloadgem5-e22894353869092c9da4977ec9ef74afa94cf57a.tar.xz
arch-riscv: Make use of ImmOp's polymorphism
This patch makes use of ImmOp's polymorphism to remove unnecessary casting from the implementations of arithmetic instructions with immediate operands and to remove the CUIOp format by combining it with the CIOp format (compressed arithmetic instructions with immediate operands). Interestingly, RISC-V specifies that instructions with unsigned immediate operands still need to sign-extend the immediates from 12 (or 20) bits to 64 bits, so that is left alone. Change-Id: If20d70c1e90f379b9ed8a4155b2b9222b6defe16 Reviewed-on: https://gem5-review.googlesource.com/6401 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-by: Tuan Ta <qtt2@cornell.edu> Maintainer: Alec Roelke <ar4jc@virginia.edu>
Diffstat (limited to 'tests/test-progs')
-rwxr-xr-xtests/test-progs/insttest/bin/riscv/linux-rv64i/insttestbin14034904 -> 14035216 bytes
-rw-r--r--tests/test-progs/insttest/src/riscv/rv64i.cpp1
2 files changed, 1 insertions, 0 deletions
diff --git a/tests/test-progs/insttest/bin/riscv/linux-rv64i/insttest b/tests/test-progs/insttest/bin/riscv/linux-rv64i/insttest
index a6e5d0203..c5a21739d 100755
--- a/tests/test-progs/insttest/bin/riscv/linux-rv64i/insttest
+++ b/tests/test-progs/insttest/bin/riscv/linux-rv64i/insttest
Binary files differ
diff --git a/tests/test-progs/insttest/src/riscv/rv64i.cpp b/tests/test-progs/insttest/src/riscv/rv64i.cpp
index 95e8ee02a..cfe5e298d 100644
--- a/tests/test-progs/insttest/src/riscv/rv64i.cpp
+++ b/tests/test-progs/insttest/src/riscv/rv64i.cpp
@@ -137,6 +137,7 @@ int main()
// SLTIU
expect<bool>(false, []{return I::sltiu(-1, 0);}, "sltiu, false");
expect<bool>(true, []{return I::sltiu(0, -1);}, "sltiu, true");
+ expect<bool>(true, []{return I::sltiu(0xFFFF, -1);}, "sltiu, sext");
// XORI
expect<uint64_t>(0xFF, []{return I::xori(0xAA, 0x55);}, "xori (1)");