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
39f1c624
There was an error fetching the commit references. Please try again later.
Commit
39f1c624
authored
6 years ago
by
ReinUsesLisp
Browse files
Options
Downloads
Patches
Plain Diff
shader_decode: Implement LOP32I
parent
501284a8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/video_core/shader/decode/arithmetic_integer_immediate.cpp
+67
-1
67 additions, 1 deletion
...video_core/shader/decode/arithmetic_integer_immediate.cpp
src/video_core/shader/shader_ir.h
+5
-0
5 additions, 0 deletions
src/video_core/shader/shader_ir.h
with
72 additions
and
1 deletion
src/video_core/shader/decode/arithmetic_integer_immediate.cpp
+
67
−
1
View file @
39f1c624
...
@@ -10,15 +10,81 @@
...
@@ -10,15 +10,81 @@
namespace
VideoCommon
::
Shader
{
namespace
VideoCommon
::
Shader
{
using
Tegra
::
Shader
::
Instruction
;
using
Tegra
::
Shader
::
Instruction
;
using
Tegra
::
Shader
::
LogicOperation
;
using
Tegra
::
Shader
::
OpCode
;
using
Tegra
::
Shader
::
OpCode
;
using
Tegra
::
Shader
::
Pred
;
using
Tegra
::
Shader
::
PredicateResultMode
;
using
Tegra
::
Shader
::
Register
;
u32
ShaderIR
::
DecodeArithmeticIntegerImmediate
(
BasicBlock
&
bb
,
u32
pc
)
{
u32
ShaderIR
::
DecodeArithmeticIntegerImmediate
(
BasicBlock
&
bb
,
u32
pc
)
{
const
Instruction
instr
=
{
program_code
[
pc
]};
const
Instruction
instr
=
{
program_code
[
pc
]};
const
auto
opcode
=
OpCode
::
Decode
(
instr
);
const
auto
opcode
=
OpCode
::
Decode
(
instr
);
UNIMPLEMENTED
();
Node
op_a
=
GetRegister
(
instr
.
gpr8
);
Node
op_b
=
Immediate
(
static_cast
<
s32
>
(
instr
.
alu
.
imm20_32
));
switch
(
opcode
->
get
().
GetId
())
{
case
OpCode
::
Id
::
LOP32I
:
{
UNIMPLEMENTED_IF_MSG
(
instr
.
op_32
.
generates_cc
,
"Condition codes generation in LOP32I is not implemented"
);
if
(
instr
.
alu
.
lop32i
.
invert_a
)
op_a
=
Operation
(
OperationCode
::
IBitwiseNot
,
NO_PRECISE
,
op_a
);
if
(
instr
.
alu
.
lop32i
.
invert_b
)
op_b
=
Operation
(
OperationCode
::
IBitwiseNot
,
NO_PRECISE
,
op_b
);
WriteLogicOperation
(
bb
,
instr
.
gpr0
,
instr
.
alu
.
lop32i
.
operation
,
op_a
,
op_b
,
Tegra
::
Shader
::
PredicateResultMode
::
None
,
Tegra
::
Shader
::
Pred
::
UnusedIndex
);
break
;
}
default
:
UNIMPLEMENTED_MSG
(
"Unhandled ArithmeticIntegerImmediate instruction: {}"
,
opcode
->
get
().
GetName
());
}
return
pc
;
return
pc
;
}
}
void
ShaderIR
::
WriteLogicOperation
(
BasicBlock
&
bb
,
Register
dest
,
LogicOperation
logic_op
,
Node
op_a
,
Node
op_b
,
PredicateResultMode
predicate_mode
,
Pred
predicate
)
{
const
Node
result
=
[
&
]()
{
switch
(
logic_op
)
{
case
LogicOperation
::
And
:
return
Operation
(
OperationCode
::
IBitwiseAnd
,
PRECISE
,
op_a
,
op_b
);
case
LogicOperation
::
Or
:
return
Operation
(
OperationCode
::
IBitwiseOr
,
PRECISE
,
op_a
,
op_b
);
case
LogicOperation
::
Xor
:
return
Operation
(
OperationCode
::
IBitwiseXor
,
PRECISE
,
op_a
,
op_b
);
case
LogicOperation
::
PassB
:
return
op_b
;
default:
UNIMPLEMENTED_MSG
(
"Unimplemented logic operation={}"
,
static_cast
<
u32
>
(
logic_op
));
}
}();
if
(
dest
!=
Register
::
ZeroIndex
)
{
SetRegister
(
bb
,
dest
,
result
);
}
using
Tegra
::
Shader
::
PredicateResultMode
;
// Write the predicate value depending on the predicate mode.
switch
(
predicate_mode
)
{
case
PredicateResultMode
::
None
:
// Do nothing.
return
;
case
PredicateResultMode
::
NotZero
:
{
// Set the predicate to true if the result is not zero.
const
Node
compare
=
Operation
(
OperationCode
::
LogicalIEqual
,
result
,
Immediate
(
0
));
SetPredicate
(
bb
,
static_cast
<
u64
>
(
predicate
),
compare
);
break
;
}
default
:
UNIMPLEMENTED_MSG
(
"Unimplemented predicate result mode: {}"
,
static_cast
<
u32
>
(
predicate_mode
));
}
}
}
// namespace VideoCommon::Shader
}
// namespace VideoCommon::Shader
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/video_core/shader/shader_ir.h
+
5
−
0
View file @
39f1c624
...
@@ -697,6 +697,11 @@ private:
...
@@ -697,6 +697,11 @@ private:
Tegra
::
Shader
::
TextureProcessMode
process_mode
,
bool
depth_compare
,
Tegra
::
Shader
::
TextureProcessMode
process_mode
,
bool
depth_compare
,
bool
is_array
,
std
::
size_t
bias_offset
,
std
::
vector
<
Node
>&&
coords
);
bool
is_array
,
std
::
size_t
bias_offset
,
std
::
vector
<
Node
>&&
coords
);
void
WriteLogicOperation
(
BasicBlock
&
bb
,
Tegra
::
Shader
::
Register
dest
,
Tegra
::
Shader
::
LogicOperation
logic_op
,
Node
op_a
,
Node
op_b
,
Tegra
::
Shader
::
PredicateResultMode
predicate_mode
,
Tegra
::
Shader
::
Pred
predicate
);
template
<
typename
...
T
>
template
<
typename
...
T
>
inline
Node
Operation
(
OperationCode
code
,
const
T
*
...
operands
)
{
inline
Node
Operation
(
OperationCode
code
,
const
T
*
...
operands
)
{
return
StoreNode
(
OperationNode
(
code
,
operands
...));
return
StoreNode
(
OperationNode
(
code
,
operands
...));
...
...
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