The patch that was posted on the review board was along the lines of the solution suggested in my previous mail. Note that only splitting the ccFlags register is not the complete solution. We would still need to check that whether or not all the flags in a particular register are being completely written or not. Otherwise two 'add' instructions would still not get done in parallel.

But Gabe is not happy with the current state of the patch, so I dug in to the isa_parser and here is another proposal. In operands.isa, let's mark the ccFlagBits so that we can identify it in isa_parser. When build the operand map, we can now figure out that we have an operand that may be read conditionally (similar to how the PC is read and updated). In functions makeRead(), makeConstructor functions, if we encounter such an operand, we include a call to a check function which decides whether or not this operand will be read. The check function will need the ext (or the flag bits) to figure out if the operand needs to be read.

How does this sound?

--
Nilay


On Tue, 10 Apr 2012, Nilay Vaish wrote:

Gabe, Thanks for the explanation.

I think I have a solution for the problem that will work when all the flag bits will be written. I am assumping that the condition code register is identified as a source because it appears on the right hand side of the following code in src/arch/x86/isa/microops/regop.isa

   class FlagRegOp(RegOp):
       abstract = True
       flag_code = \
         "ccFlagBits = genFlags(ccFlagBits, ext, result, psrc1, op2);"

Suppose we want to remove the RAW dependence in case of 'add' microop. We can create a new microop with a different mnemonic. This new microop will be used in places where currently 'add' is in use with all the flags. This microop will not inherit from FlagRegOp class as 'add' does. It will inherit from a class that assumes a default value for ccFlagBits. We will also need to add a default value of 0 for ccFlagBits in the prototype of function genFlags().

But this will only help in case of addition and subtraction, as those are the only ones that write all the six flag bits. As Gabe pointed out, for any good solution to work, we would need to break up the flag bits.

--
Nilay

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to