This is an archive of the discontinued LLVM Phabricator instance.

AVX-512: Fixed COPY_TO_REGCLASS for mask registers
ClosedPublic

Authored by delena on Nov 19 2015, 2:06 AM.

Details

Summary

Copying one mask register to another under BW should be done with kmovq instruction, otherwise we can loose some bits.
Copying 8 bits under DQ may be done with kmovb.

Diff Detail

Repository
rL LLVM

Event Timeline

delena updated this revision to Diff 40616.Nov 19 2015, 2:06 AM
delena retitled this revision from to AVX-512: Fixed COPY_TO_REGCLASS for mask registers.
delena updated this object.
delena added a reviewer: igorb.
delena set the repository for this revision to rL LLVM.
delena added a subscriber: llvm-commits.
igorb added inline comments.Nov 19 2015, 2:55 AM
lib/Target/X86/X86InstrInfo.cpp
4298 ↗(On Diff #40616)

Does DestReg/SrcReg should be set to i32/i64 for kmovd/kmovg ?

4303 ↗(On Diff #40616)

I think X86::KMOVQrk and X86::KMOVQkr is invalid in 32bit mode and KMOVD should be used instead.

delena added inline comments.Nov 19 2015, 3:04 AM
lib/Target/X86/X86InstrInfo.cpp
4298 ↗(On Diff #40616)

Otherwise we can use KMOVW

4303 ↗(On Diff #40616)

We don't have GR64 in 32-bit mode.

igorb accepted this revision.Nov 19 2015, 3:50 AM
igorb edited edge metadata.

LGTM

This revision is now accepted and ready to land.Nov 19 2015, 3:50 AM
This revision was automatically updated to reflect the committed changes.