Commit 5326695a by Andrew Stubbs Committed by Andrew Stubbs

GCN back-end code

This patch contains the major part of the GCN back-end.  The machine
description has been broken out to avoid the mailing list size limit.

The back-end contains various bits that support OpenACC and OpenMP, but the
middle-end and libgomp patches are missing, as is mkoffload.  I include them
here because they're harmless and carving up the files seems like unnecessary
effort.  The remaining offload support will be posted at a later date.

The gcn-run.c is a separate tool that can run a GCN program on a GPU using
the ROCm drivers and HSA runtime libraries.

2019-01-17  Andrew Stubbs  <ams@codesourcery.com>
	    Kwok Cheung Yeung  <kcy@codesourcery.com>
	    Julian Brown  <julian@codesourcery.com>
	    Tom de Vries  <tom@codesourcery.com>
	    Jan Hubicka  <hubicka@ucw.cz>
	    Martin Jambor  <mjambor@suse.cz>

	gcc/
	* common/config/gcn/gcn-common.c: New file.
	* config/gcn/driver-gcn.c: New file.
	* config/gcn/gcn-builtins.def: New file.
	* config/gcn/gcn-hsa.h: New file.
	* config/gcn/gcn-modes.def: New file.
	* config/gcn/gcn-opts.h: New file.
	* config/gcn/gcn-passes.def: New file.
	* config/gcn/gcn-protos.h: New file.
	* config/gcn/gcn-run.c: New file.
	* config/gcn/gcn-tree.c: New file.
	* config/gcn/gcn.c: New file.
	* config/gcn/gcn.h: New file.
	* config/gcn/gcn.opt: New file.
	* config/gcn/t-gcn-hsa: New file.


Co-Authored-By: Jan Hubicka <hubicka@ucw.cz>
Co-Authored-By: Julian Brown <julian@codesourcery.com>
Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>
Co-Authored-By: Martin Jambor <mjambor@suse.cz>
Co-Authored-By: Tom de Vries <tom@codesourcery.com>

