(negdi2): Use TARGET_LITTLE_ENDIAN.
authorRichard Kenner <kenner@gcc.gnu.org>
Thu, 26 Oct 1995 21:52:23 +0000 (17:52 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Thu, 26 Oct 1995 21:52:23 +0000 (17:52 -0400)
From-SVN: r10514

gcc/config/sh/sh.md

index 73fc26ebede4e9f10c04097e706b2bbc476941f9..36ec02e02ce74c21444353c00072003dc3170704 100644 (file)
   ""
   "
 {
-  rtx low_src = operand_subword (operands[1], 1, 0, DImode);
-  rtx high_src = operand_subword (operands[1], 0, 0, DImode);
+  int low_word = (TARGET_LITTLE_ENDIAN ? 0 : 1);
+  int high_word = (TARGET_LITTLE_ENDIAN ? 1 : 0);
 
-  rtx low_dst = operand_subword (operands[0], 1, 1, DImode);
-  rtx high_dst = operand_subword (operands[0], 0, 1, DImode);
+  rtx low_src = operand_subword (operands[1], low_word, 0, DImode);
+  rtx high_src = operand_subword (operands[1], high_word, 0, DImode);
+
+  rtx low_dst = operand_subword (operands[0], low_word, 1, DImode);
+  rtx high_dst = operand_subword (operands[0], high_word, 1, DImode);
 
   emit_insn (gen_clrt ());
   emit_insn (gen_negc (low_dst, low_src));