[PTLsim-devel] SSE cvtps2pd: appears to be a wrong dependency

Adnan Khaleel adnan at khaleel.us
Fri Oct 30 12:20:47 PDT 2009


Hi Stephan,

Here is my patch for this with diff -u :)

*akhaleel at car10 bochs-2.4.1 $ diff -u ../../Ptlsim/ptlsim/decode-sse.cpp corepipe/decode-sse.cpp
--- ptlsim-stable.git/decode-sse.cpp  2007-12-29 23:51:13.000000000 -0600
+++ ptlsim/decode-sse.cpp              2009-10-20 14:30:45.000000000 -0500
@@ -793,10 +793,14 @@
       operand_load(REG_temp1, ra, OP_ld, DATATYPE_FLOAT);
     } else {
       rareg = arch_pseudo_reg_to_arch_reg[ra.reg.reg];
+      if (unlikely (rareg == rdreg)) {
+         this << TransOp(OP_mov, REG_temp0, REG_zero, rareg, REG_zero, 3);
+         rareg = REG_temp0;
+      }
     }
-
+

Adnan

PS: Btw, is there a way I can do a diff with the git repository directly from the command line?

  _____  

From: Stephan Diestelhorst [mailto:stephan.diestelhorst at amd.com]
To: ptlsim-devel at ptlsim.org
Cc: Adnan Khaleel [mailto:adnan at khaleel.us], Matt T. Yourst [mailto:yourst at strandera.com]
Sent: Fri, 30 Oct 2009 12:12:50 -0500
Subject: Re: [PTLsim-devel] SSE cvtps2pd: appears to be a wrong dependency

Hi Adnan,
  
  Adnan Khaleel wrote:
  > I can see where you do the move into the temp register and that makes
  > perfect sense. However, shouldn't the uop be transferred to "this". I mean,
  > shouldn't that line read
  > this << TransOp(OP_mov, REG_temp0, REG_zero, rareg, REG_zero, 3);
  > 
  > I tested both versions and the latter one passed the tests.
  
  I have only very limited understanding of SSE, but your approach looks
  sane. Could you please provide a patch to the most recent version in
  the repository? That way I can apply your change more easily.
  
  > One more question, when do you use DECODE(gform, rd, x_mode), DECODE(eform,
  > ra, x_mode) and so on. I plan on adding more uops to Ptlsim, like SSE4/5 and
  > the AVX instructions as well and I need to better understand how the decode
  > works.
  
  X86 decoding is a beast. ;-) I have found these to be similar to the
  ones in AMD's APM vol. 3: General-Purpose and System Instructions in
  section A.1 (and the rest of the document).
  
  If you can verify my finding, we should perhaps add a comment into the
  source to document this.
  
  Hope that helps!
  
  Cheers,
    Stephan
  
  PS: Find a copy of the APM vol. 3 at
  http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24594.pdf
  -- 
  Stephan Diestelhorst, AMD Operating System Research Center
  stephan.diestelhorst at amd.com, Tel. +49 (0)351 448 356 719
  
  Advanced Micro Devices GmbH
  Karl-Hammerschmidt-Str. 34
  85609 Dornach b. München
   
  Geschäftsführer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
  Sitz: Dornach, Gemeinde Aschheim, Landkreis München
  Registergericht München, HRB Nr. 43632
  
    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ptlsim.org/pipermail/ptlsim-devel/attachments/20091030/52f875b2/attachment.htm 


More information about the ptlsim-devel mailing list