From 57124607025c070b91ed52f456a5c21eb54358ea Mon Sep 17 00:00:00 2001 From: rth Date: Sat, 4 Apr 1998 20:25:44 +0000 Subject: [PATCH] * i386.c (asm_output_function_prefix, load_pic_register): Use ASM_GENERATE_INTERNAL_LABEL properly. (output_pic_addr_const): Recognize %X to supress any PIC sym suffix. (print_operand): Ignore it. (load_pic_register): Use it for the got load call. * i386.md (prologue_set_got, prologue_get_pc): Likewise. (prologue_get_pc_and_set_got): Likewise. * i386.h: Update print_operand docs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19000 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 11 +++++++++++ gcc/config/i386/i386.c | 13 ++++++++----- gcc/config/i386/i386.h | 10 +++++++--- gcc/config/i386/i386.md | 8 ++++---- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f7bb7c1ce44..e1798acf74d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +Sat Apr 4 20:16:46 1998 Richard Henderson + + * i386.c (asm_output_function_prefix, load_pic_register): + Use ASM_GENERATE_INTERNAL_LABEL properly. + (output_pic_addr_const): Recognize %X to supress any PIC sym suffix. + (print_operand): Ignore it. + (load_pic_register): Use it for the got load call. + * i386.md (prologue_set_got, prologue_get_pc): Likewise. + (prologue_get_pc_and_set_got): Likewise. + * i386.h: Update print_operand docs. + Sat Apr 4 19:08:37 1998 Richard Henderson * i386.md (ffssi, ffshi): Rewrite as define_expands. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 1232b4a46f6..f4743faaf81 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1911,7 +1911,7 @@ asm_output_function_prefix (file, name) if (pic_label_rtx == 0) { pic_label_rtx = gen_label_rtx (); - sprintf (pic_label_name, "LPR%d", pic_label_no++); + ASM_GENERATE_INTERNAL_LABEL (pic_label_name, "LPR", pic_label_no++); LABEL_NAME (pic_label_rtx) = pic_label_name; } @@ -1966,7 +1966,7 @@ load_pic_register (do_rtl) if (pic_label_rtx == 0) { pic_label_rtx = gen_label_rtx (); - sprintf (pic_label_name, "LPR%d", pic_label_no++); + ASM_GENERATE_INTERNAL_LABEL (pic_label_name, "LPR", pic_label_no++); LABEL_NAME (pic_label_rtx) = pic_label_name; } @@ -1984,7 +1984,7 @@ load_pic_register (do_rtl) } else { - output_asm_insn (AS1 (call,%P1), xops); + output_asm_insn (AS1 (call,%X1), xops); output_asm_insn ("addl $_GLOBAL_OFFSET_TABLE_,%0", xops); pic_label_rtx = 0; } @@ -2979,7 +2979,9 @@ output_pic_addr_const (file, x, code) assemble_name (asm_out_file, buf); } - if (GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) + if (code == 'X') + ; /* No suffix, dammit. */ + else if (GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x)) fprintf (file, "@GOTOFF(%%ebx)"); else if (code == 'P') fprintf (file, "@PLT"); @@ -3272,6 +3274,7 @@ print_operand (file, x, code) case 'h': case 'y': case 'P': + case 'X': break; case 'J': @@ -3550,7 +3553,7 @@ print_operand_address (file, addr) /* Set the cc_status for the results of an insn whose pattern is EXP. On the 80386, we assume that only test and compare insns, as well - as SI, HI, & DI mode ADD, SUB, NEG, AND, IOR, XOR, ASHIFT, + as SI, HI, & DI mode ADD, SUB, NEG, AND, IOR, XOR, BSF, ASHIFT, ASHIFTRT, and LSHIFTRT instructions set the condition codes usefully. Also, we assume that jumps, moves and sCOND don't affect the condition codes. All else clobbers the condition codes, by assumption. diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index adab26d549c..8775a5ba786 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2509,9 +2509,13 @@ 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) - w -- print the operand as if it's a "word" (HImode) even if it isn't. - b -- print the operand as if it's a byte (QImode) even if it isn't. - c -- don't print special prefixes before constant operands. */ + P -- if PIC, print an @PLT suffix. + X -- don't print any sort of PIC '@' suffix for a symbol. + J -- print jump insn for arithmetic_comparison_operator. + s -- ??? something to do with double shifts. not actually used, afaik. + C -- print a conditional move suffix corresponding to the op code. + c -- likewise, but reverse the condition. + F,f -- likewise, but for floating-point. */ #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ ((CODE) == '*') diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 3a88982852a..5bdb141fbba 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -6657,7 +6657,7 @@ byte_xor_operation: } else { - sprintf (buffer, \"addl %s+[.-%%P2],%%0\", XSTR (operands[1], 0)); + sprintf (buffer, \"addl %s+[.-%%X2],%%0\", XSTR (operands[1], 0)); output_asm_insn (buffer, operands); } RET; @@ -6671,7 +6671,7 @@ byte_xor_operation: { char buffer[64]; - output_asm_insn (AS1 (call,%P1), operands); + output_asm_insn (AS1 (call,%X1), operands); if (! TARGET_DEEP_BRANCH_PREDICTION) { ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[1])); @@ -6685,11 +6685,11 @@ byte_xor_operation: "* { operands[1] = gen_label_rtx (); - output_asm_insn (AS1 (call,%P1), operands); + output_asm_insn (AS1 (call,%X1), operands); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[1])); output_asm_insn (AS1 (pop%L0,%0), operands); - output_asm_insn (\"addl $_GLOBAL_OFFSET_TABLE_+[.-%P1],%0\", operands); + output_asm_insn (\"addl $_GLOBAL_OFFSET_TABLE_+[.-%X1],%0\", operands); RET; }") -- 2.11.0