This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] x86 Darwin support, revised


Here is the x86 Darwin patch, revised as per rth suggestions. No
actual behavioral changes from the first version, although it's
worth checking ix86_value_regno to make sure it's the same as the
old VALUE_REGNO macro. (Bootstrapping worked OK, and I'm running
an i386-elf cross just to be careful.)

Stan

2002-07-30 Stan Shebs <shebs@apple.com>

* config.gcc (i[34567]86-*-darwin*): New configuration.
* config/darwin.h (TARGET_ENCODE_SECTION_INFO): Undefine before
defining.
(TARGET_ENCODE_SECTION_INFO): Ditto.
(ASM_PREFERRED_EH_DATA_FORMAT): Ditto.
* config/darwin.c (machopic_indirect_data_reference): Remove
setting of RTX_UNCHANGING_P.
(machopic_legitimize_pic_address): Move RTX_UNCHANGING_P up so as
not to be applied to sums.
* config/i386/t-darwin: New file.
* config/i386/darwin.h: New file.
* config/i386/i386.h (TARGET_MACHO): Add default definition.
* config/i386/i386.md (tablejump): Add TARGET_MACHO case.
* config/i386/i386.c (output_set_got): For Mach-O, output Mach-O
label and not the GOT add.
(constant_address_p): For Mach-O, seeing a CONST is enough.
(legitimate_pic_address_disp_p): Add a Mach-O case.
(legitimate_address_p): Also test machopic_operand_p if Mach-O.
(legitimize_pic_address): Use generic Mach-O code to legitimize.
(output_pic_addr_const): Suppress @PLT if Mach-O, and parens
if outputting a difference.
(ix86_output_addr_diff_elt): Add Mach-O case.
(ix86_expand_move): Similarly.
(ix86_expand_call): Similarly.
(current_machopic_label_num): New global.
(machopic_output_stub): New function.
(ix86_value_regno): New function.
(ix86_function_value): Use it instead of VALUE_REGNO.
(ix86_libcall_value): Ditto.
* config/i386/unix.h (VALUE_REGNO): Remove.

Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.229
diff -p -r1.229 config.gcc
*** config.gcc 29 Jul 2002 22:21:40 -0000 1.229
--- config.gcc 30 Jul 2002 19:30:51 -0000
*************** i370-*-linux*)
*** 998,1003 ****
--- 998,1015 ----
thread_file='posix'
fi
;;
+ i[34567]86-*-darwin*)
+ tm_file="${tm_file} darwin.h i386/darwin.h"
+ tm_p_file="${tm_p_file} darwin-protos.h"
+ tmake_file=i386/t-darwin
+ extra_objs="darwin.o"
+ target_gtfiles="\$(srcdir)/config/darwin.c"
+ c_target_objs="darwin-c.o"
+ cxx_target_objs="darwin-c.o"
+ # Darwin linker does collect2 functionality
+ use_collect2=no
+ float_format=i386
+ ;;
i[34567]86-*-elf*)
xm_defines=POSIX
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h"
Index: config/darwin.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.c,v
retrieving revision 1.23
diff -p -r1.23 darwin.c
*** config/darwin.c 16 Jul 2002 23:59:40 -0000 1.23
--- config/darwin.c 30 Jul 2002 19:30:52 -0000
*************** machopic_indirect_data_reference (orig,
*** 491,499 ****
else
result = gen_rtx (PLUS, Pmode, base, orig);

- if (RTX_UNCHANGING_P (base) && RTX_UNCHANGING_P (orig))
- RTX_UNCHANGING_P (result) = 1;
-
if (MACHOPIC_JUST_INDIRECT && GET_CODE (base) == MEM)
{
if (reg)
--- 491,496 ----
*************** machopic_legitimize_pic_address (orig, m
*** 665,674 ****
}
#if !defined (TARGET_TOC)
- RTX_UNCHANGING_P (pic_ref) = 1;
emit_move_insn (reg, pic_ref);
pic_ref = gen_rtx (MEM, GET_MODE (orig), reg);
#endif
}
else
{
--- 662,671 ----
}
#if !defined (TARGET_TOC)
emit_move_insn (reg, pic_ref);
pic_ref = gen_rtx (MEM, GET_MODE (orig), reg);
#endif
+ RTX_UNCHANGING_P (pic_ref) = 1;
}
else
{
*************** machopic_legitimize_pic_address (orig, m
*** 700,705 ****
--- 697,703 ----
gen_rtx (LO_SUM, Pmode,
hi_sum_reg, offset)));
pic_ref = reg;
+ RTX_UNCHANGING_P (pic_ref) = 1;
#else
emit_insn (gen_rtx (SET, VOIDmode, reg,
gen_rtx (HIGH, Pmode, offset)));
*************** machopic_legitimize_pic_address (orig, m
*** 707,712 ****
--- 705,711 ----
gen_rtx (LO_SUM, Pmode, reg, offset)));
pic_ref = gen_rtx (PLUS, Pmode,
pic_offset_table_rtx, reg);
+ RTX_UNCHANGING_P (pic_ref) = 1;
#endif
}
else
*************** machopic_legitimize_pic_address (orig, m
*** 736,743 ****
}
}
}
-
- RTX_UNCHANGING_P (pic_ref) = 1;

