aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@cygnus.com>2000-10-25 17:26:27 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2000-10-25 13:26:27 -0400
commitfb204271dd889c63b0427b4ab48dd04b3ded329c (patch)
treebe54342dbc07c7ca495b35e15a42957e3c90a633 /gcc
parent138e79e7854509c60fd9ff9e9274b36ad6873ab8 (diff)
downloadgcc-fb204271dd889c63b0427b4ab48dd04b3ded329c.zip
gcc-fb204271dd889c63b0427b4ab48dd04b3ded329c.tar.gz
gcc-fb204271dd889c63b0427b4ab48dd04b3ded329c.tar.bz2
i386.c (print_operand): Handle new 'A' formatting code.
2000-10-23 Diego Novillo <dnovillo@cygnus.com> * i386.c (print_operand): Handle new 'A' formatting code. 387 opcodes need suffixes even with -mintel-syntax. Check for explicit size override (codes 'b', 'w' and 'k'). (print_operand_address): Check if register prefix is needed when emitting `ds' segment override. * i386.h: Add comment about new 'A' formatting code. * i386.md (jump and call patterns): Emit absolute references using %A. From-SVN: r37055
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/i386/i386.c40
-rw-r--r--gcc/config/i386/i386.h1
-rw-r--r--gcc/config/i386/i386.md24
4 files changed, 58 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f40ab8e..c605f67 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -67,6 +67,16 @@ Wed Oct 25 01:02:44 EDT 2000 John Wehle (john@feith.com)
otherwise leave empty.
* configure: Regenerate.
+2000-10-23 Diego Novillo <dnovillo@cygnus.com>
+
+ * i386.c (print_operand): Handle new 'A' formatting code.
+ 387 opcodes need suffixes even with -mintel-syntax.
+ Check for explicit size override (codes 'b', 'w' and 'k').
+ (print_operand_address): Check if register prefix is needed when
+ emitting `ds' segment override.
+ * i386.h: Add comment about new 'A' formatting code.
+ * i386.md (jump and call patterns): Emit absolute references using %A.
+
2000-10-23 Richard Henderson <rth@cygnus.com>
* config/ia64/ia64.c (ia64_expand_prologue): Mark extra
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index b9bd81c..fa5d758 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3250,6 +3250,7 @@ print_reg (x, code, file)
R -- print the prefix for register names.
z -- print the opcode suffix for the size of the current operand.
* -- print a star (in certain assembler syntax)
+ A -- print an absolute memory reference.
w -- print the operand as if it's a "word" (HImode) even if it isn't.
s -- print a shift double count, followed by the assemblers argument
delimiter.
@@ -3276,6 +3277,26 @@ print_operand (file, x, code)
putc ('*', file);
return;
+ case 'A':
+ if (ASSEMBLER_DIALECT == 0)
+ putc ('*', file);
+ else if (ASSEMBLER_DIALECT == 1)
+ {
+ /* Intel syntax. For absolute addresses, registers should not
+ be surrounded by braces. */
+ if (GET_CODE (x) != REG)
+ {
+ putc ('[', file);
+ PRINT_OPERAND (file, x, 0);
+ putc (']', file);
+ return;
+ }
+ }
+
+ PRINT_OPERAND (file, x, 0);
+ return;
+
+
case 'L':
if (ASSEMBLER_DIALECT == 0)
putc ('l', file);
@@ -3313,10 +3334,6 @@ print_operand (file, x, code)
if (STACK_REG_P (x))
return;
- /* Intel syntax has no truck with instruction suffixes. */
- if (ASSEMBLER_DIALECT != 0)
- return;
-
/* this is the size of op from size of operand */
switch (GET_MODE_SIZE (GET_MODE (x)))
{
@@ -3422,6 +3439,15 @@ print_operand (file, x, code)
default:
abort ();
}
+
+ /* Check for explicit size override (codes 'b', 'w' and 'k') */
+ if (code == 'b')
+ size = "BYTE";
+ else if (code == 'w')
+ size = "WORD";
+ else if (code == 'k')
+ size = "DWORD";
+
fputs (size, file);
fputs (" PTR ", file);
}
@@ -3519,7 +3545,11 @@ print_operand_address (file, addr)
if (GET_CODE (disp) == CONST_INT)
{
if (ASSEMBLER_DIALECT != 0)
- fputs ("ds:", file);
+ {
+ if (USER_LABEL_PREFIX[0] == 0)
+ putc ('%', file);
+ fputs ("ds:", file);
+ }
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (addr));
}
else if (flag_pic)
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 10ef1e1..f0223bc 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -2723,6 +2723,7 @@ do { long l; \
R -- print the prefix for register names.
z -- print the opcode suffix for the size of the current operand.
* -- print a star (in certain assembler syntax)
+ A -- print an absolute memory reference.
P -- if PIC, print an @PLT suffix.
X -- don't print any sort of PIC '@' suffix for a symbol.
s -- ??? something to do with double shifts. not actually used, afaik.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 3d908ea..90b1482 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -8662,7 +8662,7 @@
(define_insn "indirect_jump"
[(set (pc) (match_operand:SI 0 "nonimmediate_operand" "rm"))]
""
- "jmp\\t%*%0"
+ "jmp\\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
@@ -8670,7 +8670,7 @@
[(set (pc) (match_operand:SI 0 "nonimmediate_operand" "rm"))
(use (label_ref (match_operand 1 "" "")))]
"! flag_pic"
- "jmp\\t%*%0"
+ "jmp\\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
@@ -8744,7 +8744,7 @@
[(set (pc) (match_operand:SI 0 "nonimmediate_operand" "rm"))
(use (label_ref (match_operand 1 "" "")))]
""
- "jmp\\t%*%0"
+ "jmp\\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
@@ -8915,9 +8915,9 @@
return \"call\\t%P0\";
}
if (SIBLING_CALL_P (insn))
- return \"jmp\\t%*%0\";
+ return \"jmp\\t%A0\";
else
- return \"call\\t%*%0\";
+ return \"call\\t%A0\";
}"
[(set_attr "type" "call")])
@@ -8965,9 +8965,9 @@
return \"call\\t%P0\";
}
if (SIBLING_CALL_P (insn))
- return \"jmp\\t%*%0\";
+ return \"jmp\\t%A0\";
else
- return \"call\\t%*%0\";
+ return \"call\\t%A0\";
}"
[(set_attr "type" "call")])
@@ -9103,7 +9103,7 @@
[(return)
(use (match_operand:SI 0 "register_operand" "r"))]
"reload_completed"
- "jmp\\t%*%0"
+ "jmp\\t%A0"
[(set_attr "type" "ibr")
(set_attr "length_immediate" "0")])
@@ -11546,9 +11546,9 @@
return \"call\\t%P1\";
}
if (SIBLING_CALL_P (insn))
- return \"jmp\\t%*%1\";
+ return \"jmp\\t%A1\";
else
- return \"call\\t%*%1\";
+ return \"call\\t%A1\";
}"
[(set_attr "type" "callv")])
@@ -11581,9 +11581,9 @@
return \"call\\t%P1\";
}
if (SIBLING_CALL_P (insn))
- return \"jmp\\t%*%1\";
+ return \"jmp\\t%A1\";
else
- return \"call\\t%*%1\";
+ return \"call\\t%A1\";
}"
[(set_attr "type" "callv")])