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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bfad5344bffc02e6f40ed9ce5629cf507ac4d6136fcc2d3d863d3ebbe281df3
4
- data.tar.gz: b78bf7c8f28ea44d30b6f8a2c872d5a48e8e59e3528c1269da1bde2e3015e9f5
3
+ metadata.gz: 4b7c82084d7d1c3df6fdea5cbf87a28d7984b6f2e81cbb83e9ed56389f334b8e
4
+ data.tar.gz: 79d48d591abe63680b5ff844c3e2ffbe39b5a604655c2abaada90598622de36f
5
5
  SHA512:
6
- metadata.gz: 21e94193a3c2f0d0abe7e153418f70b52b145ca96e105a25c8584950422b5fa1e1e082727250552a71b602f48b391a52c438d3dbee0041c92a79d62d2eefc42e
7
- data.tar.gz: 58b8ae7bf977fdcb6218437de71c4fc13e0a98af2a10b9401c98e80423fc5359912d2310f3dda68cb26e879c617c06ff91ee2c4fa91ec74130bf520cfd6dc8df
6
+ metadata.gz: e23767df92a9adf4b7a25feff24e7dae695f4a8735b268e7badbc9fa40e3dce6468943f69dde350ceefbdfe29d92bd6393d651354fa1dd653ec65e7ae136403a
7
+ data.tar.gz: 63e61a3f1890cb29802e701c6a38b6281662b218a6f14e76b8fa08a13a00693e1a0181c5bf94b900c7423998fae2c1fb3566ce4ce18f167f8b1a4709f8363030
@@ -1,3 +1,3 @@
1
1
  module CraneliftRuby
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
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.2
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-25 00:00:00.000000000 Z
11
+ date: 2021-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rutie