Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6c92d78c
Commit
6c92d78c
authored
Jul 18, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
Jul 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Parse relational operators, stub out more rules.
parent
57a7479f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
164 additions
and
0 deletions
+164
-0
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+12
-0
hlsl.y
dlls/d3dcompiler_43/hlsl.y
+74
-0
utils.c
dlls/d3dcompiler_43/utils.c
+78
-0
No files found.
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
6c92d78c
...
...
@@ -984,6 +984,18 @@ struct hlsl_ir_expr *hlsl_add(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2
struct
source_location
*
loc
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_expr
*
hlsl_sub
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_expr
*
hlsl_lt
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_expr
*
hlsl_gt
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_expr
*
hlsl_le
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_expr
*
hlsl_ge
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_expr
*
hlsl_eq
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_expr
*
hlsl_ne
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
DECLSPEC_HIDDEN
;
struct
hlsl_ir_deref
*
new_var_deref
(
struct
hlsl_ir_var
*
var
)
DECLSPEC_HIDDEN
;
void
push_scope
(
struct
hlsl_parse_ctx
*
ctx
)
DECLSPEC_HIDDEN
;
BOOL
pop_scope
(
struct
hlsl_parse_ctx
*
ctx
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3dcompiler_43/hlsl.y
View file @
6c92d78c
...
...
@@ -1012,46 +1012,120 @@ shift_expr: add_expr
{
$$ = $1;
}
| shift_expr OP_LEFTSHIFT add_expr
{
FIXME("Left shift\n");
}
| shift_expr OP_RIGHTSHIFT add_expr
{
FIXME("Right shift\n");
}
relational_expr: shift_expr
{
$$ = $1;
}
| relational_expr '<' shift_expr
{
struct source_location loc;
set_location(&loc, &@2);
$$ = &hlsl_lt($1, $3, &loc)->node;
}
| relational_expr '>' shift_expr
{
struct source_location loc;
set_location(&loc, &@2);
$$ = &hlsl_gt($1, $3, &loc)->node;
}
| relational_expr OP_LE shift_expr
{
struct source_location loc;
set_location(&loc, &@2);
$$ = &hlsl_le($1, $3, &loc)->node;
}
| relational_expr OP_GE shift_expr
{
struct source_location loc;
set_location(&loc, &@2);
$$ = &hlsl_ge($1, $3, &loc)->node;
}
equality_expr: relational_expr
{
$$ = $1;
}
| equality_expr OP_EQ relational_expr
{
struct source_location loc;
set_location(&loc, &@2);
$$ = &hlsl_eq($1, $3, &loc)->node;
}
| equality_expr OP_NE relational_expr
{
struct source_location loc;
set_location(&loc, &@2);
$$ = &hlsl_ne($1, $3, &loc)->node;
}
bitand_expr: equality_expr
{
$$ = $1;
}
| bitand_expr '&' equality_expr
{
FIXME("bitwise AND\n");
}
bitxor_expr: bitand_expr
{
$$ = $1;
}
| bitxor_expr '^' bitand_expr
{
FIXME("bitwise XOR\n");
}
bitor_expr: bitxor_expr
{
$$ = $1;
}
| bitor_expr '|' bitxor_expr
{
FIXME("bitwise OR\n");
}
logicand_expr: bitor_expr
{
$$ = $1;
}
| logicand_expr OP_AND bitor_expr
{
FIXME("logic AND\n");
}
logicor_expr: logicand_expr
{
$$ = $1;
}
| logicor_expr OP_OR logicand_expr
{
FIXME("logic OR\n");
}
conditional_expr: logicor_expr
{
$$ = $1;
}
| logicor_expr '?' expr ':' assignment_expr
{
FIXME("ternary operator\n");
}
assignment_expr: conditional_expr
{
...
...
dlls/d3dcompiler_43/utils.c
View file @
6c92d78c
...
...
@@ -1246,6 +1246,84 @@ struct hlsl_ir_expr *hlsl_sub(struct hlsl_ir_node *op1, struct hlsl_ir_node *op2
return
expr
;
}
struct
hlsl_ir_expr
*
hlsl_lt
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
{
struct
hlsl_ir_expr
*
expr
;
struct
hlsl_ir_node
*
ops
[
3
];
ops
[
0
]
=
op1
;
ops
[
1
]
=
op2
;
ops
[
2
]
=
NULL
;
expr
=
new_expr
(
HLSL_IR_BINOP_LESS
,
ops
,
loc
);
return
expr
;
}
struct
hlsl_ir_expr
*
hlsl_gt
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
{
struct
hlsl_ir_expr
*
expr
;
struct
hlsl_ir_node
*
ops
[
3
];
ops
[
0
]
=
op1
;
ops
[
1
]
=
op2
;
ops
[
2
]
=
NULL
;
expr
=
new_expr
(
HLSL_IR_BINOP_GREATER
,
ops
,
loc
);
return
expr
;
}
struct
hlsl_ir_expr
*
hlsl_le
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
{
struct
hlsl_ir_expr
*
expr
;
struct
hlsl_ir_node
*
ops
[
3
];
ops
[
0
]
=
op1
;
ops
[
1
]
=
op2
;
ops
[
2
]
=
NULL
;
expr
=
new_expr
(
HLSL_IR_BINOP_LEQUAL
,
ops
,
loc
);
return
expr
;
}
struct
hlsl_ir_expr
*
hlsl_ge
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
{
struct
hlsl_ir_expr
*
expr
;
struct
hlsl_ir_node
*
ops
[
3
];
ops
[
0
]
=
op1
;
ops
[
1
]
=
op2
;
ops
[
2
]
=
NULL
;
expr
=
new_expr
(
HLSL_IR_BINOP_GEQUAL
,
ops
,
loc
);
return
expr
;
}
struct
hlsl_ir_expr
*
hlsl_eq
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
{
struct
hlsl_ir_expr
*
expr
;
struct
hlsl_ir_node
*
ops
[
3
];
ops
[
0
]
=
op1
;
ops
[
1
]
=
op2
;
ops
[
2
]
=
NULL
;
expr
=
new_expr
(
HLSL_IR_BINOP_EQUAL
,
ops
,
loc
);
return
expr
;
}
struct
hlsl_ir_expr
*
hlsl_ne
(
struct
hlsl_ir_node
*
op1
,
struct
hlsl_ir_node
*
op2
,
struct
source_location
*
loc
)
{
struct
hlsl_ir_expr
*
expr
;
struct
hlsl_ir_node
*
ops
[
3
];
ops
[
0
]
=
op1
;
ops
[
1
]
=
op2
;
ops
[
2
]
=
NULL
;
expr
=
new_expr
(
HLSL_IR_BINOP_NEQUAL
,
ops
,
loc
);
return
expr
;
}
struct
hlsl_ir_deref
*
new_var_deref
(
struct
hlsl_ir_var
*
var
)
{
struct
hlsl_ir_deref
*
deref
=
d3dcompiler_alloc
(
sizeof
(
*
deref
));
...
...
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