From-SVN: r268023
parent 3d6275e3
......@@ -5,6 +5,28 @@
Jan Hubicka <hubicka@ucw.cz>
Martin Jambor <mjambor@suse.cz>
* common/config/gcn/gcn-common.c: New file.
* config/gcn/driver-gcn.c: New file.
* config/gcn/gcn-builtins.def: New file.
* config/gcn/gcn-hsa.h: New file.
* config/gcn/gcn-modes.def: New file.
* config/gcn/gcn-opts.h: New file.
* config/gcn/gcn-passes.def: New file.
* config/gcn/gcn-protos.h: New file.
* config/gcn/gcn-run.c: New file.
* config/gcn/gcn-tree.c: New file.
* config/gcn/gcn.c: New file.
* config/gcn/gcn.h: New file.
* config/gcn/gcn.opt: New file.
* config/gcn/t-gcn-hsa: New file.
2019-01-17 Andrew Stubbs <ams@codesourcery.com>
Kwok Cheung Yeung <kcy@codesourcery.com>
Julian Brown <julian@codesourcery.com>
Tom de Vries <tom@codesourcery.com>
Jan Hubicka <hubicka@ucw.cz>
Martin Jambor <mjambor@suse.cz>
* config/gcn/constraints.md: New file.
* config/gcn/gcn-valu.md: New file.
* config/gcn/gcn.md: New file.
......
/* Common hooks for GCN
Copyright (C) 2016-2019 Free Software Foundation, Inc.
This file 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 3 of the License, or (at your option)
any later version.
This file 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "common/common-target.h"
#include "common/common-target-def.h"
#include "opts.h"
#include "flags.h"
#include "params.h"
/* Set default optimization options. */
static const struct default_options gcn_option_optimization_table[] =
{
{ OPT_LEVELS_1_PLUS, OPT_fomit_frame_pointer, NULL, 1 },
{ OPT_LEVELS_NONE, 0, NULL, 0 }
};
#undef TARGET_OPTION_OPTIMIZATION_TABLE
#define TARGET_OPTION_OPTIMIZATION_TABLE gcn_option_optimization_table
struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
/* Subroutines for the gcc driver.
Copyright (C) 2018-2019 Free Software Foundation, Inc.
This file is part of GCC.
GCC 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 3, or (at your option)
any later version.
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
const char *
last_arg_spec_function (int argc, const char **argv)
{
if (argc == 0)
return NULL;
return argv[argc-1];
}
/* Copyright (C) 2016-2019 Free Software Foundation, Inc.
This file 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 3 of the License, or (at your option)
any later version.
This file 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* The first argument to these macros is the return type of the builtin,
the rest are arguments of the builtin. */
#define _A1(a) {a, GCN_BTI_END_OF_PARAMS}
#define _A2(a,b) {a, b, GCN_BTI_END_OF_PARAMS}
#define _A3(a,b,c) {a, b, c, GCN_BTI_END_OF_PARAMS}
#define _A4(a,b,c,d) {a, b, c, d, GCN_BTI_END_OF_PARAMS}
#define _A5(a,b,c,d,e) {a, b, c, d, e, GCN_BTI_END_OF_PARAMS}
DEF_BUILTIN (FLAT_LOAD_INT32, 1 /*CODE_FOR_flat_load_v64si*/,
"flat_load_int32", B_INSN,
_A3 (GCN_BTI_V64SI, GCN_BTI_EXEC, GCN_BTI_V64SI),
gcn_expand_builtin_1)
DEF_BUILTIN (FLAT_LOAD_PTR_INT32, 2 /*CODE_FOR_flat_load_ptr_v64si */,
"flat_load_ptr_int32", B_INSN,
_A4 (GCN_BTI_V64SI, GCN_BTI_EXEC, GCN_BTI_SIPTR, GCN_BTI_V64SI),
gcn_expand_builtin_1)
DEF_BUILTIN (FLAT_STORE_PTR_INT32, 3 /*CODE_FOR_flat_store_ptr_v64si */,
"flat_store_ptr_int32", B_INSN,
_A5 (GCN_BTI_VOID, GCN_BTI_EXEC, GCN_BTI_SIPTR, GCN_BTI_V64SI,
GCN_BTI_V64SI),
gcn_expand_builtin_1)
DEF_BUILTIN (FLAT_LOAD_PTR_FLOAT, 2 /*CODE_FOR_flat_load_ptr_v64sf */,
"flat_load_ptr_float", B_INSN,
_A4 (GCN_BTI_V64SF, GCN_BTI_EXEC, GCN_BTI_SFPTR, GCN_BTI_V64SI),
gcn_expand_builtin_1)
DEF_BUILTIN (FLAT_STORE_PTR_FLOAT, 3 /*CODE_FOR_flat_store_ptr_v64sf */,
"flat_store_ptr_float", B_INSN,
_A5 (GCN_BTI_VOID, GCN_BTI_EXEC, GCN_BTI_SFPTR, GCN_BTI_V64SI,
GCN_BTI_V64SF),
gcn_expand_builtin_1)
DEF_BUILTIN (SQRTVF, 3 /*CODE_FOR_sqrtvf */,
"sqrtvf", B_INSN,
_A2 (GCN_BTI_V64SF, GCN_BTI_V64SF),
gcn_expand_builtin_1)
DEF_BUILTIN (SQRTF, 3 /*CODE_FOR_sqrtf */,
"sqrtf", B_INSN,
_A2 (GCN_BTI_SF, GCN_BTI_SF),
gcn_expand_builtin_1)
DEF_BUILTIN (CMP_SWAP, -1,
"cmp_swap", B_INSN,
_A4 (GCN_BTI_UINT, GCN_BTI_VOIDPTR, GCN_BTI_UINT, GCN_BTI_UINT),
gcn_expand_builtin_1)
DEF_BUILTIN (CMP_SWAPLL, -1,
"cmp_swapll", B_INSN,
_A4 (GCN_BTI_LLUINT,
GCN_BTI_VOIDPTR, GCN_BTI_LLUINT, GCN_BTI_LLUINT),
gcn_expand_builtin_1)
/* DEF_BUILTIN_BINOP_INT_FP creates many variants of a builtin function for a
given operation. The first argument will give base to the identifier of a
particular builtin, the second will be used to form the name of the patter
used to expand it to and the third will be used to create the user-visible
builtin identifier. */
DEF_BUILTIN_BINOP_INT_FP (ADD, add, "add")
DEF_BUILTIN_BINOP_INT_FP (SUB, sub, "sub")
DEF_BUILTIN_BINOP_INT_FP (AND, and, "and")
DEF_BUILTIN_BINOP_INT_FP (IOR, ior, "or")
DEF_BUILTIN_BINOP_INT_FP (XOR, xor, "xor")
/* OpenMP. */
DEF_BUILTIN (OMP_DIM_SIZE, CODE_FOR_oacc_dim_size,
"dim_size", B_INSN,
_A2 (GCN_BTI_INT, GCN_BTI_INT),
gcn_expand_builtin_1)
DEF_BUILTIN (OMP_DIM_POS, CODE_FOR_oacc_dim_pos,
"dim_pos", B_INSN,
_A2 (GCN_BTI_INT, GCN_BTI_INT),
gcn_expand_builtin_1)
/* OpenACC. */
DEF_BUILTIN (ACC_SINGLE_START, -1, "single_start", B_INSN, _A1 (GCN_BTI_BOOL),
gcn_expand_builtin_1)
DEF_BUILTIN (ACC_SINGLE_COPY_START, -1, "single_copy_start", B_INSN,
_A1 (GCN_BTI_LDS_VOIDPTR), gcn_expand_builtin_1)
DEF_BUILTIN (ACC_SINGLE_COPY_END, -1, "single_copy_end", B_INSN,
_A2 (GCN_BTI_VOID, GCN_BTI_LDS_VOIDPTR), gcn_expand_builtin_1)
DEF_BUILTIN (ACC_BARRIER, -1, "acc_barrier", B_INSN, _A1 (GCN_BTI_VOID),
gcn_expand_builtin_1)
#undef _A1
#undef _A2
#undef _A3
#undef _A4
#undef _A5
/* Copyright (C) 2016-2019 Free Software Foundation, Inc.
This file 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 3 of the License, or (at your option)
any later version.
This file 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef OBJECT_FORMAT_ELF
#error elf.h included before elfos.h
#endif
#define TEXT_SECTION_ASM_OP "\t.section\t.text"
#define BSS_SECTION_ASM_OP "\t.section\t.bss"
#define GLOBAL_ASM_OP "\t.globl\t"
#define DATA_SECTION_ASM_OP "\t.data\t"
#define SET_ASM_OP "\t.set\t"
#define LOCAL_LABEL_PREFIX "."
#define USER_LABEL_PREFIX ""
#define ASM_COMMENT_START ";"
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
gcn_hsa_declare_function_name ((FILE), (NAME), (DECL))
/* Unlike GNU as, the LLVM assembler uses log2 alignments. */
#undef ASM_OUTPUT_ALIGNED_COMMON
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGNMENT) \
(fprintf ((FILE), "%s", COMMON_ASM_OP), \
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), "," HOST_WIDE_INT_PRINT_UNSIGNED ",%u\n", \
(SIZE) > 0 ? (SIZE) : 1, exact_log2 ((ALIGNMENT) / BITS_PER_UNIT)))
#define ASM_OUTPUT_LABEL(FILE,NAME) \
do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)
#define ASM_OUTPUT_LABELREF(FILE, NAME) \
asm_fprintf (FILE, "%U%s", default_strip_name_encoding (NAME))
extern unsigned int gcn_local_sym_hash (const char *name);
#define ASM_OUTPUT_SYMBOL_REF(FILE, X) gcn_asm_output_symbol_ref (FILE, X)
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL)
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
fprintf (FILE, "\t.word .L%d\n", VALUE)
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
do { if (LOG!=0) fprintf (FILE, "\t.align\t%d\n", 1<<(LOG)); } while (0)
#define ASM_OUTPUT_ALIGN_WITH_NOP(FILE,LOG) \
do { \
if (LOG!=0) \
fprintf (FILE, "\t.p2alignl\t%d, 0xBF800000" \
" ; Fill value is 's_nop 0'\n", (LOG)); \
} while (0)
#define ASM_APP_ON ""
#define ASM_APP_OFF ""
/* Avoid the default in ../../gcc.c, which adds "-pthread", which is not
supported for gcn. */
#define GOMP_SELF_SPECS ""
/* Use LLVM assembler and linker options. */
#define ASM_SPEC "-triple=amdgcn--amdhsa " \
"%:last_arg(%{march=*:-mcpu=%*}) " \
"-filetype=obj"
/* Add -mlocal-symbol-id=<source-file-basename> unless the user (or mkoffload)
passes the option explicitly on the command line. The option also causes
several dump-matching tests to fail in the testsuite, so the option is not
added when or tree dump/compare-debug options used in the testsuite are
present.
This has the potential for surprise, but a user can still use an explicit
-mlocal-symbol-id=<whatever> option manually together with -fdump-tree or
-fcompare-debug options. */
#define CC1_SPEC "%{!mlocal-symbol-id=*:%{!fdump-tree-*:" \
"%{!fdump-ipa-*:%{!fcompare-debug*:-mlocal-symbol-id=%b}}}}"
#define LINK_SPEC "--pie"
#define LIB_SPEC "-lc"
/* Provides a _start symbol to keep the linker happy. */
#define STARTFILE_SPEC "crt0.o%s"
#define ENDFILE_SPEC ""
#define STANDARD_STARTFILE_PREFIX_2 ""
/* The LLVM assembler rejects multiple -mcpu options, so we must drop
all but the last. */
extern const char *last_arg_spec_function (int argc, const char **argv);
#define EXTRA_SPEC_FUNCTIONS \
{ "last_arg", last_arg_spec_function },
#undef LOCAL_INCLUDE_DIR
/* FIXME: Review debug info settings.
* In particular, EH_FRAME_THROUGH_COLLECT2 is probably the wrong
* thing but stuff fails to build without it.
* (Debug info is not a big deal until we get a debugger.) */
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
#define DWARF2_DEBUGGING_INFO 1
#define DWARF2_ASM_LINE_DEBUG_INFO 1
#define EH_FRAME_THROUGH_COLLECT2 1
/* Copyright (C) 2016-2019 Free Software Foundation, Inc.
This file 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 3 of the License, or (at your option)
any later version.
This file 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Half-precision floating point */
FLOAT_MODE (HF, 2, 0);
/* FIXME: No idea what format it is. */
ADJUST_FLOAT_FORMAT (HF, &ieee_half_format);
/* Native vector modes. */
VECTOR_MODE (INT, QI, 64); /* V64QI */
VECTOR_MODE (INT, HI, 64); /* V64HI */
VECTOR_MODE (INT, SI, 64); /* V64SI */
VECTOR_MODE (INT, DI, 64); /* V64DI */
VECTOR_MODE (INT, TI, 64); /* V64TI */
VECTOR_MODE (FLOAT, HF, 64); /* V64HF */
VECTOR_MODE (FLOAT, SF, 64); /* V64SF */
VECTOR_MODE (FLOAT, DF, 64); /* V64DF */
/* Vector units handle reads independently and thus no large alignment
needed. */
ADJUST_ALIGNMENT (V64QI, 1);
ADJUST_ALIGNMENT (V64HI, 2);
ADJUST_ALIGNMENT (V64SI, 4);
ADJUST_ALIGNMENT (V64DI, 8);
ADJUST_ALIGNMENT (V64TI, 16);
ADJUST_ALIGNMENT (V64HF, 2);
ADJUST_ALIGNMENT (V64SF, 4);
ADJUST_ALIGNMENT (V64DF, 8);
/* Copyright (C) 2016-2019 Free Software Foundation, Inc.
This file 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 3 of the License, or (at your option)
any later version.
This file 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef GCN_OPTS_H
#define GCN_OPTS_H
/* Which processor to generate code or schedule for. */
enum processor_type
{
PROCESSOR_CARRIZO,
PROCESSOR_FIJI,
PROCESSOR_VEGA
};
/* Set in gcn_option_override. */
extern int gcn_isa;
#define TARGET_GCN3 (gcn_isa == 3)
#define TARGET_GCN3_PLUS (gcn_isa >= 3)
#define TARGET_GCN5 (gcn_isa == 5)
#define TARGET_GCN5_PLUS (gcn_isa >= 5)
#endif
/* Copyright (C) 2017-2019 Free Software Foundation, Inc.
This file is part of GCC.
GCC 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 3, or (at your option) any later
version.
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
INSERT_PASS_AFTER (pass_omp_target_link, 1, pass_omp_gcn);
/* Copyright (C) 2016-2019 Free Software Foundation, Inc.
This file 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 3 of the License, or (at your option)
any later version.
This file 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#ifndef _GCN_PROTOS_
#define _GCN_PROTOS_
extern void gcn_asm_output_symbol_ref (FILE *file, rtx x);
extern tree gcn_builtin_decl (unsigned code, bool initialize_p);
extern bool gcn_can_split_p (machine_mode, rtx);
extern bool gcn_constant64_p (rtx);
extern bool gcn_constant_p (rtx);
extern rtx gcn_convert_mask_mode (rtx reg);
extern char * gcn_expand_dpp_shr_insn (machine_mode, const char *, int, int);
extern void gcn_expand_epilogue ();
extern rtx gcn_expand_scaled_offsets (addr_space_t as, rtx base, rtx offsets,
rtx scale, bool unsigned_p, rtx exec);
extern void gcn_expand_prologue ();
extern rtx gcn_expand_reduc_scalar (machine_mode, rtx, int);
extern rtx gcn_expand_scalar_to_vector_address (machine_mode, rtx, rtx, rtx);
extern void gcn_expand_vector_init (rtx, rtx);
extern bool gcn_flat_address_p (rtx, machine_mode);
extern bool gcn_fp_constant_p (rtx, bool);
extern rtx gcn_full_exec ();
extern rtx gcn_full_exec_reg ();
extern rtx gcn_gen_undef (machine_mode);
extern bool gcn_global_address_p (rtx);
extern tree gcn_goacc_adjust_propagation_record (tree record_type, bool sender,
const char *name);
extern void gcn_goacc_adjust_gangprivate_decl (tree var);
extern void gcn_goacc_reduction (gcall *call);
extern bool gcn_hard_regno_rename_ok (unsigned int from_reg,
unsigned int to_reg);
extern machine_mode gcn_hard_regno_caller_save_mode (unsigned int regno,
unsigned int nregs,
machine_mode regmode);
extern bool gcn_hard_regno_mode_ok (int regno, machine_mode mode);
extern int gcn_hard_regno_nregs (int regno, machine_mode mode);
extern void gcn_hsa_declare_function_name (FILE *file, const char *name,
tree decl);
extern HOST_WIDE_INT gcn_initial_elimination_offset (int, int);
extern bool gcn_inline_constant64_p (rtx);
extern bool gcn_inline_constant_p (rtx);
extern int gcn_inline_fp_constant_p (rtx, bool);
extern reg_class gcn_mode_code_base_reg_class (machine_mode, addr_space_t,
int, int);
extern rtx gcn_oacc_dim_pos (int dim);
extern rtx gcn_oacc_dim_size (int dim);
extern rtx gcn_operand_doublepart (machine_mode, rtx, int);
extern rtx gcn_operand_part (machine_mode, rtx, int);
extern bool gcn_regno_mode_code_ok_for_base_p (int, machine_mode,
addr_space_t, int, int);
extern reg_class gcn_regno_reg_class (int regno);
extern rtx gcn_scalar_exec ();
extern rtx gcn_scalar_exec_reg ();
extern bool gcn_scalar_flat_address_p (rtx);
extern bool gcn_scalar_flat_mem_p (rtx);
extern bool gcn_sgpr_move_p (rtx, rtx);
extern bool gcn_valid_move_p (machine_mode, rtx, rtx);
extern rtx gcn_vec_constant (machine_mode, int);
extern rtx gcn_vec_constant (machine_mode, rtx);
extern bool gcn_vgpr_move_p (rtx, rtx);
extern void print_operand_address (FILE *file, register rtx addr);
extern void print_operand (FILE *file, rtx x, int code);
extern bool regno_ok_for_index_p (int);
enum gcn_cvt_t
{
fix_trunc_cvt,
fixuns_trunc_cvt,
float_cvt,
floatuns_cvt,
extend_cvt,
trunc_cvt
};
extern bool gcn_valid_cvt_p (machine_mode from, machine_mode to,
enum gcn_cvt_t op);
#ifdef TREE_CODE
extern void gcn_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree,
int);
class gimple_opt_pass;
extern gimple_opt_pass *make_pass_omp_gcn (gcc::context *ctxt);
#endif
/* Return true if MODE is valid for 1 VGPR register. */
inline bool
vgpr_1reg_mode_p (machine_mode mode)
{
return (mode == SImode || mode == SFmode || mode == HImode || mode == QImode
|| mode == V64QImode || mode == V64HImode || mode == V64SImode
|| mode == V64HFmode || mode == V64SFmode || mode == BImode);
}
/* Return true if MODE is valid for 1 SGPR register. */
inline bool
sgpr_1reg_mode_p (machine_mode mode)
{
return (mode == SImode || mode == SFmode || mode == HImode
|| mode == QImode || mode == BImode);
}
/* Return true if MODE is valid for pair of VGPR registers. */
inline bool
vgpr_2reg_mode_p (machine_mode mode)
{
return (mode == DImode || mode == DFmode
|| mode == V64DImode || mode == V64DFmode);
}
/* Return true if MODE can be handled directly by VGPR operations. */
inline bool
vgpr_vector_mode_p (machine_mode mode)
{
return (mode == V64QImode || mode == V64HImode
|| mode == V64SImode || mode == V64DImode
|| mode == V64HFmode || mode == V64SFmode || mode == V64DFmode);
}
/* Return true if MODE is valid for pair of SGPR registers. */
inline bool
sgpr_2reg_mode_p (machine_mode mode)
{
return mode == DImode || mode == DFmode;
}
#endif
This source diff could not be displayed because it is too large. You can view the blob instead.
; Options for the GCN port of the compiler.
; Copyright (C) 2016-2019 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC 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 3, or (at your option) any later
; version.
;
; GCC 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 GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
HeaderInclude
config/gcn/gcn-opts.h
Enum
Name(gpu_type) Type(enum processor_type)
GCN GPU type to use:
EnumValue
Enum(gpu_type) String(carrizo) Value(PROCESSOR_CARRIZO)
EnumValue
Enum(gpu_type) String(fiji) Value(PROCESSOR_FIJI)
EnumValue
Enum(gpu_type) String(gfx900) Value(PROCESSOR_VEGA)
march=
Target RejectNegative Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_CARRIZO)
Specify the name of the target GPU.
mtune=
Target RejectNegative Joined ToLower Enum(gpu_type) Var(gcn_tune) Init(PROCESSOR_CARRIZO)
Specify the name of the target GPU.
m32
Target Report RejectNegative InverseMask(ABI64)
Generate code for a 32-bit ABI.
m64
Target Report RejectNegative Mask(ABI64)
Generate code for a 64-bit ABI.
mgomp
Target Report RejectNegative
Enable OpenMP GPU offloading.
bool flag_bypass_init_error = false
mbypass-init-error
Target Report RejectNegative Var(flag_bypass_init_error)
bool flag_worker_partitioning = false
macc-experimental-workers
Target Report Var(flag_worker_partitioning) Init(1)
int stack_size_opt = -1
mstack-size=
Target Report RejectNegative Joined UInteger Var(stack_size_opt) Init(-1)
-mstack-size=<number> Set the private segment size per wave-front, in bytes.
mlocal-symbol-id=
Target RejectNegative Report JoinedOrMissing Var(local_symbol_id) Init(0)
Wopenacc-dims
Target Var(warn_openacc_dims) Warning
Warn about invalid OpenACC dimensions.
# Copyright (C) 2016-2019 Free Software Foundation, Inc.
#
# This file 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 3 of the License, or (at your option)
# any later version.
#
# This file 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 GCC; see the file COPYING3. If not see
# <http://www.gnu.org/licenses/>.
GTM_H += $(HASH_TABLE_H)
driver-gcn.o: $(srcdir)/config/gcn/driver-gcn.c
$(COMPILE) $<
$(POSTCOMPILE)
CFLAGS-mkoffload.o += $(DRIVER_DEFINES) \
-DGCC_INSTALL_NAME=\"$(GCC_INSTALL_NAME)\"
mkoffload.o: $(srcdir)/config/gcn/mkoffload.c
$(COMPILE) $<
$(POSTCOMPILE)
ALL_HOST_OBJS += mkoffload.o
mkoffload$(exeext): mkoffload.o collect-utils.o libcommon-target.a \
$(LIBIBERTY) $(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
mkoffload.o collect-utils.o libcommon-target.a $(LIBIBERTY) $(LIBS)
CFLAGS-gcn-run.o += -DVERSION_STRING=$(PKGVERSION_s)
COMPILE-gcn-run.o = $(filter-out -fno-rtti,$(COMPILE))
gcn-run.o: $(srcdir)/config/gcn/gcn-run.c
$(COMPILE-gcn-run.o) -x c -std=gnu11 -Wno-error=pedantic $<
$(POSTCOMPILE)
ALL_HOST_OBJS += gcn-run.o
gcn-run$(exeext): gcn-run.o
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $< -ldl
MULTILIB_OPTIONS = march=gfx900
MULTILIB_DIRNAMES = gcn5
PASSES_EXTRA += $(srcdir)/config/gcn/gcn-passes.def
gcn-tree.o: $(srcdir)/config/gcn/gcn-tree.c
$(COMPILE) $<
$(POSTCOMPILE)
ALL_HOST_OBJS += gcn-tree.o
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