if (GET_CODE (pic_ref) != REG)
{
--- 735,740 ----
Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.34
diff -p -r1.34 darwin.h
*** config/darwin.h 30 Jul 2002 12:34:23 -0000 1.34
--- config/darwin.h 30 Jul 2002 19:30:52 -0000
*************** enum machopic_addr_class {
*** 548,554 ****
--- 548,556 ----
#define MACHOPIC_JUST_INDIRECT (flag_pic == 1)
#define MACHOPIC_PURE (flag_pic == 2)

+ #undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO darwin_encode_section_info
+ #undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING darwin_strip_name_encoding

#define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH) \
*************** enum machopic_addr_class {
*** 611,616 ****
--- 613,619 ----

#define TARGET_ASM_EH_FRAME_SECTION darwin_eh_frame_section
+ #undef ASM_PREFERRED_EH_DATA_FORMAT
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
(((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr)

Index: config/i386/darwin.h
===================================================================
RCS file: config/i386/darwin.h
diff -N config/i386/darwin.h
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- config/i386/darwin.h 30 Jul 2002 19:30:52 -0000
***************
*** 0 ****
--- 1,124 ----
+ /* Target definitions for x86 running Darwin.
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ Contributed by Apple Computer Inc.
+
+ This file is part of GNU CC.
+
+ GNU CC is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU CC is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU CC; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+ /* Enable Mach-O bits in generic x86 code. */
+ #undef TARGET_MACHO
+ #define TARGET_MACHO 1
+
+ #define TARGET_VERSION fprintf (stderr, " (i386 Darwin)");
+
+ #define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__i386__"); \
+ builtin_define ("__LITTLE_ENDIAN__"); \
+ builtin_define ("__MACH__"); \
+ builtin_define ("__APPLE__"); \
+ } \
+ while (0)
+
+ /* We want -fPIC by default, unless we're using -static to compile for
+ the kernel or some such. */
+
+ #undef CC1_SPEC
+ #define CC1_SPEC "%{!static:-fPIC}"
+
+ /* The Darwin assembler mostly follows AT&T syntax. */
+ #undef ASSEMBLER_DIALECT
+ #define ASSEMBLER_DIALECT ASM_ATT
+
+ /* Define macro used to output shift-double opcodes when the shift
+ count is in %cl. Some assemblers require %cl as an argument;
+ some don't. This macro controls what to do: by default, don't
+ print %cl. */
+
+ #define SHIFT_DOUBLE_OMITS_COUNT 0
+
+ /* Define the syntax of pseudo-ops, labels and comments. */
+
+ /* String containing the assembler's comment-starter. */
+
+ #define ASM_COMMENT_START "#"
+
+ /* By default, target has a 80387, uses IEEE compatible arithmetic,
+ and returns float values in the 387. */
+
+ #define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
+
+ /* TARGET_DEEP_BRANCH_PREDICTION is incompatible with Mach-O PIC. */
+
+ #undef TARGET_DEEP_BRANCH_PREDICTION
+ #define TARGET_DEEP_BRANCH_PREDICTION 0
+
+ /* Define the syntax of pseudo-ops, labels and comments. */
+
+ #define LPREFIX "L"
+
+ /* This definition is unlikely to be used, but provide it just in
+ case. */
+
+ #define USER_LABEL_PREFIX "_"
+
+ /* Assembler pseudos to introduce constants of various size. */
+
+ #define ASM_BYTE_OP "\t.byte\t"
+ #define ASM_SHORT "\t.word\t"
+ #define ASM_LONG "\t.long\t"
+ /* Darwin as doesn't do ".quad". */
+
+ #undef ASM_OUTPUT_ALIGN
+ #define ASM_OUTPUT_ALIGN(FILE,LOG) \
+ do { if ((LOG) != 0) \
+ if (in_text_section () \
+ ) \
+ fprintf (FILE, "\t%s %d,0x90\n", ALIGN_ASM_OP, (LOG)); \
+ else \
+ fprintf (FILE, "\t%s %d\n", ALIGN_ASM_OP, (LOG)); \
+ } while (0)
+
+ /* This says how to output an assembler line
+ to define a global common symbol. */
+
+ #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
+ ( fputs (".comm ", (FILE)), \
+ assemble_name ((FILE), (NAME)), \
+ fprintf ((FILE), ",%u\n", (ROUNDED)))
+
+ /* This says how to output an assembler line
+ to define a local common symbol. */
+
+ #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
+ ( fputs (".lcomm ", (FILE)), \
+ assemble_name ((FILE), (NAME)), \
+ fprintf ((FILE), ",%u\n", (ROUNDED)))
+
+ /* Darwin profiling -- call mcount. */
+ #undef FUNCTION_PROFILER
+ #define FUNCTION_PROFILER(FILE, LABELNO) \
+ do { \
+ if (MACHOPIC_INDIRECT) \
+ { \
+ const char *name = machopic_stub_name ("*mcount"); \
+ fprintf (FILE, "\tcall %s\n", name+1); /* skip '&' */ \
+ machopic_validate_stub_or_non_lazy_ptr (name, /*stub:*/1); \
+ } \
+ else fprintf (FILE, "\tcall mcount\n"); \
+ } while (0)
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.439
diff -p -r1.439 i386.c
*** config/i386/i386.c 24 Jul 2002 13:41:20 -0000 1.439
--- config/i386/i386.c 30 Jul 2002 19:30:54 -0000
*************** static int ix86_comp_type_attributes PAR
*** 744,749 ****
--- 744,750 ----
const struct attribute_spec ix86_attribute_table[];
static tree ix86_handle_cdecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
static tree ix86_handle_regparm_attribute PARAMS ((tree *, tree, tree, int, bool *));
+ static int ix86_value_regno PARAMS ((enum machine_mode));

#if defined (DO_GLOBAL_CTORS_BODY) && defined (HAS_INIT_SECTION)
static void ix86_svr3_asm_out_constructor PARAMS ((rtx, int));
*************** ix86_function_value (valtype)
*** 2235,2241 ****
return ret;
}
else
! return gen_rtx_REG (TYPE_MODE (valtype), VALUE_REGNO (TYPE_MODE (valtype)));
}

/* Return false iff type is returned in memory. */
--- 2236,2243 ----
return ret;
}
else
! return gen_rtx_REG (TYPE_MODE (valtype),
! ix86_value_regno (TYPE_MODE (valtype)));
}

