1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-- -mattr=+rdpru | FileCheck %s --check-prefix=X86
3 ; RUN: llc < %s -mtriple=i686-- -mattr=+rdpru -fast-isel | FileCheck %s --check-prefix=X86
4 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+rdpru | FileCheck %s --check-prefix=X64
5 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+rdpru -fast-isel | FileCheck %s --check-prefix=X64
6 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver2 | FileCheck %s --check-prefix=X64
7 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver3 -fast-isel | FileCheck %s --check-prefix=X64
8 ; RUN: llc < %s -mtriple=x86_64-- -mcpu=znver4 -fast-isel | FileCheck %s --check-prefix=X64
10 define void @rdpru_asm() {
11 ; X86-LABEL: rdpru_asm:
12 ; X86: # %bb.0: # %entry
18 ; X64-LABEL: rdpru_asm:
19 ; X64: # %bb.0: # %entry
25 call void asm sideeffect "rdpru", "~{dirflag},~{fpsr},~{flags}"()
29 define i64 @rdpru_param(i32 %regid) local_unnamed_addr {
30 ; X86-LABEL: rdpru_param:
31 ; X86: # %bb.0: # %entry
32 ; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
36 ; X64-LABEL: rdpru_param:
37 ; X64: # %bb.0: # %entry
38 ; X64-NEXT: movl %edi, %ecx
40 ; X64-NEXT: shlq $32, %rdx
41 ; X64-NEXT: orq %rdx, %rax
44 %0 = tail call i64 @llvm.x86.rdpru(i32 %regid)
48 define i64 @rdpru_mperf() local_unnamed_addr {
49 ; X86-LABEL: rdpru_mperf:
50 ; X86: # %bb.0: # %entry
51 ; X86-NEXT: xorl %ecx, %ecx
55 ; X64-LABEL: rdpru_mperf:
56 ; X64: # %bb.0: # %entry
57 ; X64-NEXT: xorl %ecx, %ecx
59 ; X64-NEXT: shlq $32, %rdx
60 ; X64-NEXT: orq %rdx, %rax
63 %0 = tail call i64 @llvm.x86.rdpru(i32 0)
67 define i64 @rdpru_aperf() local_unnamed_addr {
68 ; X86-LABEL: rdpru_aperf:
69 ; X86: # %bb.0: # %entry
70 ; X86-NEXT: movl $1, %ecx
74 ; X64-LABEL: rdpru_aperf:
75 ; X64: # %bb.0: # %entry
76 ; X64-NEXT: movl $1, %ecx
78 ; X64-NEXT: shlq $32, %rdx
79 ; X64-NEXT: orq %rdx, %rax
82 %0 = tail call i64 @llvm.x86.rdpru(i32 1)
86 declare i64 @llvm.x86.rdpru(i32)