2018-04-08 20:30:30 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=i686-apple-darwin -mcpu=knl --show-mc-encoding -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK,X86
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl --show-mc-encoding -verify-machineinstrs | FileCheck %s --check-prefixes=CHECK,X64
|
|
|
|
|
2016-01-04 01:22:03 +08:00
|
|
|
declare i32 @llvm.x86.rdpkru()
|
|
|
|
declare void @llvm.x86.wrpkru(i32)
|
|
|
|
|
|
|
|
define void @test_x86_wrpkru(i32 %src) {
|
2018-04-08 20:30:30 +08:00
|
|
|
; X86-LABEL: test_x86_wrpkru:
|
|
|
|
; X86: ## %bb.0:
|
|
|
|
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
|
|
|
|
; X86-NEXT: xorl %edx, %edx ## encoding: [0x31,0xd2]
|
2019-04-04 08:28:49 +08:00
|
|
|
; X86-NEXT: xorl %ecx, %ecx ## encoding: [0x31,0xc9]
|
2018-04-08 20:30:30 +08:00
|
|
|
; X86-NEXT: wrpkru ## encoding: [0x0f,0x01,0xef]
|
|
|
|
; X86-NEXT: retl ## encoding: [0xc3]
|
|
|
|
;
|
|
|
|
; X64-LABEL: test_x86_wrpkru:
|
|
|
|
; X64: ## %bb.0:
|
2018-09-20 02:59:08 +08:00
|
|
|
; X64-NEXT: movl %edi, %eax ## encoding: [0x89,0xf8]
|
2018-04-08 20:30:30 +08:00
|
|
|
; X64-NEXT: xorl %edx, %edx ## encoding: [0x31,0xd2]
|
2019-04-04 08:28:49 +08:00
|
|
|
; X64-NEXT: xorl %ecx, %ecx ## encoding: [0x31,0xc9]
|
2018-04-08 20:30:30 +08:00
|
|
|
; X64-NEXT: wrpkru ## encoding: [0x0f,0x01,0xef]
|
|
|
|
; X64-NEXT: retq ## encoding: [0xc3]
|
|
|
|
call void @llvm.x86.wrpkru(i32 %src)
|
2016-01-04 01:22:03 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @test_x86_rdpkru() {
|
2018-07-31 00:15:18 +08:00
|
|
|
; CHECK-LABEL: test_x86_rdpkru:
|
|
|
|
; CHECK: ## %bb.0:
|
|
|
|
; CHECK-NEXT: xorl %ecx, %ecx ## encoding: [0x31,0xc9]
|
|
|
|
; CHECK-NEXT: rdpkru ## encoding: [0x0f,0x01,0xee]
|
|
|
|
; CHECK-NEXT: ret{{[l|q]}} ## encoding: [0xc3]
|
2018-04-08 20:30:30 +08:00
|
|
|
%res = call i32 @llvm.x86.rdpkru()
|
|
|
|
ret i32 %res
|
2016-01-04 01:22:03 +08:00
|
|
|
}
|