From: David Edelsohn Date: Wed, 19 Aug 1998 23:44:53 +0000 (-0600) Subject: rs6000.c (rs6000_output_load_toc_table): Use ld for 64-bit. X-Git-Tag: prereleases/egcs-1.1-prerelease~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=806e89e44114710134e6c04bdb8679ded625d592;p=thirdparty%2Fgcc.git rs6000.c (rs6000_output_load_toc_table): Use ld for 64-bit. � * rs6000.c (rs6000_output_load_toc_table): Use ld for 64-bit. (output_toc): Use single TOC slot or llong minimal-toc for DFmode and DImode 64-bit. Use llong for minimal-toc SFmode and SYMBOL_REF / LABEL_REF 64-bit. (output_function_profiler): Use llong for profiler label and ld to load 64-bit label address. From-SVN: r21867 --- diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index a8389238022c..402fdb50e81f 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -3757,7 +3757,8 @@ rs6000_output_load_toc_table (file, reg) #else /* !USING_SVR4_H */ ASM_GENERATE_INTERNAL_LABEL (buf, "LCTOC", 0); - asm_fprintf (file, "\t{l|lwz} %s,", reg_names[reg]); + asm_fprintf (file, TARGET_32BIT ? "\t{l|lwz} %s," : "\tld %s,", + reg_names[reg]); assemble_name (file, buf); asm_fprintf (file, "(%s)\n", reg_names[2]); #endif /* USING_SVR4_H */ @@ -4427,12 +4428,24 @@ output_toc (file, x, labelno) REAL_VALUE_FROM_CONST_DOUBLE (rv, x); REAL_VALUE_TO_TARGET_DOUBLE (rv, k); - if (TARGET_MINIMAL_TOC) - fprintf (file, "\t.long %ld\n\t.long %ld\n", k[0], k[1]); + if (TARGET_64BIT) + { + if (TARGET_MINIMAL_TOC) + fprintf (file, "\t.llong 0x%lx%08lx\n", k[0], k[1]); + else + fprintf (file, "\t.tc FD_%lx_%lx[TC],0x%lx%08lx\n", + k[0], k[1], k[0] & 0xffffffff, k[1] & 0xffffffff); + return; + } else - fprintf (file, "\t.tc FD_%lx_%lx[TC],%ld,%ld\n", - k[0], k[1], k[0], k[1]); - return; + { + if (TARGET_MINIMAL_TOC) + fprintf (file, "\t.long %ld\n\t.long %ld\n", k[0], k[1]); + else + fprintf (file, "\t.tc FD_%lx_%lx[TC],%ld,%ld\n", + k[0], k[1], k[0], k[1]); + return; + } } else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == SFmode && ! (TARGET_NO_FP_IN_TOC && ! TARGET_MINIMAL_TOC)) @@ -4444,7 +4457,7 @@ output_toc (file, x, labelno) REAL_VALUE_TO_TARGET_SINGLE (rv, l); if (TARGET_MINIMAL_TOC) - fprintf (file, "\t.long %ld\n", l); + fprintf (file, TARGET_32BIT ? "\t.long %ld\n" : "\t.llong %ld\n", l); else fprintf (file, "\t.tc FS_%lx[TC],%ld\n", l, l); return; @@ -4474,12 +4487,25 @@ output_toc (file, x, labelno) } #endif - if (TARGET_MINIMAL_TOC) - fprintf (file, "\t.long %ld\n\t.long %ld\n", (long)high, (long)low); + if (TARGET_64BIT) + { + if (TARGET_MINIMAL_TOC) + fprintf (file, "\t.llong 0x%lx%08lx\n", (long)high, (long)low); + else + fprintf (file, "\t.tc ID_%lx_%lx[TC],0x%lx%08lx\n", + (long)high, (long)low, (long)high, (long)low); + return; + } else - fprintf (file, "\t.tc ID_%lx_%lx[TC],%ld,%ld\n", - (long)high, (long)low, (long)high, (long)low); - return; + { + if (TARGET_MINIMAL_TOC) + fprintf (file, "\t.long %ld\n\t.long %ld\n", + (long)high, (long)low); + else + fprintf (file, "\t.tc ID_%lx_%lx[TC],%ld,%ld\n", + (long)high, (long)low, (long)high, (long)low); + return; + } } if (GET_CODE (x) == CONST) @@ -4499,7 +4525,7 @@ output_toc (file, x, labelno) STRIP_NAME_ENCODING (real_name, name); if (TARGET_MINIMAL_TOC) - fputs ("\t.long ", file); + fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", file); else { fprintf (file, "\t.tc %s", real_name); @@ -4726,7 +4752,7 @@ output_function_profiler (file, labelno) ASM_OUTPUT_INTERNAL_LABEL (file, "LPC", labelno); if (TARGET_MINIMAL_TOC) { - fputs ("\t.long ", file); + fputs (TARGET_32BIT ? "\t.long " : "\t.llong ", file); assemble_name (file, buf); putc ('\n', file); } @@ -4758,7 +4784,8 @@ output_function_profiler (file, labelno) /* Load location address into r3, and call mcount. */ ASM_GENERATE_INTERNAL_LABEL (buf, "LPC", labelno); - asm_fprintf (file, "\t{l|lwz} %s,", reg_names[3]); + asm_fprintf (file, TARGET_32BIT ? "\t{l|lwz} %s," : "\tld %s,", + reg_names[3]); assemble_name (file, buf); asm_fprintf (file, "(%s)\n\tbl %s\n\t%s\n", reg_names[2], RS6000_MCOUNT, RS6000_CALL_GLUE);