mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
[X86] Add AVX512 support to X86FastISel::X86SelectFPExt and X86FastISel::X86SelectFPTrunc.
llvm-svn: 316856
This commit is contained in:
parent
623fbac7c6
commit
b7aca7ce59
@ -2473,9 +2473,13 @@ bool X86FastISel::X86SelectFPExtOrFPTrunc(const Instruction *I,
|
||||
bool X86FastISel::X86SelectFPExt(const Instruction *I) {
|
||||
if (X86ScalarSSEf64 && I->getType()->isDoubleTy() &&
|
||||
I->getOperand(0)->getType()->isFloatTy()) {
|
||||
bool HasAVX512 = Subtarget->hasAVX512();
|
||||
// fpext from float to double.
|
||||
unsigned Opc = Subtarget->hasAVX() ? X86::VCVTSS2SDrr : X86::CVTSS2SDrr;
|
||||
return X86SelectFPExtOrFPTrunc(I, Opc, &X86::FR64RegClass);
|
||||
unsigned Opc =
|
||||
HasAVX512 ? X86::VCVTSS2SDZrr
|
||||
: Subtarget->hasAVX() ? X86::VCVTSS2SDrr : X86::CVTSS2SDrr;
|
||||
return X86SelectFPExtOrFPTrunc(
|
||||
I, Opc, HasAVX512 ? &X86::FR64XRegClass : &X86::FR64RegClass);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -2484,9 +2488,13 @@ bool X86FastISel::X86SelectFPExt(const Instruction *I) {
|
||||
bool X86FastISel::X86SelectFPTrunc(const Instruction *I) {
|
||||
if (X86ScalarSSEf64 && I->getType()->isFloatTy() &&
|
||||
I->getOperand(0)->getType()->isDoubleTy()) {
|
||||
bool HasAVX512 = Subtarget->hasAVX512();
|
||||
// fptrunc from double to float.
|
||||
unsigned Opc = Subtarget->hasAVX() ? X86::VCVTSD2SSrr : X86::CVTSD2SSrr;
|
||||
return X86SelectFPExtOrFPTrunc(I, Opc, &X86::FR32RegClass);
|
||||
unsigned Opc =
|
||||
HasAVX512 ? X86::VCVTSD2SSZrr
|
||||
: Subtarget->hasAVX() ? X86::VCVTSD2SSrr : X86::CVTSD2SSrr;
|
||||
return X86SelectFPExtOrFPTrunc(
|
||||
I, Opc, HasAVX512 ? &X86::FR32XRegClass : &X86::FR32RegClass);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -1,6 +1,7 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=ALL --check-prefix=SSE
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=ALL --check-prefix=AVX
|
||||
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=ALL --check-prefix=AVX
|
||||
;
|
||||
; Verify that fast-isel doesn't select legacy SSE instructions on targets that
|
||||
; feature AVX.
|
||||
|
Loading…
x
Reference in New Issue
Block a user