Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mu-impl-fast
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mu
mu-impl-fast
Commits
6c06ffd1
Commit
6c06ffd1
authored
Nov 14, 2016
by
Kunshan Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IRBuilder: SELECT
parent
97e188ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
src/vm/api/api_impl/muirbuilder.rs
src/vm/api/api_impl/muirbuilder.rs
+21
-0
tests/test_jit/test_otherops.py
tests/test_jit/test_otherops.py
+1
-1
No files found.
src/vm/api/api_impl/muirbuilder.rs
View file @
6c06ffd1
...
...
@@ -1371,6 +1371,27 @@ impl<'lb, 'lvm> BundleLoader<'lb, 'lvm> {
},
}
},
NodeInst
::
NodeSelect
{
id
:
_
,
result_id
,
cond_ty
,
opnd_ty
,
cond
,
if_true
,
if_false
}
=>
{
let
impl_cond_ty
=
self
.get_built_type
(
cond_ty
);
let
impl_opnd_ty
=
self
.get_built_type
(
opnd_ty
);
let
impl_cond
=
self
.get_treenode
(
fcb
,
cond
);
let
impl_if_true
=
self
.get_treenode
(
fcb
,
if_true
);
let
impl_if_false
=
self
.get_treenode
(
fcb
,
if_false
);
// NOTE: only implemented scalar SELECT. Vector select is not implemented yet.
let
impl_rv
=
self
.new_ssa
(
fcb
,
result_id
,
impl_opnd_ty
.clone
())
.clone_value
();
Instruction
{
hdr
:
hdr
,
value
:
Some
(
vec!
[
impl_rv
]),
ops
:
RwLock
::
new
(
vec!
[
impl_cond
,
impl_if_true
,
impl_if_false
]),
v
:
Instruction_
::
Select
{
cond
:
0
,
true_val
:
1
,
false_val
:
2
,
},
}
},
NodeInst
::
NodeBranch
{
id
:
_
,
dest
}
=>
{
let
mut
ops
:
Vec
<
P
<
TreeNode
>>
=
Vec
::
new
();
...
...
tests/test_jit/test_otherops.py
View file @
6c06ffd1
...
...
@@ -2,6 +2,6 @@ from util import fncptr_from_c_script
import
ctypes
def
test_select
():
fnp
=
fncptr_from_c_script
(
'test_select.c'
,
'test_fnc'
,
[
ctypes
.
c_byte
])
fnp
,
_
=
fncptr_from_c_script
(
'test_select.c'
,
'test_fnc'
,
[
ctypes
.
c_byte
])
assert
fnp
(
0
)
==
20
assert
fnp
(
1
)
==
10
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