[llvm] r253000 - [Hexagon] NFC. Adding a number of packet correctness tests.
Colin LeMahieu via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 12 17:46:07 PST 2015
Author: colinl
Date: Thu Nov 12 19:46:06 2015
New Revision: 253000
URL: http://llvm.org/viewvc/llvm-project?rev=253000&view=rev
Log:
[Hexagon] NFC. Adding a number of packet correctness tests.
Added:
llvm/trunk/test/MC/Hexagon/capitalizedEndloop.s
llvm/trunk/test/MC/Hexagon/dcfetch.s
llvm/trunk/test/MC/Hexagon/empty_asm.s
llvm/trunk/test/MC/Hexagon/endloop.s
llvm/trunk/test/MC/Hexagon/relaxed_newvalue.s
Added: llvm/trunk/test/MC/Hexagon/capitalizedEndloop.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Hexagon/capitalizedEndloop.s?rev=253000&view=auto
==============================================================================
--- llvm/trunk/test/MC/Hexagon/capitalizedEndloop.s (added)
+++ llvm/trunk/test/MC/Hexagon/capitalizedEndloop.s Thu Nov 12 19:46:06 2015
@@ -0,0 +1,29 @@
+# RUN: llvm-mc -triple=hexagon -filetype=obj %s | llvm-objdump -d -r - | FileCheck %s
+#
+
+# Verify that capitaizled endloops work
+
+ { R0 = mpyi(R0,R0) } : endloop0
+ { R0 = mpyi(R0,R0) } : ENDLOOP0
+ { R0 = mpyi(R0,R0) }:endloop0
+
+ { R0 = mpyi(R0,R0) } : endloop1
+ { R0 = mpyi(R0,R0) } : ENDLOOP1
+ { R0 = mpyi(R0,R0) }:endloop1
+
+ { R0 = mpyi(R0,R0) } : endloop0 : endloop1
+ { R0 = mpyi(R0,R0) } : ENDLOOP0 : ENDLOOP1
+ { R0 = mpyi(R0,R0) }:endloop0:endloop1
+
+# CHECK: r0 = mpyi(r0, r0)
+# CHECK: :endloop0
+# CHECK: :endloop0
+# CHECK: :endloop0
+# CHECK: :endloop1
+# CHECK: :endloop1
+# CHECK: :endloop1
+# CHECK: :endloop0 :endloop1
+# CHECK: :endloop0 :endloop1
+# CHECK: :endloop0 :endloop1
+
+
Added: llvm/trunk/test/MC/Hexagon/dcfetch.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Hexagon/dcfetch.s?rev=253000&view=auto
==============================================================================
--- llvm/trunk/test/MC/Hexagon/dcfetch.s (added)
+++ llvm/trunk/test/MC/Hexagon/dcfetch.s Thu Nov 12 19:46:06 2015
@@ -0,0 +1,15 @@
+# RUN: llvm-mc -triple=hexagon -filetype=obj -mno-pairing %s -o %t; llvm-objdump -d %t | FileCheck %s
+
+# Check that DCFETCH is correctly shuffled.
+
+ { dcfetch(r2 + #0); r1 = memw(r2) }
+# CHECK: 9402c000
+
+# Bug 17424: This should be a legal packet
+{
+ P3 = SP1LOOP0(#8,R18)
+ R7:6 = MEMUBH(R4++#4)
+ R13:12 = VALIGNB(R11:10,R9:8,P2)
+ DCFETCH(R5+#(8+0))
+}
+# CHECK-NOT: error:
Added: llvm/trunk/test/MC/Hexagon/empty_asm.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Hexagon/empty_asm.s?rev=253000&view=auto
==============================================================================
--- llvm/trunk/test/MC/Hexagon/empty_asm.s (added)
+++ llvm/trunk/test/MC/Hexagon/empty_asm.s Thu Nov 12 19:46:06 2015
@@ -0,0 +1,15 @@
+# RUN: llvm-mc -triple=hexagon -filetype=asm %s -o - | FileCheck %s
+
+# Verify empty packets aren't printed
+barrier
+{}
+barrier
+# CHECK: {
+# CHECK-NEXT: barrier
+# CHECK-NEXT: }
+# CHECK-NOT: }
+# CHECK: {
+# CHECK-NEXT: barrier
+# CHECK-NEXT: }
+
+
Added: llvm/trunk/test/MC/Hexagon/endloop.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Hexagon/endloop.s?rev=253000&view=auto
==============================================================================
--- llvm/trunk/test/MC/Hexagon/endloop.s (added)
+++ llvm/trunk/test/MC/Hexagon/endloop.s Thu Nov 12 19:46:06 2015
@@ -0,0 +1,19 @@
+# RUN: llvm-mc -triple=hexagon -filetype=asm %s 2>%t; FileCheck %s <%t
+
+# Check that a branch in an end-loop packet is caught.
+
+1:
+{
+ r0 = #1
+ p0 = cmp.eq (r1, r2)
+ if (p0) jump 1b
+}:endloop0
+
+2:
+{
+ r0 = #1
+ p0 = cmp.eq (r1, r2)
+ if (p0) jump 2b
+}:endloop1
+
+# CHECK: rror: packet marked with `:endloop{{.}}' cannot contain instructions that modify register
Added: llvm/trunk/test/MC/Hexagon/relaxed_newvalue.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/Hexagon/relaxed_newvalue.s?rev=253000&view=auto
==============================================================================
--- llvm/trunk/test/MC/Hexagon/relaxed_newvalue.s (added)
+++ llvm/trunk/test/MC/Hexagon/relaxed_newvalue.s Thu Nov 12 19:46:06 2015
@@ -0,0 +1,10 @@
+# RUN: llvm-mc -triple=hexagon -filetype=obj %s | llvm-objdump -d - | FileCheck %s
+# Make sure relaxation doesn't hinder newvalue calculation
+
+#CHECK: r18 = add(r2, #-6)
+#CHECK-NEXT: immext(#0)
+#CHECK-NEXT: if (!cmp.gt(r18.new, #1)) jump:t
+{
+ r18 = add(r2, #-6)
+ if (!cmp.gt(r18.new, #1)) jump:t .unknown
+}
More information about the llvm-commits
mailing list