Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/riscv/pic.md @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ;; PIC codegen for RISC-V for GNU compiler. | |
2 ;; Copyright (C) 2011-2017 Free Software Foundation, Inc. | |
3 ;; Contributed by Andrew Waterman (andrew@sifive.com). | |
4 | |
5 ;; This file is part of GCC. | |
6 | |
7 ;; GCC is free software; you can redistribute it and/or modify | |
8 ;; it under the terms of the GNU General Public License as published by | |
9 ;; the Free Software Foundation; either version 3, or (at your option) | |
10 ;; any later version. | |
11 | |
12 ;; GCC is distributed in the hope that it will be useful, | |
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 ;; GNU General Public License for more details. | |
16 | |
17 ;; You should have received a copy of the GNU General Public License | |
18 ;; along with GCC; see the file COPYING3. If not see | |
19 ;; <http://www.gnu.org/licenses/>. | |
20 | |
21 | |
22 ;; Simplify PIC loads to static variables. | |
23 ;; These should go away once we figure out how to emit auipc discretely. | |
24 | |
25 (define_insn "*local_pic_load_s<mode>" | |
26 [(set (match_operand:ANYI 0 "register_operand" "=r") | |
27 (sign_extend:ANYI (mem:ANYI (match_operand 1 "absolute_symbolic_operand" ""))))] | |
28 "USE_LOAD_ADDRESS_MACRO (operands[1])" | |
29 "<load>\t%0,%1" | |
30 [(set (attr "length") (const_int 8))]) | |
31 | |
32 (define_insn "*local_pic_load_u<mode>" | |
33 [(set (match_operand:ZERO_EXTEND_LOAD 0 "register_operand" "=r") | |
34 (zero_extend:ZERO_EXTEND_LOAD (mem:ZERO_EXTEND_LOAD (match_operand 1 "absolute_symbolic_operand" ""))))] | |
35 "USE_LOAD_ADDRESS_MACRO (operands[1])" | |
36 "<load>u\t%0,%1" | |
37 [(set (attr "length") (const_int 8))]) | |
38 | |
39 (define_insn "*local_pic_load<mode>" | |
40 [(set (match_operand:ANYF 0 "register_operand" "=f") | |
41 (mem:ANYF (match_operand 1 "absolute_symbolic_operand" ""))) | |
42 (clobber (match_scratch:DI 2 "=r"))] | |
43 "TARGET_HARD_FLOAT && TARGET_64BIT && USE_LOAD_ADDRESS_MACRO (operands[1])" | |
44 "<load>\t%0,%1,%2" | |
45 [(set (attr "length") (const_int 8))]) | |
46 | |
47 (define_insn "*local_pic_load<mode>" | |
48 [(set (match_operand:ANYF 0 "register_operand" "=f") | |
49 (mem:ANYF (match_operand 1 "absolute_symbolic_operand" ""))) | |
50 (clobber (match_scratch:SI 2 "=r"))] | |
51 "TARGET_HARD_FLOAT && !TARGET_64BIT && USE_LOAD_ADDRESS_MACRO (operands[1])" | |
52 "<load>\t%0,%1,%2" | |
53 [(set (attr "length") (const_int 8))]) | |
54 | |
55 (define_insn "*local_pic_loadu<mode>" | |
56 [(set (match_operand:SUPERQI 0 "register_operand" "=r") | |
57 (zero_extend:SUPERQI (mem:SUBX (match_operand 1 "absolute_symbolic_operand" ""))))] | |
58 "USE_LOAD_ADDRESS_MACRO (operands[1])" | |
59 "<load>u\t%0,%1" | |
60 [(set (attr "length") (const_int 8))]) | |
61 | |
62 (define_insn "*local_pic_storedi<mode>" | |
63 [(set (mem:ANYI (match_operand 0 "absolute_symbolic_operand" "")) | |
64 (match_operand:ANYI 1 "reg_or_0_operand" "rJ")) | |
65 (clobber (match_scratch:DI 2 "=&r"))] | |
66 "TARGET_64BIT && USE_LOAD_ADDRESS_MACRO (operands[0])" | |
67 "<store>\t%z1,%0,%2" | |
68 [(set (attr "length") (const_int 8))]) | |
69 | |
70 (define_insn "*local_pic_storesi<mode>" | |
71 [(set (mem:ANYI (match_operand 0 "absolute_symbolic_operand" "")) | |
72 (match_operand:ANYI 1 "reg_or_0_operand" "rJ")) | |
73 (clobber (match_scratch:SI 2 "=&r"))] | |
74 "!TARGET_64BIT && USE_LOAD_ADDRESS_MACRO (operands[0])" | |
75 "<store>\t%z1,%0,%2" | |
76 [(set (attr "length") (const_int 8))]) | |
77 | |
78 (define_insn "*local_pic_storedi<mode>" | |
79 [(set (mem:ANYF (match_operand 0 "absolute_symbolic_operand" "")) | |
80 (match_operand:ANYF 1 "register_operand" "f")) | |
81 (clobber (match_scratch:DI 2 "=r"))] | |
82 "TARGET_HARD_FLOAT && TARGET_64BIT && USE_LOAD_ADDRESS_MACRO (operands[0])" | |
83 "<store>\t%1,%0,%2" | |
84 [(set (attr "length") (const_int 8))]) | |
85 | |
86 (define_insn "*local_pic_storesi<mode>" | |
87 [(set (mem:ANYF (match_operand 0 "absolute_symbolic_operand" "")) | |
88 (match_operand:ANYF 1 "register_operand" "f")) | |
89 (clobber (match_scratch:SI 2 "=r"))] | |
90 "TARGET_HARD_FLOAT && !TARGET_64BIT && USE_LOAD_ADDRESS_MACRO (operands[0])" | |
91 "<store>\t%1,%0,%2" | |
92 [(set (attr "length") (const_int 8))]) |