aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/mcore/lsr.s
diff options
context:
space:
mode:
Diffstat (limited to 'sim/testsuite/mcore/lsr.s')
-rw-r--r--sim/testsuite/mcore/lsr.s28
1 files changed, 28 insertions, 0 deletions
diff --git a/sim/testsuite/mcore/lsr.s b/sim/testsuite/mcore/lsr.s
new file mode 100644
index 0000000..a9a76aa
--- /dev/null
+++ b/sim/testsuite/mcore/lsr.s
@@ -0,0 +1,28 @@
+# check that lsr works correctly
+# mach: mcore
+
+.include "testutils.inc"
+
+ start
+ # Construct -1
+ bmaski r2, 32
+
+ # Construct 24
+ movi r3, 24
+
+ # logical shift right by r3 (24)
+ lsr r2, r3
+
+ # Construct 255
+ bmaski r1, 8
+
+ # Compare them, they should be equal
+ cmpne r2,r1
+ jbt .L1
+ pass
+.L1:
+ fail
+
+
+
+