public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: hjl@lucon.org (H.J. Lu)
To: egcs@cygnus.com
Subject: An x86 patch for egcs
Date: Thu, 12 Mar 1998 17:24:00 -0000	[thread overview]
Message-ID: <m0yDILN-00058JC@ocean.lucon.org> (raw)

Hi,

This is a partial patch for the PPro bug I reported. It fixed
loading standard x87 constants in conditional move. But it still
leaves an undefined label in one of my test cases. My other test
case still doesn't compile.

Thanks.


-- 
H.J. Lu (hjl@gnu.org)
--
Thu Mar 12 08:25:19 1998  H.J. Lu  (hjl@gnu.org)

	* config/i386/i386.md (movsfcc_1, movdfcc_1, movxfcc_1): Handle
	loading standard x87 constants.

Index: config/i386/i386.md
===================================================================
RCS file: /home/work/cvs/gnu/egcs/gcc/config/i386/i386.md,v
retrieving revision 1.1.1.8
diff -u -r1.1.1.8 i386.md
--- i386.md	1998/03/12 17:19:11	1.1.1.8
+++ i386.md	1998/03/13 00:12:40
@@ -7528,8 +7529,21 @@
 	output_asm_insn (AS1 (fld%z2,%y2), operands);
       else
         {
-	  operands[2] = XEXP (operands[2], 0);
-	  output_asm_insn (AS1 (fld%z2,%y2), operands);
+	  int conval = standard_80387_constant_p (operands[2]);
+
+	  switch (conval)
+	    {
+	    case 1:
+	      fprintf (asm_out_file, \"\\tfldz\\n\");
+	      break;
+	    case 2:
+	      fprintf (asm_out_file, \"\\tfld1\\n\");
+	      break;
+	    default:
+	      operands[2] = XEXP (operands[2], 0);
+	      output_asm_insn (AS1 (fld%z2,%y2), operands);
+	      break;
+	    }
         }
       output_asm_insn (\"jmp %l1\", xops);
       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
@@ -7537,8 +7551,21 @@
 	  output_asm_insn (AS1 (fld%z3,%y3), operands);
       else
 	{
-	  operands[3] = XEXP (operands[3], 0);
-	  output_asm_insn (AS1 (fld%z3,%y3), operands);
+	  int conval = standard_80387_constant_p (operands[3]);
+
+	  switch (conval)
+	    {
+	    case 1:
+	      fprintf (asm_out_file, \"\\tfldz\\n\");
+	      break;
+	    case 2:
+	      fprintf (asm_out_file, \"\\tfld1\\n\");
+	      break;
+	    default:
+	      operands[3] = XEXP (operands[3], 0);
+	      output_asm_insn (AS1 (fld%z3,%y3), operands);
+	      break;
+	   }
 	}
       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
 }
@@ -7584,8 +7611,21 @@
 	output_asm_insn (AS1 (fld%z2,%y2), operands);
       else
         {
-	  operands[2] = XEXP (operands[2], 0);
-	  output_asm_insn (AS1 (fld%z2,%y2), operands);
+	  int conval = standard_80387_constant_p (operands[2]);
+
+	  switch (conval)
+	    {
+	    case 1:
+	      fprintf (asm_out_file, \"\\tfldz\\n\");
+	      break;
+	    case 2:
+	      fprintf (asm_out_file, \"\\tfld1\\n\");
+	      break;
+	    default:
+	      operands[2] = XEXP (operands[2], 0);
+	      output_asm_insn (AS1 (fld%z2,%y2), operands);
+	      break;
+	    }
         }
       output_asm_insn (\"jmp %l1\", xops);
       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
@@ -7593,8 +7633,21 @@
 	  output_asm_insn (AS1 (fld%z3,%y3), operands);
       else
 	{
-	  operands[3] = XEXP (operands[3], 0);
-	  output_asm_insn (AS1 (fld%z3,%y3), operands);
+	  int conval = standard_80387_constant_p (operands[3]);
+
+	  switch (conval)
+	    {
+	    case 1:
+	      fprintf (asm_out_file, \"\\tfldz\\n\");
+	      break;
+	    case 2:
+	      fprintf (asm_out_file, \"\\tfld1\\n\");
+	      break;
+	    default:
+	      operands[3] = XEXP (operands[3], 0);
+	      output_asm_insn (AS1 (fld%z3,%y3), operands);
+	      break;
+	   }
 	}
       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
 }
@@ -7640,8 +7693,21 @@
 	output_asm_insn (AS1 (fld%z2,%y2), operands);
       else
         {
-	  operands[2] = XEXP (operands[2], 0);
-	  output_asm_insn (AS1 (fld%z2,%y2), operands);
+	  int conval = standard_80387_constant_p (operands[2]);
+
+	  switch (conval)
+	    {
+	    case 1:
+	      fprintf (asm_out_file, \"\\tfldz\\n\");
+	      break;
+	    case 2:
+	      fprintf (asm_out_file, \"\\tfld1\\n\");
+	      break;
+	    default:
+	      operands[2] = XEXP (operands[2], 0);
+	      output_asm_insn (AS1 (fld%z2,%y2), operands);
+	      break;
+	    }
         }
       output_asm_insn (\"jmp %l1\", xops);
       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
@@ -7649,8 +7715,21 @@
 	  output_asm_insn (AS1 (fld%z3,%y3), operands);
       else
 	{
-	  operands[3] = XEXP (operands[3], 0);
-	  output_asm_insn (AS1 (fld%z3,%y3), operands);
+	  int conval = standard_80387_constant_p (operands[3]);
+
+	  switch (conval)
+	    {
+	    case 1:
+	      fprintf (asm_out_file, \"\\tfldz\\n\");
+	      break;
+	    case 2:
+	      fprintf (asm_out_file, \"\\tfld1\\n\");
+	      break;
+	    default:
+	      operands[3] = XEXP (operands[3], 0);
+	      output_asm_insn (AS1 (fld%z3,%y3), operands);
+	      break;
+	   }
 	}
       ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
 }

             reply	other threads:[~1998-03-12 17:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-12 17:24 H.J. Lu [this message]
1998-03-16 19:46 ` Jim Wilson
1998-03-13 18:47 Mark Mitchell
     [not found] ` <smtp.earthlink.net>
1998-03-13 18:29   ` H.J. Lu
1998-03-18 16:14   ` PATCH: add semantics.c Mark Mitchell
1998-03-19 21:47   ` PATCH for Re: cp/semantics.c is broken Mark Mitchell
1998-03-23 15:35   ` PATCH for Re: egcs-1.0.2, egcs-980315 and templates Andrew Pollard
1998-03-23 19:24   ` Mark Mitchell
1998-03-19 12:55 Andrew Pollard
1998-03-19 12:55 cp/semantics.c is broken H.J. Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0yDILN-00058JC@ocean.lucon.org \
    --to=hjl@lucon.org \
    --cc=egcs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).