cranelift_ruby 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cranelift_ruby/version.rb +1 -1
- data/src/lib.rs +30 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b7c82084d7d1c3df6fdea5cbf87a28d7984b6f2e81cbb83e9ed56389f334b8e
|
4
|
+
data.tar.gz: 79d48d591abe63680b5ff844c3e2ffbe39b5a604655c2abaada90598622de36f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e23767df92a9adf4b7a25feff24e7dae695f4a8735b268e7badbc9fa40e3dce6468943f69dde350ceefbdfe29d92bd6393d651354fa1dd653ec65e7ae136403a
|
7
|
+
data.tar.gz: 63e61a3f1890cb29802e701c6a38b6281662b218a6f14e76b8fa08a13a00693e1a0181c5bf94b900c7423998fae2c1fb3566ce4ce18f167f8b1a4709f8363030
|
data/src/lib.rs
CHANGED
@@ -343,6 +343,34 @@ methods!(
|
|
343
343
|
let res = bcx.ins().iadd(x, y);
|
344
344
|
Integer::new(res.as_u32().into())
|
345
345
|
},
|
346
|
+
fn band(x: Integer, y: Integer) -> Integer {
|
347
|
+
let bcx = itself.get_data_mut(&*FUNCTION_BUILDER_WRAPPER);
|
348
|
+
let x = x.map_err(|e| VM::raise_ex(e)).unwrap();
|
349
|
+
let x = from_integer_to_value(x)
|
350
|
+
.map_err(|e| VM::raise_ex(e))
|
351
|
+
.unwrap();
|
352
|
+
let y = y.map_err(|e| VM::raise_ex(e)).unwrap();
|
353
|
+
let y = from_integer_to_value(y)
|
354
|
+
.map_err(|e| VM::raise_ex(e))
|
355
|
+
.unwrap();
|
356
|
+
|
357
|
+
let res = bcx.ins().band(x, y);
|
358
|
+
Integer::new(res.as_u32().into())
|
359
|
+
},
|
360
|
+
fn bor(x: Integer, y: Integer) -> Integer {
|
361
|
+
let bcx = itself.get_data_mut(&*FUNCTION_BUILDER_WRAPPER);
|
362
|
+
let x = x.map_err(|e| VM::raise_ex(e)).unwrap();
|
363
|
+
let x = from_integer_to_value(x)
|
364
|
+
.map_err(|e| VM::raise_ex(e))
|
365
|
+
.unwrap();
|
366
|
+
let y = y.map_err(|e| VM::raise_ex(e)).unwrap();
|
367
|
+
let y = from_integer_to_value(y)
|
368
|
+
.map_err(|e| VM::raise_ex(e))
|
369
|
+
.unwrap();
|
370
|
+
|
371
|
+
let res = bcx.ins().bor(x, y);
|
372
|
+
Integer::new(res.as_u32().into())
|
373
|
+
},
|
346
374
|
fn return_(values: Array) -> NilClass {
|
347
375
|
let bcx = itself.get_data_mut(&*FUNCTION_BUILDER_WRAPPER);
|
348
376
|
let values = values.map_err(|e| VM::raise_ex(e)).unwrap();
|
@@ -595,6 +623,8 @@ pub extern "C" fn Init_cranelift_ruby() {
|
|
595
623
|
klass.def("import_signature", import_signature);
|
596
624
|
klass.def("call_indirect", call_indirect);
|
597
625
|
klass.def("inst_results", inst_results);
|
626
|
+
klass.def("band", band);
|
627
|
+
klass.def("bor", bor);
|
598
628
|
});
|
599
629
|
});
|
600
630
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cranelift_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Concetto Rudilosso
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rutie
|