mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
Move insertps mask decoding to header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112896 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7e5c1a9790
commit
ed5c711a6e
@ -19,34 +19,6 @@
|
||||
#include "../X86ShuffleDecode.h"
|
||||
using namespace llvm;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Vector Mask Decoding for non-shuffles
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static void DecodeINSERTPSMask(unsigned Imm,
|
||||
SmallVectorImpl<unsigned> &ShuffleMask) {
|
||||
// Defaults the copying the dest value.
|
||||
ShuffleMask.push_back(0);
|
||||
ShuffleMask.push_back(1);
|
||||
ShuffleMask.push_back(2);
|
||||
ShuffleMask.push_back(3);
|
||||
|
||||
// Decode the immediate.
|
||||
unsigned ZMask = Imm & 15;
|
||||
unsigned CountD = (Imm >> 4) & 3;
|
||||
unsigned CountS = (Imm >> 6) & 3;
|
||||
|
||||
// CountS selects which input element to use.
|
||||
unsigned InVal = 4+CountS;
|
||||
// CountD specifies which element of destination to update.
|
||||
ShuffleMask[CountD] = InVal;
|
||||
// ZMask zaps values, potentially overriding the CountD elt.
|
||||
if (ZMask & 1) ShuffleMask[0] = SM_SentinelZero;
|
||||
if (ZMask & 2) ShuffleMask[1] = SM_SentinelZero;
|
||||
if (ZMask & 4) ShuffleMask[2] = SM_SentinelZero;
|
||||
if (ZMask & 8) ShuffleMask[3] = SM_SentinelZero;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Top Level Entrypoint
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -26,6 +26,30 @@ enum {
|
||||
SM_SentinelZero = ~0U
|
||||
};
|
||||
|
||||
static inline
|
||||
void DecodeINSERTPSMask(unsigned Imm, SmallVectorImpl<unsigned> &ShuffleMask) {
|
||||
// Defaults the copying the dest value.
|
||||
ShuffleMask.push_back(0);
|
||||
ShuffleMask.push_back(1);
|
||||
ShuffleMask.push_back(2);
|
||||
ShuffleMask.push_back(3);
|
||||
|
||||
// Decode the immediate.
|
||||
unsigned ZMask = Imm & 15;
|
||||
unsigned CountD = (Imm >> 4) & 3;
|
||||
unsigned CountS = (Imm >> 6) & 3;
|
||||
|
||||
// CountS selects which input element to use.
|
||||
unsigned InVal = 4+CountS;
|
||||
// CountD specifies which element of destination to update.
|
||||
ShuffleMask[CountD] = InVal;
|
||||
// ZMask zaps values, potentially overriding the CountD elt.
|
||||
if (ZMask & 1) ShuffleMask[0] = SM_SentinelZero;
|
||||
if (ZMask & 2) ShuffleMask[1] = SM_SentinelZero;
|
||||
if (ZMask & 4) ShuffleMask[2] = SM_SentinelZero;
|
||||
if (ZMask & 8) ShuffleMask[3] = SM_SentinelZero;
|
||||
}
|
||||
|
||||
// <3,1> or <6,7,2,3>
|
||||
static void DecodeMOVHLPSMask(unsigned NElts,
|
||||
SmallVectorImpl<unsigned> &ShuffleMask) {
|
||||
|
Loading…
Reference in New Issue
Block a user