From 97768f775007bd7923ecca093add5b3c82da5a71 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 29 Oct 2017 02:18:41 +0000 Subject: [PATCH] [X86] Add AVX512 support to X86FastISel::X86MaterializeFP git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316853 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/X86FastISel.cpp | 8 ++++++-- test/CodeGen/X86/fast-isel-constpool.ll | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index 30cdb36ab8b..4c8decaf591 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -3712,7 +3712,9 @@ unsigned X86FastISel::X86MaterializeFP(const ConstantFP *CFP, MVT VT) { default: return 0; case MVT::f32: if (X86ScalarSSEf32) { - Opc = Subtarget->hasAVX() ? X86::VMOVSSrm : X86::MOVSSrm; + Opc = Subtarget->hasAVX512() + ? X86::VMOVSSZrm + : Subtarget->hasAVX() ? X86::VMOVSSrm : X86::MOVSSrm; RC = &X86::FR32RegClass; } else { Opc = X86::LD_Fp32m; @@ -3721,7 +3723,9 @@ unsigned X86FastISel::X86MaterializeFP(const ConstantFP *CFP, MVT VT) { break; case MVT::f64: if (X86ScalarSSEf64) { - Opc = Subtarget->hasAVX() ? X86::VMOVSDrm : X86::MOVSDrm; + Opc = Subtarget->hasAVX512() + ? X86::VMOVSDZrm + : Subtarget->hasAVX() ? X86::VMOVSDrm : X86::MOVSDrm; RC = &X86::FR64RegClass; } else { Opc = X86::LD_Fp64m; diff --git a/test/CodeGen/X86/fast-isel-constpool.ll b/test/CodeGen/X86/fast-isel-constpool.ll index dda7ce949cf..374a5e3907c 100644 --- a/test/CodeGen/X86/fast-isel-constpool.ll +++ b/test/CodeGen/X86/fast-isel-constpool.ll @@ -3,6 +3,8 @@ ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large < %s | FileCheck %s --check-prefix=LARGE ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small -mattr=avx < %s | FileCheck %s --check-prefix=AVX ; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large -mattr=avx < %s | FileCheck %s --check-prefix=LARGE_AVX +; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=small -mattr=avx512f < %s | FileCheck %s --check-prefix=AVX +; RUN: llc -mtriple=x86_64-apple-darwin -fast-isel -code-model=large -mattr=avx512f < %s | FileCheck %s --check-prefix=LARGE_AVX ; Make sure fast isel uses rip-relative addressing for the small code model. define float @constpool_float(float %x) { -- 2.40.0