Index: tests_lit/assembler/arm32/cmp-vec.ll |
diff --git a/tests_lit/assembler/arm32/cmp-vec.ll b/tests_lit/assembler/arm32/cmp-vec.ll |
new file mode 100644 |
index 0000000000000000000000000000000000000000..58ad0858a62a88e6f56b6e8305b1ac34d8788a7d |
--- /dev/null |
+++ b/tests_lit/assembler/arm32/cmp-vec.ll |
@@ -0,0 +1,52 @@ |
+; Test that we handle icmp and fcmp on vectors |
Jim Stichnoth
2016/02/10 19:08:12
End sentence with period. :)
Eric Holk
2016/02/10 21:07:20
Done.
|
+ |
+; TODO(eholk): This test will need to be updated once comparison is no |
+; longer scalarized. |
+ |
+; REQUIRES: allow_dump |
+ |
+; Compile using standalone assembler. |
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --args -Om1 \ |
+; RUN: | FileCheck %s --check-prefix=ASM |
+ |
+; Show bytes in assembled standalone code. |
+; RUN: %p2i --filetype=asm -i %s --target=arm32 --assemble --disassemble \ |
+; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS |
+ |
+; Show bytes in assembled integrated code. |
+; RUN: %p2i --filetype=iasm -i %s --target=arm32 --assemble --disassemble \ |
+; RUN: --args -Om1 | FileCheck %s --check-prefix=DIS |
+ |
+define internal <4 x i32> @cmpEq4I32(<4 x i32> %a, <4 x i32> %b) { |
+; ASM-LABEL:cmpEq4I32: |
+; DIS-LABEL:00000000 <cmpEq4I32>: |
+ |
+entry: |
+ %cmp = icmp eq <4 x i32> %a, %b |
+ |
+; ASM: cmp r1, r2 |
+; ASM: cmp r1, r2 |
+; ASM: cmp r1, r2 |
+; ASM: cmp r1, r2 |
+; DIS: 40: e1510002 |
+ |
+ %cmp.ret_ext = zext <4 x i1> %cmp to <4 x i32> |
+ ret <4 x i32> %cmp.ret_ext |
+} |
+ |
+define internal <4 x i32> @cmpEq4f32(<4 x float> %a, <4 x float> %b) { |
+; ASM-LABEL:cmpEq4f32: |
+; DIS-LABEL:00000240 <cmpEq4f32>: |
+ |
+entry: |
+ %cmp = fcmp oeq <4 x float> %a, %b |
+ |
+; ASM: vcmp.f32 s0, s1 |
+; ASM: vcmp.f32 s0, s1 |
+; ASM: vcmp.f32 s0, s1 |
+; ASM: vcmp.f32 s0, s1 |
+; DIS: 27c: eeb40a60 |
+ |
+ %cmp.ret_ext = zext <4 x i1> %cmp to <4 x i32> |
+ ret <4 x i32> %cmp.ret_ext |
+} |