From 57e5a20592cac8cb3657c1772dce133f3202613b Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 2 Jun 2016 04:51:37 +0000 Subject: [PATCH] [AVX512] Add 512-bit load/stores to fast isel. llvm-svn: 271486 --- lib/Target/X86/X86FastISel.cpp | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index 4aa68295691..d06d7e22d49 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -435,6 +435,26 @@ bool X86FastISel::X86FastEmitLoad(EVT VT, X86AddressMode &AM, Opc = (Alignment >= 32) ? X86::VMOVDQAYrm : X86::VMOVDQUYrm; RC = &X86::VR256RegClass; break; + case MVT::v16f32: + assert(Subtarget->hasAVX512()); + Opc = (Alignment >= 64) ? X86::VMOVAPSZrm : X86::VMOVUPSZrm; + RC = &X86::VR512RegClass; + break; + case MVT::v8f64: + assert(Subtarget->hasAVX512()); + Opc = (Alignment >= 64) ? X86::VMOVAPDZrm : X86::VMOVUPDZrm; + RC = &X86::VR512RegClass; + break; + case MVT::v8i64: + case MVT::v16i32: + case MVT::v32i16: + case MVT::v64i8: + assert(Subtarget->hasAVX512()); + // Note: There are a lot more choices based on type with AVX-512, but + // there's really no advantage when the load isn't masked. + Opc = (Alignment >= 64) ? X86::VMOVDQA64Zmr : X86::VMOVDQU64Zmr; + RC = &X86::VR512RegClass; + break; } ResultReg = createResultReg(RC); @@ -553,6 +573,32 @@ bool X86FastISel::X86FastEmitStore(EVT VT, unsigned ValReg, bool ValIsKill, else Opc = X86::VMOVDQUYmr; break; + case MVT::v16f32: + assert(Subtarget->hasAVX512()); + if (Aligned) + Opc = IsNonTemporal ? X86::VMOVNTPSZmr : X86::VMOVAPSZmr; + else + Opc = X86::VMOVUPSZmr; + break; + case MVT::v8f64: + assert(Subtarget->hasAVX512()); + if (Aligned) { + Opc = IsNonTemporal ? X86::VMOVNTPDZmr : X86::VMOVAPDZmr; + } else + Opc = X86::VMOVUPDZmr; + break; + case MVT::v8i64: + case MVT::v16i32: + case MVT::v32i16: + case MVT::v64i8: + assert(Subtarget->hasAVX512()); + // Note: There are a lot more choices based on type with AVX-512, but + // there's really no advantage when the store isn't masked. + if (Aligned) + Opc = IsNonTemporal ? X86::VMOVNTDQZmr : X86::VMOVDQA64Zmr; + else + Opc = X86::VMOVDQU64Zmr; + break; } const MCInstrDesc &Desc = TII.get(Opc);