/* Return false iff type is returned in memory. */
*************** ix86_libcall_value (mode)
*** 2285,2291 ****
}
}
else
! return gen_rtx_REG (mode, VALUE_REGNO (mode));
}

/* Create the va_list data type. */
--- 2287,2306 ----
}
}
else
! return gen_rtx_REG (mode, ix86_value_regno (mode));
! }
!
! /* Given a mode, return the register to use for a return value. */
!
! static int
! ix86_value_regno (mode)
! enum machine_mode mode;
! {
! if (GET_MODE_CLASS (mode) == MODE_FLOAT && TARGET_FLOAT_RETURNS_IN_80387)
! return FIRST_FLOAT_REG;
! if (mode == TImode || VECTOR_MODE_P (mode))
! return FIRST_SSE_REG;
! return 0;
}

/* Create the va_list data type. */
*************** output_set_got (dest)
*** 3950,3955 ****
--- 3965,3975 ----
else
output_asm_insn ("call\t%a2", xops);

+ #if TARGET_MACHO
+ /* Output the "canonical" label name ("Lxx$pb") here too. This
+ is what will be referred to by the Mach-O PIC subsystem. */
+ ASM_OUTPUT_LABEL (asm_out_file, machopic_function_base_name ());
+ #endif
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "L",
CODE_LABEL_NUMBER (XEXP (xops[2], 0)));

*************** output_set_got (dest)
*** 3969,3975 ****

