From: Gabe Black Date: Tue, 18 Aug 2009 03:22:56 +0000 (-0700) Subject: X86: Implement a mask move microop. X-Git-Tag: Calvin_Submission~59 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=75528a497c1980a55256e068473da8e0d684c8ab;p=gem5.git X86: Implement a mask move microop. --- 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);