Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86][PKU] Add {RD,WR}PKRU intrinsics
Differential Revision: http://reviews.llvm.org/D15808 llvm-svn: 256670
- Loading branch information
Asaf Badouh
committed
Dec 31, 2015
1 parent
fd2c6a3
commit af6569a
Showing
4 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl --show-mc-encoding| FileCheck %s | ||
declare i32 @llvm.x86.rdpkru() | ||
declare void @llvm.x86.wrpkru(i32) | ||
|
||
define void @test_x86_wrpkru(i32 %src) { | ||
; CHECK-LABEL: test_x86_wrpkru: | ||
; CHECK: ## BB#0: | ||
; CHECK-NEXT: xorl %ecx, %ecx | ||
; CHECK-NEXT: xorl %edx, %edx | ||
; CHECK-NEXT: movl %edi, %eax | ||
; CHECK-NEXT: wrpkru | ||
; CHECK-NEXT: retq | ||
call void @llvm.x86.wrpkru(i32 %src) | ||
ret void | ||
} | ||
|
||
define i32 @test_x86_rdpkru() { | ||
; CHECK-LABEL: test_x86_rdpkru: | ||
; CHECK: ## BB#0: | ||
; CHECK-NEXT: xorl %ecx, %ecx | ||
; CHECK-NEXT: rdpkru | ||
; CHECK-NEXT: retq | ||
%res = call i32 @llvm.x86.rdpkru() | ||
ret i32 %res | ||
} |