diff options
author | Nathan Sidwell <nathan@acm.org> | 2015-12-23 16:55:31 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2015-12-23 16:55:31 +0000 |
commit | bd602b7fcb5fdd849e1054cb5a49c47e7dd382ee (patch) | |
tree | c60fae122dd9efb7d91034d5bfe778c6d1635f69 /gcc/config | |
parent | 44a55c645fdcfce7fd0cd387f9a4e1b2dc34d699 (diff) | |
download | gcc-bd602b7fcb5fdd849e1054cb5a49c47e7dd382ee.zip gcc-bd602b7fcb5fdd849e1054cb5a49c47e7dd382ee.tar.gz gcc-bd602b7fcb5fdd849e1054cb5a49c47e7dd382ee.tar.bz2 |
* config/nvptx/nvptx-protos.h
(nvptx_maybe_convert_symbolic_operand): Delete prototype.
* config/nvptx/nvptx.c (nvptx_maybe_convert_symbolic_operand): Delete.
(nvptx_output_mov_insn): Record fnsym here.
(nvptx_wpropagate): Don't create UNSPEC_TO_GENERIC unspec.
* config/nvptx/nvptx.md (UNSPEC_TO_GENERIC): Delete.
(symbolic_operand): Delete predicate.
(nvptx_nonimmediate_operand): Delete predicate.
(mov<mode>): Hard regs are perfectly ok here.
(convaddr_<mode>): Delete.
From-SVN: r231930
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/nvptx/nvptx-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.c | 38 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.md | 36 |
3 files changed, 11 insertions, 64 deletions
diff --git a/gcc/config/nvptx/nvptx-protos.h b/gcc/config/nvptx/nvptx-protos.h index 084ff8e..d399877 100644 --- a/gcc/config/nvptx/nvptx-protos.h +++ b/gcc/config/nvptx/nvptx-protos.h @@ -41,6 +41,5 @@ extern const char *nvptx_ptx_type_from_mode (machine_mode, bool); extern const char *nvptx_output_mov_insn (rtx, rtx); extern const char *nvptx_output_call_insn (rtx_insn *, rtx, rtx); extern const char *nvptx_output_return (void); -extern rtx nvptx_maybe_convert_symbolic_operand (rtx); #endif #endif diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index 7405d7c..432e246 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -1413,31 +1413,6 @@ nvptx_gen_wcast (rtx reg, propagate_mask pm, unsigned rep, wcast_data_t *data) } return res; } - -/* When loading an operand ORIG_OP, verify whether an address space - conversion to generic is required, and if so, perform it. Check - for SYMBOL_REFs and record them if needed. Return either the - original operand, or the converted one. */ - -rtx -nvptx_maybe_convert_symbolic_operand (rtx op) -{ - if (GET_MODE (op) != Pmode) - return op; - - rtx sym = op; - if (GET_CODE (sym) == CONST) - sym = XEXP (sym, 0); - if (GET_CODE (sym) == PLUS) - sym = XEXP (sym, 0); - - if (GET_CODE (sym) != SYMBOL_REF) - return op; - - nvptx_maybe_record_fnsym (sym); - - return op; -} /* Returns true if X is a valid address for use in a memory reference. */ @@ -1767,9 +1742,12 @@ nvptx_output_mov_insn (rtx dst, rtx src) rtx sym = src; if (GET_CODE (sym) == CONST) sym = XEXP (XEXP (sym, 0), 0); - if (SYMBOL_REF_P (sym) - && SYMBOL_DATA_AREA (sym) != DATA_AREA_GENERIC) - return "%.\tcvta%D1%t0\t%0, %1;"; + if (SYMBOL_REF_P (sym)) + { + if (SYMBOL_DATA_AREA (sym) != DATA_AREA_GENERIC) + return "%.\tcvta%D1%t0\t%0, %1;"; + nvptx_maybe_record_fnsym (sym); + } if (src_inner == dst_inner) return "%.\tmov%t0\t%0, %1;"; @@ -3359,9 +3337,7 @@ nvptx_wpropagate (bool pre_p, basic_block block, rtx_insn *insn) if (data.offset) { /* Stuff was emitted, initialize the base pointer now. */ - rtx init = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, worker_bcast_sym), - UNSPEC_TO_GENERIC); - init = gen_rtx_SET (data.base, init); + rtx init = gen_rtx_SET (data.base, worker_bcast_sym); emit_insn_after (init, insn); if (worker_bcast_size < data.offset) diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md index 93083a8..182371c 100644 --- a/gcc/config/nvptx/nvptx.md +++ b/gcc/config/nvptx/nvptx.md @@ -20,7 +20,6 @@ (define_c_enum "unspec" [ UNSPEC_ARG_REG - UNSPEC_TO_GENERIC UNSPEC_COPYSIGN UNSPEC_LOG2 @@ -61,6 +60,9 @@ (define_attr "subregs_ok" "false,true" (const_string "false")) +;; The nvptx operand predicates, in general, don't permit subregs and +;; only literal constants, which differ from the generic ones, which +;; permit subregs and symbolc constants (as appropriate) (define_predicate "nvptx_register_operand" (match_code "reg") { @@ -74,12 +76,6 @@ : memory_operand (op, mode)); }) -;; Allow symbolic constants. -(define_predicate "symbolic_operand" - (match_code "symbol_ref,const")) - -;; Registers or constants for normal instructions. Does not allow symbolic -;; constants. (define_predicate "nvptx_nonmemory_operand" (match_code "reg,const_int,const_double") { @@ -87,16 +83,6 @@ : immediate_operand (op, mode)); }) -(define_predicate "nvptx_nonimmediate_operand" - (match_code "reg,subreg,mem") -{ - if (REG_P (op)) - return (op != frame_pointer_rtx - && op != arg_pointer_rtx - && op != stack_pointer_rtx); - return nonimmediate_operand (op, mode); -}) - (define_predicate "const0_operand" (and (match_code "const_int") (match_test "op == const0_rtx"))) @@ -240,13 +226,7 @@ (match_operand:QHSDISDFM 1 "general_operand" ""))] "" { - operands[1] = nvptx_maybe_convert_symbolic_operand (operands[1]); - - /* Hard registers are often actually symbolic operands on this target. - Don't allow them when storing to memory. */ - if (MEM_P (operands[0]) - && (!REG_P (operands[1]) - || REGNO (operands[1]) <= LAST_VIRTUAL_REGISTER)) + if (MEM_P (operands[0]) && !REG_P (operands[1])) { rtx tmp = gen_reg_rtx (<MODE>mode); emit_move_insn (tmp, operands[1]); @@ -327,14 +307,6 @@ %.\\tst%A0.u%T0\\t%0, %1;" [(set_attr "subregs_ok" "true")]) -;; Pointer address space conversion -(define_insn "convaddr_<mode>" - [(set (match_operand:P 0 "nvptx_register_operand" "=R") - (unspec:P [(match_operand:P 1 "symbolic_operand" "s")] - UNSPEC_TO_GENERIC))] - "" - "%.\\tcvta%D1%t0\\t%0, %1;") - ;; Integer arithmetic (define_insn "add<mode>3" |