Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 97768f7

Browse files
committed
[X86] Add AVX512 support to X86FastISel::X86MaterializeFP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316853 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent bc1d6a2 commit 97768f7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/Target/X86/X86FastISel.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3712,7 +3712,9 @@ unsigned X86FastISel::X86MaterializeFP(const ConstantFP *CFP, MVT VT) {
37123712
default: return 0;
37133713
case MVT::f32:
37143714
if (X86ScalarSSEf32) {
3715-
Opc = Subtarget->hasAVX() ? X86::VMOVSSrm : X86::MOVSSrm;
3715+
Opc = Subtarget->hasAVX512()
3716+
? X86::VMOVSSZrm
3717+
: Subtarget->hasAVX() ? X86::VMOVSSrm : X86::MOVSSrm;
37163718
RC = &X86::FR32RegClass;
37173719
} else {
37183720
Opc = X86::LD_Fp32m;
@@ -3721,7 +3723,9 @@ unsigned X86FastISel::X86MaterializeFP(const ConstantFP *CFP, MVT VT) {
37213723
break;
37223724
case MVT::f64:
37233725
if (X86ScalarSSEf64) {
3724-
Opc = Subtarget->hasAVX() ? X86::VMOVSDrm : X86::MOVSDrm;
3726+
Opc = Subtarget->hasAVX512()
3727+
? X86::VMOVSDZrm
3728+
: Subtarget->hasAVX() ? X86::VMOVSDrm : X86::MOVSDrm;
37253729
RC = &X86::FR64RegClass;
37263730
} else {
37273731
Opc = X86::LD_Fp64m;

test/CodeGen/X86/fast-isel-constpool.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large < %s | FileCheck %s --check-prefix=LARGE
44
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small -mattr=avx < %s | FileCheck %s --check-prefix=AVX
55
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large -mattr=avx < %s | FileCheck %s --check-prefix=LARGE_AVX
6+
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small -mattr=avx512f < %s | FileCheck %s --check-prefix=AVX
7+
; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large -mattr=avx512f < %s | FileCheck %s --check-prefix=LARGE_AVX
68

79
; Make sure fast isel uses rip-relative addressing for the small code model.
810
define float @constpool_float(float %x) {

0 commit comments

Comments
 (0)