if (!flag_pic || TARGET_DEEP_BRANCH_PREDICTION)
output_asm_insn ("add{l}\t{%1, %0|%0, %1}", xops);
! else
output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %a1+(.-%a2)}", xops);

return "";
--- 3989,3995 ----

if (!flag_pic || TARGET_DEEP_BRANCH_PREDICTION)
output_asm_insn ("add{l}\t{%1, %0|%0, %1}", xops);
! else if (!TARGET_MACHO)
output_asm_insn ("add{l}\t{%1+[.-%a2], %0|%0, %a1+(.-%a2)}", xops);

return "";
*************** constant_address_p (x)
*** 4861,4866 ****
--- 4881,4890 ----
return TARGET_64BIT;

case CONST:
+ /* For Mach-O, really believe the CONST. */
+ if (TARGET_MACHO)
+ return true;
+ /* Otherwise fall through. */
case SYMBOL_REF:
return !flag_pic && legitimate_constant_p (x);

*************** legitimate_pic_address_disp_p (disp)
*** 4959,4964 ****
--- 4983,5001 ----
saw_plus = true;
}

+ /* Allow {LABEL | SYMBOL}_REF - SYMBOL_REF-FOR-PICBASE for Mach-O. */
+ if (TARGET_MACHO && GET_CODE (disp) == MINUS)
+ {
+ if (GET_CODE (XEXP (disp, 0)) == LABEL_REF
+ || GET_CODE (XEXP (disp, 0)) == SYMBOL_REF)
+ if (GET_CODE (XEXP (disp, 1)) == SYMBOL_REF)
+ {
+ const char *sym_name = XSTR (XEXP (disp, 1), 0);
+ if (strstr (sym_name, "$pb") != 0)
+ return 1;
+ }
+ }
+
if (GET_CODE (disp) != UNSPEC)
return 0;

*************** legitimate_address_p (mode, addr, strict
*** 5160,5166 ****
goto report_error;
}

! else if (flag_pic && SYMBOLIC_CONST (disp))
{
is_legitimate_pic:
if (TARGET_64BIT && (index || base))
--- 5197,5207 ----
goto report_error;
}

