Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
87dd8ab0
Commit
87dd8ab0
authored
Jul 15, 2013
by
Marcus Shawcroft
Committed by
Marcus Shawcroft
Jul 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AArch64] -mcmodel=tiny -fPIC GOT support.
From-SVN: r200956
parent
abc2d807
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
1 deletions
+49
-1
gcc/ChangeLog
+12
-0
gcc/config/aarch64/aarch64-protos.h
+12
-0
gcc/config/aarch64/aarch64.c
+14
-1
gcc/config/aarch64/aarch64.md
+11
-0
No files found.
gcc/ChangeLog
View file @
87dd8ab0
2013-07-15 Marcus Shawcroft <marcus.shawcroft@arm.com>
* config/aarch64/aarch64-protos.h (aarch64_symbol_type):
Define SYMBOL_TINY_GOT, update comment.
* config/aarch64/aarch64.c
(aarch64_load_symref_appropriately): Handle SYMBOL_TINY_GOT.
(aarch64_expand_mov_immediate): Likewise.
(aarch64_print_operand): Likewise.
(aarch64_classify_symbol): Likewise.
* config/aarch64/aarch64.md (UNSPEC_GOTTINYPIC): Define.
(ldr_got_tiny): Define.
2013-07-13 Tobias Grosser <tobias@grosser.es>
2013-07-13 Tobias Grosser <tobias@grosser.es>
PR tree-optimization/54094
PR tree-optimization/54094
...
...
gcc/config/aarch64/aarch64-protos.h
View file @
87dd8ab0
...
@@ -75,6 +75,17 @@ enum aarch64_symbol_context
...
@@ -75,6 +75,17 @@ enum aarch64_symbol_context
ADR x0, foo
ADR x0, foo
SYMBOL_TINY_GOT
Generate symbol accesses via the GOT using a single PC relative
instruction. To compute the address of symbol foo, we generate:
ldr t0, :got:foo
The value of foo can subsequently read using:
ldrb t0, [t0]
SYMBOL_FORCE_TO_MEM : Global variables are addressed using
SYMBOL_FORCE_TO_MEM : Global variables are addressed using
constant pool. All variable addresses are spilled into constant
constant pool. All variable addresses are spilled into constant
pools. The constant pools themselves are addressed using PC
pools. The constant pools themselves are addressed using PC
...
@@ -89,6 +100,7 @@ enum aarch64_symbol_type
...
@@ -89,6 +100,7 @@ enum aarch64_symbol_type
SYMBOL_SMALL_GOTTPREL
,
SYMBOL_SMALL_GOTTPREL
,
SYMBOL_SMALL_TPREL
,
SYMBOL_SMALL_TPREL
,
SYMBOL_TINY_ABSOLUTE
,
SYMBOL_TINY_ABSOLUTE
,
SYMBOL_TINY_GOT
,
SYMBOL_FORCE_TO_MEM
SYMBOL_FORCE_TO_MEM
};
};
...
...
gcc/config/aarch64/aarch64.c
View file @
87dd8ab0
...
@@ -613,6 +613,10 @@ aarch64_load_symref_appropriately (rtx dest, rtx imm,
...
@@ -613,6 +613,10 @@ aarch64_load_symref_appropriately (rtx dest, rtx imm,
return
;
return
;
}
}
case
SYMBOL_TINY_GOT
:
emit_insn
(
gen_ldr_got_tiny
(
dest
,
imm
));
return
;
default:
default:
gcc_unreachable
();
gcc_unreachable
();
}
}
...
@@ -890,6 +894,7 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm)
...
@@ -890,6 +894,7 @@ aarch64_expand_mov_immediate (rtx dest, rtx imm)
case
SYMBOL_SMALL_TLSDESC
:
case
SYMBOL_SMALL_TLSDESC
:
case
SYMBOL_SMALL_GOTTPREL
:
case
SYMBOL_SMALL_GOTTPREL
:
case
SYMBOL_SMALL_GOT
:
case
SYMBOL_SMALL_GOT
:
case
SYMBOL_TINY_GOT
:
if
(
offset
!=
const0_rtx
)
if
(
offset
!=
const0_rtx
)
{
{
gcc_assert
(
can_create_pseudo_p
());
gcc_assert
(
can_create_pseudo_p
());
...
@@ -3646,6 +3651,10 @@ aarch64_print_operand (FILE *f, rtx x, char code)
...
@@ -3646,6 +3651,10 @@ aarch64_print_operand (FILE *f, rtx x, char code)
asm_fprintf
(
asm_out_file
,
":tprel:"
);
asm_fprintf
(
asm_out_file
,
":tprel:"
);
break
;
break
;
case
SYMBOL_TINY_GOT
:
gcc_unreachable
();
break
;
default:
default:
break
;
break
;
}
}
...
@@ -3675,6 +3684,10 @@ aarch64_print_operand (FILE *f, rtx x, char code)
...
@@ -3675,6 +3684,10 @@ aarch64_print_operand (FILE *f, rtx x, char code)
asm_fprintf
(
asm_out_file
,
":tprel_lo12_nc:"
);
asm_fprintf
(
asm_out_file
,
":tprel_lo12_nc:"
);
break
;
break
;
case
SYMBOL_TINY_GOT
:
asm_fprintf
(
asm_out_file
,
":got:"
);
break
;
default:
default:
break
;
break
;
}
}
...
@@ -5241,7 +5254,7 @@ aarch64_classify_symbol (rtx x,
...
@@ -5241,7 +5254,7 @@ aarch64_classify_symbol (rtx x,
case
AARCH64_CMODEL_TINY_PIC
:
case
AARCH64_CMODEL_TINY_PIC
:
if
(
!
aarch64_symbol_binds_local_p
(
x
))
if
(
!
aarch64_symbol_binds_local_p
(
x
))
return
SYMBOL_
SMALL
_GOT
;
return
SYMBOL_
TINY
_GOT
;
return
SYMBOL_TINY_ABSOLUTE
;
return
SYMBOL_TINY_ABSOLUTE
;
case
AARCH64_CMODEL_SMALL_PIC
:
case
AARCH64_CMODEL_SMALL_PIC
:
...
...
gcc/config/aarch64/aarch64.md
View file @
87dd8ab0
...
@@ -80,6 +80,7 @@
...
@@ -80,6 +80,7 @@
UNSPEC_FRINTZ
UNSPEC_FRINTZ
UNSPEC_GOTSMALLPIC
UNSPEC_GOTSMALLPIC
UNSPEC_GOTSMALLTLS
UNSPEC_GOTSMALLTLS
UNSPEC_GOTTINYPIC
UNSPEC_LD2
UNSPEC_LD2
UNSPEC_LD3
UNSPEC_LD3
UNSPEC_LD4
UNSPEC_LD4
...
@@ -3751,6 +3752,16 @@
...
@@ -3751,6 +3752,16 @@
(set_attr "mode" "DI")]
(set_attr "mode" "DI")]
)
)
(define_insn "ldr_got_tiny"
[
(set (match_operand:DI 0 "register_operand" "=r")
(unspec:DI
[
(match_operand:DI 1 "aarch64_valid_symref" "S")
]
UNSPEC_GOTTINYPIC))]
""
"ldr
\\
t%0, %L1"
[
(set_attr "v8type" "load1")
(set_attr "mode" "DI")]
)
(define_insn "aarch64_load_tp_hard"
(define_insn "aarch64_load_tp_hard"
[
(set (match_operand:DI 0 "register_operand" "=r")
[
(set (match_operand:DI 0 "register_operand" "=r")
(unspec:DI
[
(const_int 0)
]
UNSPEC_TLS))]
(unspec:DI
[
(const_int 0)
]
UNSPEC_TLS))]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment