aboutsummaryrefslogtreecommitdiff
path: root/tests/tcg/hexagon/test_cmp.S
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tcg/hexagon/test_cmp.S')
-rw-r--r--tests/tcg/hexagon/test_cmp.S31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/tcg/hexagon/test_cmp.S b/tests/tcg/hexagon/test_cmp.S
new file mode 100644
index 0000000000..1db87d3db5
--- /dev/null
+++ b/tests/tcg/hexagon/test_cmp.S
@@ -0,0 +1,31 @@
+/* Purpose: test a signed and unsigned comparison */
+
+ .text
+ .globl _start
+
+_start:
+ {
+ jump signed
+ }
+
+ .globl signed
+signed:
+ {
+ r0 = #-2
+ r1 = #0
+ }
+ {
+ p0 = cmp.lt(r0, r1); if (p0.new) jump:t unsigned
+ jump fail
+ }
+
+ .globl unsigned
+unsigned:
+ {
+ r0 = #-2
+ r1 = #0
+ }
+ {
+ p0 = cmp.gtu(r0, r1); if (p0.new) jump:t pass
+ jump fail
+ }