From 75528a497c1980a55256e068473da8e0d684c8ab Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 17 Aug 2009 20:22:56 -0700 Subject: X86: Implement a mask move microop. --- src/arch/x86/isa/microops/mediaop.isa | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/arch/x86/isa') diff --git a/src/arch/x86/isa/microops/mediaop.isa b/src/arch/x86/isa/microops/mediaop.isa index bef661848..83962b0f2 100644 --- a/src/arch/x86/isa/microops/mediaop.isa +++ b/src/arch/x86/isa/microops/mediaop.isa @@ -347,6 +347,24 @@ let {{ DestReg = DestReg | result; ''' + class Maskmov(MediaOp): + code = ''' + assert(srcSize == destSize); + int size = srcSize; + int sizeBits = size * 8; + int items = (ext & 0x1) ? 1: (sizeof(FloatRegBits) / size); + uint64_t result = FpDestReg.uqw; + + for (int i = 0; i < items; i++) { + int hiIndex = (i + 1) * sizeBits - 1; + int loIndex = (i + 0) * sizeBits; + uint64_t arg1Bits = bits(FpSrcReg1.uqw, hiIndex, loIndex); + if (bits(FpSrcReg2.uqw, hiIndex)) + result = insertBits(result, hiIndex, loIndex, arg1Bits); + } + FpDestReg.uqw = result; + ''' + class Unpack(MediaOp): code = ''' assert(srcSize == destSize); -- cgit v1.2.3