! else if (flag_pic && (SYMBOLIC_CONST (disp)
! #if TARGET_MACHO
! && !machopic_operand_p (disp)
! #endif
! ))
{
is_legitimate_pic:
if (TARGET_64BIT && (index || base))
*************** legitimize_pic_address (orig, reg)
*** 5255,5260 ****
--- 5296,5308 ----
rtx new = orig;
rtx base;

+ #if TARGET_MACHO
+ if (reg == 0)
+ reg = gen_reg_rtx (Pmode);
+ /* Use the generic Mach-O PIC machinery. */
+ return machopic_legitimize_pic_address (orig, GET_MODE (orig), reg);
+ #endif
+
if (local_symbolic_operand (addr, Pmode))
{
/* In 64bit mode we can address such objects directly. */
*************** output_pic_addr_const (file, x, code)
*** 5767,5773 ****

case SYMBOL_REF:
assemble_name (file, XSTR (x, 0));
! if (code == 'P' && ! SYMBOL_REF_FLAG (x))
fputs ("@PLT", file);
break;

--- 5815,5821 ----

case SYMBOL_REF:
assemble_name (file, XSTR (x, 0));
! if (!TARGET_MACHO && code == 'P' && ! SYMBOL_REF_FLAG (x))
fputs ("@PLT", file);
break;

*************** output_pic_addr_const (file, x, code)
*** 5825,5835 ****
break;

case MINUS:
! putc (ASSEMBLER_DIALECT == ASM_INTEL ? '(' : '[', file);
output_pic_addr_const (file, XEXP (x, 0), code);
putc ('-', file);
output_pic_addr_const (file, XEXP (x, 1), code);
! putc (ASSEMBLER_DIALECT == ASM_INTEL ? ')' : ']', file);
break;

case UNSPEC:
--- 5873,5885 ----
break;

case MINUS:
! if (!TARGET_MACHO)
! putc (ASSEMBLER_DIALECT == ASM_INTEL ? '(' : '[', file);
output_pic_addr_const (file, XEXP (x, 0), code);
putc ('-', file);
output_pic_addr_const (file, XEXP (x, 1), code);
! if (!TARGET_MACHO)
! putc (ASSEMBLER_DIALECT == ASM_INTEL ? ')' : ']', file);
break;

case UNSPEC:
*************** ix86_output_addr_diff_elt (file, value,
*** 7266,7271 ****
--- 7316,7326 ----
ASM_LONG, LPREFIX, value, LPREFIX, rel);
else if (HAVE_AS_GOTOFF_IN_DATA)
fprintf (file, "%s%s%d@GOTOFF\n", ASM_LONG, LPREFIX, value);
+ #if TARGET_MACHO
+ else if (TARGET_MACHO)
+ fprintf (file, "%s%s%d-%s\n", ASM_LONG, LPREFIX, value,
+ machopic_function_base_name () + 1);
+ #endif
else
asm_fprintf (file, "%s%U_GLOBAL_OFFSET_TABLE_+[.-%s%d]\n",
ASM_LONG, LPREFIX, value);
*************** ix86_expand_move (mode, operands)
*** 7378,7383 ****
--- 7433,7461 ----
}
else if (flag_pic && mode == Pmode && symbolic_operand (op1, Pmode))
{
+ #if TARGET_MACHO
+ if (MACHOPIC_PURE)
+ {
+ rtx temp = ((reload_in_progress
+ || ((op0 && GET_CODE (op0) == REG)
+ && mode == Pmode))
+ ? op0 : gen_reg_rtx (Pmode));
+ op1 = machopic_indirect_data_reference (op1, temp);
+ op1 = machopic_legitimize_pic_address (op1, mode,
+ temp == op1 ? 0 : temp);
+ }
+ else
+ {
+ if (MACHOPIC_INDIRECT)
+ op1 = machopic_indirect_data_reference (op1, 0);
+ }
+ if (op0 != op1)
+ {
+ insn = gen_rtx_SET (VOIDmode, op0, op1);
+ emit_insn (insn);
+ }
+ return;
+ #endif /* TARGET_MACHO */
if (GET_CODE (op0) == MEM)
op1 = force_reg (Pmode, op1);
else
*************** ix86_expand_call (retval, fnaddr, callar
*** 10495,10500 ****
--- 10573,10582 ----
if (TARGET_64BIT && pop)
abort ();

+ #if TARGET_MACHO
+ if (flag_pic && GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF)
+ fnaddr = machopic_indirect_call_target (fnaddr);
+ #else
/* Static functions and indirect calls don't need the pic register. */
if (! TARGET_64BIT && flag_pic
&& GET_CODE (XEXP (fnaddr, 0)) == SYMBOL_REF
*************** ix86_expand_call (retval, fnaddr, callar
*** 10507,10512 ****
--- 10589,10595 ----
emit_move_insn (al, callarg2);
use_reg (&use, al);
}
+ #endif /* TARGET_MACHO */

if (! call_insn_operand (XEXP (fnaddr, 0), Pmode))
{
*************** ix86_svr3_asm_out_constructor (symbol, p
*** 13544,13549 ****
--- 13627,13697 ----
fputc ('\n', asm_out_file);
}
#endif
+
+ #if TARGET_MACHO
+
+ static int current_machopic_label_num;
+
+ /* Given a symbol name and its associated stub, write out the
+ definition of the stub. */
+
+ void
+ machopic_output_stub (file, symb, stub)
+ FILE *file;
+ const char *symb, *stub;
+ {
+ unsigned int length;
+ char *binder_name, *symbol_name, lazy_ptr_name[32];
+ int label = ++current_machopic_label_num;
+
+ /* Lose our funky encoding stuff so it doesn't contaminate the stub. */
+ symb = (*targetm.strip_name_encoding) (symb);
+
+ length = strlen (stub);
+ binder_name = alloca (length + 32);
+ GEN_BINDER_NAME_FOR_STUB (binder_name, stub, length);
+
+ length = strlen (symb);
+ symbol_name = alloca (length + 32);
+ GEN_SYMBOL_NAME_FOR_SYMBOL (symbol_name, symb, length);
+
+ sprintf (lazy_ptr_name, "L%d$lz", label);
+
+ if (MACHOPIC_PURE)
+ machopic_picsymbol_stub_section ();
+ else
+ machopic_symbol_stub_section ();
+
+ fprintf (file, "%s:\n", stub);
+ fprintf (file, "\t.indirect_symbol %s\n", symbol_name);
+
+ if (MACHOPIC_PURE)
+ {
+ fprintf (file, "\tcall LPC$%d\nLPC$%d:\tpopl %%eax\n", label, label);
+ fprintf (file, "\tmovl %s-LPC$%d(%%eax),%%edx\n", lazy_ptr_name, label);
+ fprintf (file, "\tjmp %%edx\n");
+ }
+ else
+ fprintf (file, "\tjmp *%s\n", lazy_ptr_name);
+ + fprintf (file, "%s:\n", binder_name);
+ + if (MACHOPIC_PURE)
+ {
+ fprintf (file, "\tlea %s-LPC$%d(%%eax),%%eax\n", lazy_ptr_name, label);
+ fprintf (file, "\tpushl %%eax\n");
+ }
+ else
+ fprintf (file, "\t pushl $%s\n", lazy_ptr_name);
+
+ fprintf (file, "\tjmp dyld_stub_binding_helper\n");
+
+ machopic_lazy_symbol_ptr_section ();
+ fprintf (file, "%s:\n", lazy_ptr_name);
+ fprintf (file, "\t.indirect_symbol %s\n", symbol_name);
+ fprintf (file, "\t.long %s\n", binder_name);
+ }
+ #endif /* TARGET_MACHO */

/* Order the registers for register allocator. */

Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.279
diff -p -r1.279 i386.h
*** config/i386/i386.h 30 Jul 2002 12:34:24 -0000 1.279
--- config/i386/i386.h 30 Jul 2002 19:30:54 -0000
*************** extern int x86_prefetch_sse;
*** 383,388 ****
--- 383,393 ----
the frame pointer in leaf functions. */
#define TARGET_DEFAULT 0

+ /* This is not really a target flag, but is done this way so that
+ it's analogous to similar code for Mach-O on PowerPC. darwin.h
+ redefines this to 1. */
+ #define TARGET_MACHO 0
+
/* This macro is similar to `TARGET_SWITCHES' but defines names of
command options that have values. Its definition is an
initializer with a subgrouping for each command option.
Index: config/i386/i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.378
diff -p -r1.378 i386.md
*** config/i386/i386.md 16 Jul 2002 10:24:11 -0000 1.378
--- config/i386/i386.md 30 Jul 2002 19:30:55 -0000
***************
*** 13141,13147 ****
op0 = operands[0];
op1 = gen_rtx_LABEL_REF (Pmode, operands[1]);
}
! else if (HAVE_AS_GOTOFF_IN_DATA)
{
code = PLUS;
op0 = operands[0];
--- 13141,13147 ----
op0 = operands[0];
op1 = gen_rtx_LABEL_REF (Pmode, operands[1]);
}
! else if (TARGET_MACHO || HAVE_AS_GOTOFF_IN_DATA)
{
code = PLUS;
op0 = operands[0];
Index: config/i386/t-darwin
===================================================================
RCS file: config/i386/t-darwin
diff -N config/i386/t-darwin
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- config/i386/t-darwin 30 Jul 2002 19:30:55 -0000
***************
*** 0 ****
--- 1,11 ----
+ darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) $(RTL_BASE_H) \
+ $(REGS_H) hard-reg-set.h insn-config.h conditions.h output.h \
+ insn-attr.h flags.h $(TREE_H) $(EXPR_H) reload.h \
+ function.h $(GGC_H) $(TM_P_H) gt-darwin.h
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
+ darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) \
+ $(TREE_H) $(C_TREE_H) c-pragma.h toplev.h cpplib.h $(TM_P_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
+
+ gt-darwin.h : s-gtype ; @true
Index: config/i386/unix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/unix.h,v
retrieving revision 1.20
diff -p -r1.20 unix.h
*** config/i386/unix.h 15 May 2002 09:00:25 -0000 1.20
--- config/i386/unix.h 30 Jul 2002 19:30:55 -0000
*************** Boston, MA 02111-1307, USA. */
*** 69,82 ****

#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)

- /* Floating-point return values come in the FP register. */
-
- #define VALUE_REGNO(MODE) \
- (GET_MODE_CLASS (MODE) == MODE_FLOAT \
- && TARGET_FLOAT_RETURNS_IN_80387 ? FIRST_FLOAT_REG \
- : (MODE) == TImode || VECTOR_MODE_P (MODE) ? FIRST_SSE_REG \
- : 0)
-
/* Output code to add DELTA to the first argument, and then jump to FUNCTION.
Used for C++ multiple inheritance. */
#define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \
--- 69,74 ----



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]