Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
llvm-epi
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Roger Ferrer
llvm-epi
Commits
c4aa60ff
Commit
c4aa60ff
authored
13 years ago
by
Jim Grosbach
Browse files
Options
Downloads
Patches
Plain Diff
ARM branch relaxation for unconditional t1 branches.
rdar://11059157
llvm-svn: 153055
parent
67e76bab
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+11
-0
11 additions, 0 deletions
llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
with
11 additions
and
0 deletions
llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
+
11
−
0
View file @
c4aa60ff
...
...
@@ -167,6 +167,7 @@ static unsigned getRelaxedOpcode(unsigned Op) {
case
ARM
::
tBcc
:
return
ARM
::
t2Bcc
;
case
ARM
::
tLDRpciASM
:
return
ARM
::
t2LDRpci
;
case
ARM
::
tADR
:
return
ARM
::
t2ADR
;
case
ARM
::
tB
:
return
ARM
::
t2B
;
}
}
...
...
@@ -181,6 +182,16 @@ bool ARMAsmBackend::fixupNeedsRelaxation(const MCFixup &Fixup,
const
MCInstFragment
*
DF
,
const
MCAsmLayout
&
Layout
)
const
{
switch
((
unsigned
)
Fixup
.
getKind
())
{
case
ARM
::
fixup_arm_thumb_br
:
{
// Relaxing tB to t2B. tB has a signed 12-bit displacement with the
// low bit being an implied zero. There's an implied +4 offset for the
// branch, so we adjust the other way here to determine what's
// encodable.
//
// Relax if the value is too big for a (signed) i8.
int64_t
Offset
=
int64_t
(
Value
)
-
4
;
return
Offset
>
2046
||
Offset
<
-
2048
;
}
case
ARM
::
fixup_arm_thumb_bcc
:
{
// Relaxing tBcc to t2Bcc. tBcc has a signed 9-bit displacement with the
// low bit being an implied zero. There's an implied +4 offset for the
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment