Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
e444a655
There was an error fetching the commit references. Please try again later.
Commit
e444a655
authored
6 years ago
by
ReinUsesLisp
Browse files
Options
Downloads
Patches
Plain Diff
shader_decode: Implement FSET
parent
3052eae2
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
src/video_core/shader/decode/float_set.cpp
+36
-1
36 additions, 1 deletion
src/video_core/shader/decode/float_set.cpp
with
36 additions
and
1 deletion
src/video_core/shader/decode/float_set.cpp
+
36
−
1
View file @
e444a655
...
...
@@ -16,7 +16,42 @@ u32 ShaderIR::DecodeFloatSet(BasicBlock& bb, u32 pc) {
const
Instruction
instr
=
{
program_code
[
pc
]};
const
auto
opcode
=
OpCode
::
Decode
(
instr
);
UNIMPLEMENTED
();
const
Node
op_a
=
GetOperandAbsNegFloat
(
GetRegister
(
instr
.
gpr8
),
instr
.
fset
.
abs_a
!=
0
,
instr
.
fset
.
neg_a
!=
0
);
Node
op_b
=
[
&
]()
{
if
(
instr
.
is_b_imm
)
{
return
GetImmediate19
(
instr
);
}
else
if
(
instr
.
is_b_gpr
)
{
return
GetRegister
(
instr
.
gpr20
);
}
else
{
return
GetConstBuffer
(
instr
.
cbuf34
.
index
,
instr
.
cbuf34
.
offset
);
}
}();
op_b
=
GetOperandAbsNegFloat
(
op_b
,
instr
.
fset
.
abs_b
!=
0
,
instr
.
fset
.
neg_b
!=
0
);
// The fset instruction sets a register to 1.0 or -1 (depending on the bf bit) if the
// condition is true, and to 0 otherwise.
const
Node
second_pred
=
GetPredicate
(
instr
.
fset
.
pred39
,
instr
.
fset
.
neg_pred
!=
0
);
const
OperationCode
combiner
=
GetPredicateCombiner
(
instr
.
fset
.
op
);
const
Node
first_pred
=
GetPredicateComparisonFloat
(
instr
.
fset
.
cond
,
op_a
,
op_b
);
const
Node
predicate
=
Operation
(
combiner
,
first_pred
,
second_pred
);
const
Node
true_value
=
instr
.
fset
.
bf
?
Immediate
(
1.0
f
)
:
Immediate
(
-
1
);
const
Node
false_value
=
instr
.
fset
.
bf
?
Immediate
(
0.0
f
)
:
Immediate
(
0
);
const
Node
value
=
Operation
(
OperationCode
::
Select
,
PRECISE
,
predicate
,
true_value
,
false_value
);
SetRegister
(
bb
,
instr
.
gpr0
,
value
);
if
(
instr
.
generates_cc
.
Value
()
!=
0
)
{
const
Node
is_zero
=
Operation
(
OperationCode
::
LogicalFEqual
,
predicate
,
Immediate
(
0.0
f
));
SetInternalFlag
(
bb
,
InternalFlag
::
Zero
,
is_zero
);
LOG_WARNING
(
HW_GPU
,
"FSET condition code is incomplete"
);
}
return
pc
;
}
...
...
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