Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
13050d08
Commit
13050d08
authored
Mar 22, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement operator<
parent
6f991a1a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
112 additions
and
33 deletions
+112
-33
comparison.hpp
src/kyut/comparison.hpp
+112
-33
No files found.
src/kyut/comparison.hpp
View file @
13050d08
...
...
@@ -58,17 +58,13 @@ namespace wasm {
if
(
std
::
tie
(
l
.
type
,
*
l
.
condition
,
*
l
.
ifTrue
)
<
std
::
tie
(
r
.
type
,
*
r
.
condition
,
*
r
.
ifTrue
))
{
return
true
;
}
if
(
std
::
tie
(
r
.
type
,
*
r
.
condition
,
*
r
.
ifTrue
)
<
std
::
tie
(
l
.
type
,
*
l
.
condition
,
*
l
.
ifTrue
))
{
}
else
if
(
std
::
tie
(
r
.
type
,
*
r
.
condition
,
*
r
.
ifTrue
)
<
std
::
tie
(
l
.
type
,
*
l
.
condition
,
*
l
.
ifTrue
))
{
return
false
;
}
if
(
r
.
ifFalse
==
nullptr
)
{
return
false
;
}
if
(
l
.
ifFalse
==
nullptr
)
{
}
else
if
(
l
.
ifFalse
==
nullptr
)
{
return
true
;
}
...
...
@@ -81,11 +77,63 @@ namespace wasm {
return
std
::
tie
(
l
.
type
,
*
l
.
body
)
<
std
::
tie
(
r
.
type
,
*
r
.
body
);
}
case
Expression
:
:
Id
::
BreakId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
BreakId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
Break
>
();
const
auto
&
r
=
*
rhs
.
cast
<
Break
>
();
if
(
l
.
type
!=
r
.
type
)
{
return
l
.
type
<
r
.
type
;
}
if
(
l
.
value
!=
nullptr
&&
r
.
value
==
nullptr
)
{
return
false
;
}
else
if
(
l
.
value
==
nullptr
&&
r
.
value
!=
nullptr
)
{
return
true
;
}
else
if
(
l
.
value
!=
nullptr
&&
r
.
value
!=
nullptr
)
{
if
(
*
l
.
value
<
*
r
.
value
)
{
return
true
;
}
else
if
(
*
r
.
value
<
*
l
.
value
)
{
return
false
;
}
}
if
(
l
.
condition
!=
nullptr
&&
r
.
condition
==
nullptr
)
{
return
false
;
}
else
if
(
l
.
condition
==
nullptr
&&
r
.
condition
!=
nullptr
)
{
return
true
;
}
else
if
(
l
.
condition
!=
nullptr
&&
r
.
condition
!=
nullptr
)
{
return
std
::
tie
(
*
l
.
condition
,
l
.
name
)
<
std
::
tie
(
*
r
.
condition
,
r
.
name
);
}
case
Expression
:
:
Id
::
SwitchId
:
WASM_UNREACHABLE
();
// TODO:
return
l
.
name
<
r
.
name
;
}
case
Expression
:
:
Id
::
SwitchId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
Switch
>
();
const
auto
&
r
=
*
rhs
.
cast
<
Switch
>
();
if
(
l
.
type
!=
r
.
type
)
{
return
l
.
type
<
r
.
type
;
}
if
(
*
l
.
condition
<
*
r
.
condition
)
{
return
true
;
}
else
if
(
*
r
.
condition
<
*
l
.
condition
)
{
return
false
;
}
if
(
l
.
value
==
nullptr
&&
r
.
value
==
nullptr
)
{
return
l
.
default_
<
r
.
default_
;
}
if
(
l
.
value
==
nullptr
)
{
return
true
;
}
else
if
(
r
.
value
==
nullptr
)
{
return
false
;
}
return
std
::
tie
(
l
.
default_
,
*
l
.
value
)
<
std
::
tie
(
r
.
default_
,
*
r
.
value
);
}
case
Expression
:
:
Id
::
CallId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
Call
>
();
...
...
@@ -178,17 +226,19 @@ namespace wasm {
if
(
r
.
value
==
nullptr
)
{
return
false
;
}
if
(
l
.
value
==
nullptr
)
{
}
else
if
(
l
.
value
==
nullptr
)
{
return
true
;
}
return
*
l
.
value
<
*
r
.
value
;
}
case
Expression
:
:
Id
::
HostId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
HostId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
Host
>
();
const
auto
&
r
=
*
rhs
.
cast
<
Host
>
();
return
std
::
tie
(
l
.
type
,
l
.
op
,
l
.
operands
,
l
.
nameOperand
)
<
std
::
tie
(
r
.
type
,
r
.
op
,
r
.
operands
,
r
.
nameOperand
);
}
case
Expression
:
:
Id
::
AtomicRMWId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
AtomicRMW
>
();
...
...
@@ -217,32 +267,61 @@ namespace wasm {
return
std
::
tie
(
l
.
type
,
l
.
offset
,
*
l
.
ptr
,
*
l
.
wakeCount
)
<
std
::
tie
(
r
.
type
,
r
.
offset
,
*
r
.
ptr
,
*
r
.
wakeCount
);
}
case
Expression
:
:
Id
::
SIMDExtractId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
SIMDExtractId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
SIMDExtract
>
();
const
auto
&
r
=
*
rhs
.
cast
<
SIMDExtract
>
();
return
std
::
tie
(
l
.
type
,
l
.
op
,
*
l
.
vec
,
l
.
index
)
<
std
::
tie
(
r
.
type
,
r
.
op
,
*
r
.
vec
,
r
.
index
);
}
case
Expression
:
:
Id
::
SIMDReplaceId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
SIMDReplaceId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
SIMDReplace
>
();
const
auto
&
r
=
*
rhs
.
cast
<
SIMDReplace
>
();
return
std
::
tie
(
l
.
type
,
l
.
op
,
*
l
.
vec
,
l
.
index
,
*
l
.
value
)
<
std
::
tie
(
r
.
type
,
r
.
op
,
*
r
.
vec
,
r
.
index
,
*
r
.
value
);
}
case
Expression
:
:
Id
::
SIMDShuffleId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
SIMDShuffleId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
SIMDShuffle
>
();
const
auto
&
r
=
*
rhs
.
cast
<
SIMDShuffle
>
();
return
std
::
tie
(
l
.
type
,
*
l
.
left
,
*
l
.
right
,
l
.
mask
)
<
std
::
tie
(
r
.
type
,
*
r
.
left
,
*
r
.
right
,
r
.
mask
);
}
case
Expression
:
:
Id
::
SIMDBitselectId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
SIMDBitselectId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
SIMDBitselect
>
();
const
auto
&
r
=
*
rhs
.
cast
<
SIMDBitselect
>
();
return
std
::
tie
(
l
.
type
,
*
l
.
left
,
*
l
.
right
,
*
l
.
cond
)
<
std
::
tie
(
r
.
type
,
*
r
.
left
,
*
r
.
right
,
*
r
.
cond
);
}
case
Expression
:
:
Id
::
SIMDShiftId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
SIMDShiftId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
SIMDShift
>
();
const
auto
&
r
=
*
rhs
.
cast
<
SIMDShift
>
();
return
std
::
tie
(
l
.
type
,
l
.
op
,
*
l
.
vec
,
*
l
.
shift
)
<
std
::
tie
(
r
.
type
,
r
.
op
,
*
r
.
vec
,
*
r
.
shift
);
}
case
Expression
:
:
Id
::
MemoryInitId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
MemoryInitId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
MemoryInit
>
();
const
auto
&
r
=
*
rhs
.
cast
<
MemoryInit
>
();
return
std
::
tie
(
l
.
type
,
l
.
segment
,
*
l
.
dest
,
*
l
.
offset
,
*
l
.
size
)
<
std
::
tie
(
r
.
type
,
r
.
segment
,
*
r
.
dest
,
*
r
.
offset
,
*
r
.
size
);
}
case
Expression
:
:
Id
::
DataDropId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
DataDropId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
DataDrop
>
();
const
auto
&
r
=
*
rhs
.
cast
<
DataDrop
>
();
return
std
::
tie
(
l
.
type
,
l
.
segment
)
<
std
::
tie
(
r
.
type
,
r
.
segment
);
}
case
Expression
:
:
Id
::
MemoryCopyId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
MemoryCopyId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
MemoryCopy
>
();
const
auto
&
r
=
*
rhs
.
cast
<
MemoryCopy
>
();
return
std
::
tie
(
l
.
type
,
*
l
.
dest
,
*
l
.
source
,
*
l
.
size
)
<
std
::
tie
(
r
.
type
,
*
r
.
dest
,
*
r
.
source
,
*
r
.
size
);
}
case
Expression
:
:
Id
::
MemoryFillId
:
WASM_UNREACHABLE
();
// TODO:
case
Expression
:
:
Id
::
MemoryFillId
:
{
const
auto
&
l
=
*
lhs
.
cast
<
MemoryFill
>
();
const
auto
&
r
=
*
rhs
.
cast
<
MemoryFill
>
();
return
std
::
tie
(
l
.
type
,
*
l
.
dest
,
*
l
.
value
,
*
l
.
size
)
<
std
::
tie
(
r
.
type
,
*
r
.
dest
,
*
r
.
value
,
*
r
.
size
);
}
case
Expression
:
:
Id
::
NopId
:
case
Expression
:
:
Id
::
UnreachableId
:
...
...
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