Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
Project
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
Chen Yisong
swiftshader
Commits
69e9290c
Commit
69e9290c
authored
Nov 04, 2015
by
David Sehr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Match index adds as well as base
BUG= R=stichnot@chromium.org Review URL:
https://codereview.chromium.org/1421603003
.
parent
4a5e6d05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
IceTargetLoweringX86BaseImpl.h
src/IceTargetLoweringX86BaseImpl.h
+5
-3
No files found.
src/IceTargetLoweringX86BaseImpl.h
View file @
69e9290c
...
@@ -4491,7 +4491,7 @@ inline bool computeAddressOpt(Cfg *Func, const Inst *Instr,
...
@@ -4491,7 +4491,7 @@ inline bool computeAddressOpt(Cfg *Func, const Inst *Instr,
// Assignments of Base from a Relocatable or ConstantInt32 can result
// Assignments of Base from a Relocatable or ConstantInt32 can result
// in Base becoming nullptr. To avoid code duplication in this loop we
// in Base becoming nullptr. To avoid code duplication in this loop we
// prefer that Base be non-nullptr if possible.
// prefer that Base be non-nullptr if possible.
if
((
Base
==
nullptr
)
&&
(
Index
!=
nullptr
)
&&
(
Shift
==
0
)
)
if
((
Base
==
nullptr
)
&&
(
Index
!=
nullptr
)
&&
Shift
==
0
)
std
::
swap
(
Base
,
Index
);
std
::
swap
(
Base
,
Index
);
continue
;
continue
;
}
}
...
@@ -4516,7 +4516,7 @@ inline bool computeAddressOpt(Cfg *Func, const Inst *Instr,
...
@@ -4516,7 +4516,7 @@ inline bool computeAddressOpt(Cfg *Func, const Inst *Instr,
// Shift==0 && Base is Base=Var*Const && log2(Const)+Shift<=3 ==>
// Shift==0 && Base is Base=Var*Const && log2(Const)+Shift<=3 ==>
// swap(Index,Base)
// swap(Index,Base)
// Similar for Base=Const*Var and Base=Var<<Const
// Similar for Base=Const*Var and Base=Var<<Const
if
(
(
Shift
==
0
)
&&
matchShiftedIndex
(
VMetadata
,
Base
,
Shift
,
Reason
))
{
if
(
Shift
==
0
&&
matchShiftedIndex
(
VMetadata
,
Base
,
Shift
,
Reason
))
{
std
::
swap
(
Base
,
Index
);
std
::
swap
(
Base
,
Index
);
continue
;
continue
;
}
}
...
@@ -4524,9 +4524,11 @@ inline bool computeAddressOpt(Cfg *Func, const Inst *Instr,
...
@@ -4524,9 +4524,11 @@ inline bool computeAddressOpt(Cfg *Func, const Inst *Instr,
// Update Offset to reflect additions/subtractions with constants and
// Update Offset to reflect additions/subtractions with constants and
// relocatables.
// relocatables.
// TODO: consider overflow issues with respect to Offset.
// TODO: consider overflow issues with respect to Offset.
// TODO: handle symbolic constants.
if
(
matchOffsetBase
(
VMetadata
,
Base
,
Relocatable
,
Offset
,
Reason
))
if
(
matchOffsetBase
(
VMetadata
,
Base
,
Relocatable
,
Offset
,
Reason
))
continue
;
continue
;
if
(
Shift
==
0
&&
matchOffsetBase
(
VMetadata
,
Index
,
Relocatable
,
Offset
,
Reason
))
continue
;
// TODO(sehr, stichnot): Handle updates of Index with Shift != 0.
// TODO(sehr, stichnot): Handle updates of Index with Shift != 0.
// Index is Index=Var+Const ==>
// Index is Index=Var+Const ==>
// set Index=Var, Offset+=(Const<<Shift)
// set Index=Var, Offset+=(Const<<Shift)
...
...
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