From 8b577a139ad4a8cd78a72f9097e62b7f92661f4d Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 18 Aug 2017 15:08:30 +0000 Subject: [PATCH] [X86][PCLMUL] Add scheduling latency/throughput test for PCLMULQDQ instruction Added it to the SSE42 tests as targets seem to always have both git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311166 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/sse42-schedule.ll | 45 +++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/test/CodeGen/X86/sse42-schedule.ll b/test/CodeGen/X86/sse42-schedule.ll index 9bf89a9a69e..d174ac3e534 100644 --- a/test/CodeGen/X86/sse42-schedule.ll +++ b/test/CodeGen/X86/sse42-schedule.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=x86-64 -mattr=+sse4.2 | FileCheck %s --check-prefix=CHECK --check-prefix=GENERIC +; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=x86-64 -mattr=+sse4.2,+pclmul | FileCheck %s --check-prefix=CHECK --check-prefix=GENERIC ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=slm | FileCheck %s --check-prefix=CHECK --check-prefix=SLM ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=sandybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=ivybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY @@ -554,3 +554,46 @@ define <2 x i64> @test_pcmpgtq(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> *%a2) { %5 = sext <2 x i1> %4 to <2 x i64> ret <2 x i64> %5 } + +define <2 x i64> @test_pclmulqdq(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> *%a2) { +; GENERIC-LABEL: test_pclmulqdq: +; GENERIC: # BB#0: +; GENERIC-NEXT: pclmulqdq $0, %xmm1, %xmm0 # sched: [14:6.00] +; GENERIC-NEXT: pclmulqdq $0, (%rdi), %xmm0 # sched: [14:5.67] +; GENERIC-NEXT: retq # sched: [1:1.00] +; +; SLM-LABEL: test_pclmulqdq: +; SLM: # BB#0: +; SLM-NEXT: pclmulqdq $0, %xmm1, %xmm0 # sched: [10:10.00] +; SLM-NEXT: pclmulqdq $0, (%rdi), %xmm0 # sched: [10:10.00] +; SLM-NEXT: retq # sched: [4:1.00] +; +; SANDY-LABEL: test_pclmulqdq: +; SANDY: # BB#0: +; SANDY-NEXT: vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [14:6.00] +; SANDY-NEXT: vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [14:5.67] +; SANDY-NEXT: retq # sched: [1:1.00] +; +; HASWELL-LABEL: test_pclmulqdq: +; HASWELL: # BB#0: +; HASWELL-NEXT: vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [7:2.00] +; HASWELL-NEXT: vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [7:2.00] +; HASWELL-NEXT: retq # sched: [1:1.00] +; +; BTVER2-LABEL: test_pclmulqdq: +; BTVER2: # BB#0: +; BTVER2-NEXT: vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [2:1.00] +; BTVER2-NEXT: vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [7:1.00] +; BTVER2-NEXT: retq # sched: [4:1.00] +; +; ZNVER1-LABEL: test_pclmulqdq: +; ZNVER1: # BB#0: +; ZNVER1-NEXT: vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [100:?] +; ZNVER1-NEXT: vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [100:?] +; ZNVER1-NEXT: retq # sched: [5:0.50] + %1 = load <2 x i64>, <2 x i64> *%a2, align 16 + %2 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> %a0, <2 x i64> %a1, i8 0) + %3 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> %1, <2 x i64> %2, i8 0) + ret <2 x i64> %3 +} +declare <2 x i64> @llvm.x86.pclmulqdq(<2 x i64>, <2 x i64>, i8) -- 2.50.1