mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-08 13:00:43 +00:00
89493fda7e
The original implementation attempted to zero registers using XOR %foo, %foo. This is problematic because it constitutes a read-modify-write of a register which might not be defined. Instead, use MOV32r0 to avoid these problems; expandPostRAPseudo does the right thing here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274024 91177308-0d34-0410-b5e6-96231b3b80d8
26 lines
699 B
LLVM
26 lines
699 B
LLVM
; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl --show-mc-encoding -verify-machineinstrs | 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
|
|
}
|