Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arbor
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
arbor-sim
arbor
Commits
0c014d40
Unverified
Commit
0c014d40
authored
2 years ago
by
Thorsten Hater
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Always emit weight expression. (#1875)
parent
993833df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modcc/printer/cprinter.cpp
+8
-25
8 additions, 25 deletions
modcc/printer/cprinter.cpp
with
8 additions
and
25 deletions
modcc/printer/cprinter.cpp
+
8
−
25
View file @
0c014d40
...
...
@@ -962,7 +962,6 @@ void emit_simd_body_for_loop(
void
emit_simd_for_loop_per_constraint
(
std
::
ostream
&
out
,
BlockExpression
*
body
,
const
std
::
vector
<
LocalVariable
*>&
indexed_vars
,
const
std
::
vector
<
VariableExpression
*>&
scalars
,
bool
requires_weight
,
const
std
::
list
<
index_prop
>&
indices
,
const
simd_expr_constraint
&
constraint
,
std
::
string
underlying_constraint_name
)
{
...
...
@@ -972,12 +971,10 @@ void emit_simd_for_loop_per_constraint(std::ostream& out, BlockExpression* body,
" arb_index_type index_ = {0}index_constraints.{1}[i_];
\n
"
,
pp_var_pfx
,
underlying_constraint_name
)
<<
indent
;
if
(
requires_weight
)
{
out
<<
fmt
::
format
(
"simd_value w_;
\n
"
"assign(w_, indirect(({}weight+index_), simd_width_));
\n
"
,
pp_var_pfx
);
}
<<
indent
<<
fmt
::
format
(
"simd_value w_;
\n
"
"assign(w_, indirect(({}weight+index_), simd_width_));
\n
"
,
pp_var_pfx
);
emit_simd_body_for_loop
(
out
,
body
,
indexed_vars
,
scalars
,
indices
,
constraint
);
...
...
@@ -988,22 +985,8 @@ void emit_simd_for_loop_per_constraint(std::ostream& out, BlockExpression* body,
void
emit_simd_api_body
(
std
::
ostream
&
out
,
APIMethod
*
method
,
const
std
::
vector
<
VariableExpression
*>&
scalars
)
{
auto
body
=
method
->
body
();
auto
indexed_vars
=
indexed_locals
(
method
->
scope
());
bool
requires_weight
=
false
;
ENTER
(
out
);
for
(
auto
&
s
:
body
->
is_block
()
->
statements
())
{
if
(
s
->
is_assignment
())
{
for
(
auto
&
v
:
indexed_vars
)
{
if
(
s
->
is_assignment
()
->
lhs
()
->
is_identifier
()
->
name
()
==
v
->
external_variable
()
->
name
())
{
auto
info
=
decode_indexed_variable
(
v
->
external_variable
());
if
(
info
.
accumulate
)
{
requires_weight
=
true
;
}
break
;
}
}
}
}
std
::
list
<
index_prop
>
indices
=
gather_indexed_vars
(
indexed_vars
,
"index_"
);
std
::
vector
<
LocalVariable
*>
scalar_indexed_vars
;
for
(
auto
&
sym
:
indexed_vars
)
{
...
...
@@ -1021,25 +1004,25 @@ void emit_simd_api_body(std::ostream& out, APIMethod* method, const std::vector<
simd_expr_constraint
constraint
=
simd_expr_constraint
::
contiguous
;
std
::
string
underlying_constraint
=
"contiguous"
;
emit_simd_for_loop_per_constraint
(
out
,
body
,
indexed_vars
,
scalars
,
requires_weight
,
indices
,
constraint
,
underlying_constraint
);
emit_simd_for_loop_per_constraint
(
out
,
body
,
indexed_vars
,
scalars
,
indices
,
constraint
,
underlying_constraint
);
//Generate for loop for all independent simd_vectors
constraint
=
simd_expr_constraint
::
other
;
underlying_constraint
=
"independent"
;
emit_simd_for_loop_per_constraint
(
out
,
body
,
indexed_vars
,
scalars
,
requires_weight
,
indices
,
constraint
,
underlying_constraint
);
emit_simd_for_loop_per_constraint
(
out
,
body
,
indexed_vars
,
scalars
,
indices
,
constraint
,
underlying_constraint
);
//Generate for loop for all simd_vectors that have no optimizing constraints
constraint
=
simd_expr_constraint
::
other
;
underlying_constraint
=
"none"
;
emit_simd_for_loop_per_constraint
(
out
,
body
,
indexed_vars
,
scalars
,
requires_weight
,
indices
,
constraint
,
underlying_constraint
);
emit_simd_for_loop_per_constraint
(
out
,
body
,
indexed_vars
,
scalars
,
indices
,
constraint
,
underlying_constraint
);
//Generate for loop for all constant simd_vectors
constraint
=
simd_expr_constraint
::
constant
;
underlying_constraint
=
"constant"
;
emit_simd_for_loop_per_constraint
(
out
,
body
,
indexed_vars
,
scalars
,
requires_weight
,
indices
,
constraint
,
underlying_constraint
);
emit_simd_for_loop_per_constraint
(
out
,
body
,
indexed_vars
,
scalars
,
indices
,
constraint
,
underlying_constraint
);
}
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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