Commit f2972bf8 by Douglas B Rupp Committed by Douglas Rupp

ia64.c: Include libfuncs.h.


	* config/ia64/ia64.c: Include libfuncs.h.
	(TARGET_PROMOTE_FUNCITON_MODE): Define target macro.
	(ia64_expand_call): Use reg 25 on VMS.
	(ia64_initialize_trampoline): Fix for VMS ABI.
	(ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS.
	(ia64_function_arg): Initialize reg 25 on VMS.
	Fix OpenVMS ABI issues for varargs.
	For OpenVMS, emit the Argument Information register set in the
	incoming/sibcall case as well.
	(ia64_arg_type): New function.
	(ia64_function_arg_advance): Keep track of cum->words.
	Fix OpenVMS ABI issues for varargs.
	(ia64_function_value): On VMS, promote mode of non-aggregate types.
	(ia64_override_options): Set flag_no_common on VMS.
	(ia64_init_builtins): Disable FWRITE builtin.
	(ia64_asm_output_external): Call DO_CRTL_NAMES.
	(ia64_vms_init_libfuncs): Add decc$ routines.
	(ia64_vms_valid_pointer_mode): New function.
	(ia64_struct_value_rtx): Allways NULL_RTX on VMS.
	(ia64_promote_function_mode): New function
	* config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default.
	(LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS.
	(LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise.
	(INIT_CUMULATIVE_ARGS): Add atypes for VMS.
	(INIT_CUMULATIVE_INCOMING_ARGS): Likewise.
	(ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit.
	Suppress trailing '#' if VALUE is numeric.
	* config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to
	ia64_promote_function_mode.
	(TARGET_VALID_POINTER_MODE): Define.


Co-Authored-By: Olivier Hainque <hainque@adacore.com>

From-SVN: r151009
parent 124b0630
2009-08-21 Douglas B Rupp <rupp@gnat.com>
Olivier Hainque <hainque@adacore.com>
* config/ia64/ia64.c: Include libfuncs.h.
(TARGET_PROMOTE_FUNCITON_MODE): Define target macro.
(ia64_expand_call): Use reg 25 on VMS.
(ia64_initialize_trampoline): Fix for VMS ABI.
(ia64_function_arg_offset): Always returns 0 when TARGET_ABI_OPEN_VMS.
(ia64_function_arg): Initialize reg 25 on VMS.
Fix OpenVMS ABI issues for varargs.
For OpenVMS, emit the Argument Information register set in the
incoming/sibcall case as well.
(ia64_arg_type): New function.
(ia64_function_arg_advance): Keep track of cum->words.
Fix OpenVMS ABI issues for varargs.
(ia64_function_value): On VMS, promote mode of non-aggregate types.
(ia64_override_options): Set flag_no_common on VMS.
(ia64_init_builtins): Disable FWRITE builtin.
(ia64_asm_output_external): Call DO_CRTL_NAMES.
(ia64_vms_init_libfuncs): Add decc$ routines.
(ia64_vms_valid_pointer_mode): New function.
(ia64_struct_value_rtx): Allways NULL_RTX on VMS.
(ia64_promote_function_mode): New function
* config/ia64/ia64.h (TARGET_ABI_OPEN_VMS): Define as 0 for default.
(LONG_DOUBLE_TYPE_SIZE): Force to 64 on VMS.
(LIBCGC2_LONG_DOUBLE_TYPE_SIZE): Likewise.
(INIT_CUMULATIVE_ARGS): Add atypes for VMS.
(INIT_CUMULATIVE_INCOMING_ARGS): Likewise.
(ASM_OUTPUT_DEF): Use ISDIGIT instead of isdigit.
Suppress trailing '#' if VALUE is numeric.
* config/ia64/vms.h (PROMOTE_FUNCTION_MODE): Remove, code moved to
ia64_promote_function_mode.
(TARGET_VALID_POINTER_MODE): Define.
2009-08-21 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/40671
......
......@@ -73,6 +73,8 @@ extern unsigned int ia64_section_threshold;
#define TARGET_HPUX 0
#define TARGET_HPUX_LD 0
#define TARGET_ABI_OPEN_VMS 0
#ifndef TARGET_ILP32
#define TARGET_ILP32 0
#endif
......@@ -279,11 +281,17 @@ while (0)
#define DOUBLE_TYPE_SIZE 64
/* long double is XFmode normally, TFmode for HPUX. */
#define LONG_DOUBLE_TYPE_SIZE (TARGET_HPUX ? 128 : 80)
/* long double is XFmode normally, and TFmode for HPUX. It should be
TFmode for VMS as well but we only support up to DFmode now. */
#define LONG_DOUBLE_TYPE_SIZE \
(TARGET_HPUX ? 128 \
: TARGET_ABI_OPEN_VMS ? 64 \
: 80)
/* We always want the XFmode operations from libgcc2.c, except on VMS
where this yields references to unimplemented "insns". */
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE (TARGET_ABI_OPEN_VMS ? 64 : 80)
/* We always want the XFmode operations from libgcc2.c. */
#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 80
/* On HP-UX, we use the l suffix for TFmode in libgcc2.c. */
#define LIBGCC2_TF_CEXT l
......@@ -1077,12 +1085,16 @@ enum reg_class
`FUNCTION_ARG' and other related values. For some target machines, the type
`int' suffices and can hold the number of bytes of argument so far. */
enum ivms_arg_type {I64, FF, FD, FG, FS, FT};
/* VMS floating point formats VAX F, VAX D, VAX G, IEEE S, IEEE T. */
typedef struct ia64_args
{
int words; /* # words of arguments so far */
int int_regs; /* # GR registers used so far */
int fp_regs; /* # FR registers used so far */
int prototype; /* whether function prototyped */
enum ivms_arg_type atypes[8]; /* which VMS float type or if not float */
} CUMULATIVE_ARGS;
/* A C statement (sans semicolon) for initializing the variable CUM for the
......@@ -1094,6 +1106,9 @@ do { \
(CUM).int_regs = 0; \
(CUM).fp_regs = 0; \
(CUM).prototype = ((FNTYPE) && TYPE_ARG_TYPES (FNTYPE)) || (LIBNAME); \
(CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
(CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \
(CUM).atypes[6] = (CUM).atypes[7] = I64; \
} while (0)
/* Like `INIT_CUMULATIVE_ARGS' but overrides it for the purposes of finding the
......@@ -1108,6 +1123,9 @@ do { \
(CUM).int_regs = 0; \
(CUM).fp_regs = 0; \
(CUM).prototype = 1; \
(CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
(CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64; \
(CUM).atypes[6] = (CUM).atypes[7] = I64; \
} while (0)
/* A C statement (sans semicolon) to update the summarizer variable CUM to
......@@ -1496,8 +1514,11 @@ do { \
do { \
assemble_name (STREAM, NAME); \
fputs (" = ", STREAM); \
if (ISDIGIT (*VALUE)) \
ia64_asm_output_label = 1; \
assemble_name (STREAM, VALUE); \
fputc ('\n', STREAM); \
ia64_asm_output_label = 0; \
} while (0)
......
......@@ -66,26 +66,6 @@ along with GCC; see the file COPYING3. If not see
#undef WIDEST_HARDWARE_FP_SIZE
#define WIDEST_HARDWARE_FP_SIZE 64
/* HP OpenVMS Calling Standard dated June, 2004, that describes
HP OpenVMS I64 Version 8.2EFT
chapter 4 "OpenVMS I64 Conventions"
section 4.7 "Procedure Linkage"
subsection 4.7.5.2, "Normal Register Parameters"
"Unsigned integral (except unsigned 32-bit), set, and VAX
floating-point values passed in registers are zero-filled;
signed integral values as well as unsigned 32-bit integral
values are sign-extended to 64 bits. For all other types
passed in the general registers, unused bits are undefined." */
#define PROMOTE_FUNCTION_MODE(MODE,UNSIGNEDP,TYPE) \
if (GET_MODE_CLASS (MODE) == MODE_INT \
&& GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
{ \
if ((MODE) == SImode) \
(UNSIGNEDP) = 0; \
(MODE) = DImode; \
}
/* The structure return address arrives as an "argument" on VMS. */
#undef PCC_STATIC_STRUCT_RETURN
......@@ -227,5 +207,8 @@ typedef struct crtl_name_spec
#define ASM_OUTPUT_ALIGNED_DECL_COMMON(FILE, DECL, NAME, SIZE, ALIGN) \
ia64_vms_output_aligned_decl_common (FILE, DECL, NAME, SIZE, ALIGN)
#undef TARGET_VALID_POINTER_MODE
#define TARGET_VALID_POINTER_MODE ia64_vms_valid_pointer_mode
#undef TARGET_ASM_NAMED_SECTION
#define TARGET_ASM_NAMED_SECTION ia64_vms_elf_asm_named_section
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment