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
e10b11a5
There was an error fetching the commit references. Please try again later.
Commit
e10b11a5
authored
8 years ago
by
Yuri Kunde Schlesner
Browse files
Options
Downloads
Patches
Plain Diff
video_core/shader: Document sanitized MUL operation
parent
443bb3d5
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/shader_jit_x64_compiler.cpp
+8
-0
8 additions, 0 deletions
src/video_core/shader/shader_jit_x64_compiler.cpp
with
8 additions
and
0 deletions
src/video_core/shader/shader_jit_x64_compiler.cpp
+
8
−
0
View file @
e10b11a5
...
...
@@ -295,14 +295,22 @@ void JitShader::Compile_DestEnable(Instruction instr, Xmm src) {
}
void
JitShader
::
Compile_SanitizedMul
(
Xmm
src1
,
Xmm
src2
,
Xmm
scratch
)
{
// 0 * inf and inf * 0 in the PICA should return 0 instead of NaN. This can be implemented by
// checking for NaNs before and after the multiplication. If the multiplication result is NaN
// where neither source was, this NaN was generated by a 0 * inf multiplication, and so the
// result should be transformed to 0 to match PICA fp rules.
// Set scratch to mask of (src1 != NaN and src2 != NaN)
movaps
(
scratch
,
src1
);
cmpordps
(
scratch
,
src2
);
mulps
(
src1
,
src2
);
// Set src2 to mask of (result == NaN)
movaps
(
src2
,
src1
);
cmpunordps
(
src2
,
src2
);
// Clear components where scratch != src2 (i.e. if result is NaN where neither source was NaN)
xorps
(
scratch
,
src2
);
andps
(
src1
,
scratch
);
}
...
...
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