mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 17:21:09 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b19981a513 | |||
| 10e50e446b | |||
| 939a8f2f78 | |||
| ed608699af |
Generated
+7
-7
@@ -8546,7 +8546,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "resolc"
|
name = "resolc"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"clap",
|
"clap",
|
||||||
@@ -8617,7 +8617,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revive-integration"
|
name = "revive-integration"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alloy-primitives 1.1.2",
|
"alloy-primitives 1.1.2",
|
||||||
"alloy-sol-types 1.1.2",
|
"alloy-sol-types 1.1.2",
|
||||||
@@ -8645,7 +8645,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revive-llvm-builder"
|
name = "revive-llvm-builder"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
@@ -8667,7 +8667,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revive-llvm-context"
|
name = "revive-llvm-context"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"hex",
|
"hex",
|
||||||
@@ -8708,7 +8708,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revive-runtime-api"
|
name = "revive-runtime-api"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"inkwell",
|
"inkwell",
|
||||||
@@ -8730,7 +8730,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revive-stdlib"
|
name = "revive-stdlib"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"inkwell",
|
"inkwell",
|
||||||
"revive-build-utils",
|
"revive-build-utils",
|
||||||
@@ -8738,7 +8738,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "revive-yul"
|
name = "revive-yul"
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"inkwell",
|
"inkwell",
|
||||||
|
|||||||
+6
-6
@@ -14,21 +14,21 @@ repository = "https://github.com/paritytech/revive"
|
|||||||
rust-version = "1.85.0"
|
rust-version = "1.85.0"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
resolc = { version = "0.2.0", path = "crates/resolc" }
|
resolc = { version = "0.3.0", path = "crates/resolc" }
|
||||||
revive-benchmarks = { version = "0.1.0", path = "crates/benchmarks" }
|
revive-benchmarks = { version = "0.1.0", path = "crates/benchmarks" }
|
||||||
revive-builtins = { version = "0.1.0", path = "crates/builtins" }
|
revive-builtins = { version = "0.1.0", path = "crates/builtins" }
|
||||||
revive-common = { version = "0.1.0", path = "crates/common" }
|
revive-common = { version = "0.1.0", path = "crates/common" }
|
||||||
revive-differential = { version = "0.1.0", path = "crates/differential" }
|
revive-differential = { version = "0.1.0", path = "crates/differential" }
|
||||||
revive-integration = { version = "0.1.0", path = "crates/integration" }
|
revive-integration = { version = "0.1.1", path = "crates/integration" }
|
||||||
revive-linker = { version = "0.1.0", path = "crates/linker" }
|
revive-linker = { version = "0.1.0", path = "crates/linker" }
|
||||||
lld-sys = { version = "0.1.0", path = "crates/lld-sys" }
|
lld-sys = { version = "0.1.0", path = "crates/lld-sys" }
|
||||||
revive-llvm-context = { version = "0.2.0", path = "crates/llvm-context" }
|
revive-llvm-context = { version = "0.3.0", path = "crates/llvm-context" }
|
||||||
revive-runtime-api = { version = "0.1.0", path = "crates/runtime-api" }
|
revive-runtime-api = { version = "0.2.0", path = "crates/runtime-api" }
|
||||||
revive-runner = { version = "0.1.0", path = "crates/runner" }
|
revive-runner = { version = "0.1.0", path = "crates/runner" }
|
||||||
revive-solc-json-interface = { version = "0.2.0", path = "crates/solc-json-interface" }
|
revive-solc-json-interface = { version = "0.2.0", path = "crates/solc-json-interface" }
|
||||||
revive-stdlib = { version = "0.1.0", path = "crates/stdlib" }
|
revive-stdlib = { version = "0.1.1", path = "crates/stdlib" }
|
||||||
revive-build-utils = { version = "0.1.0", path = "crates/build-utils" }
|
revive-build-utils = { version = "0.1.0", path = "crates/build-utils" }
|
||||||
revive-yul = { version = "0.2.0", path = "crates/yul" }
|
revive-yul = { version = "0.2.1", path = "crates/yul" }
|
||||||
|
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
cc = "1.2"
|
cc = "1.2"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-integration"
|
name = "revive-integration"
|
||||||
version.workspace = true
|
version = "0.1.1"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ authors = [
|
|||||||
"Anton Baliasnikov <aba@matterlabs.dev>",
|
"Anton Baliasnikov <aba@matterlabs.dev>",
|
||||||
"Cyrill Leutwiler <cyrill@parity.io>",
|
"Cyrill Leutwiler <cyrill@parity.io>",
|
||||||
]
|
]
|
||||||
version.workspace = true
|
version = "0.2.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-llvm-context"
|
name = "revive-llvm-context"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
use inkwell::values::BasicValue;
|
use inkwell::values::BasicValue;
|
||||||
|
|
||||||
use crate::polkavm::context::runtime::RuntimeFunction;
|
//use crate::polkavm::context::runtime::RuntimeFunction;
|
||||||
use crate::polkavm::context::Context;
|
use crate::polkavm::context::Context;
|
||||||
use crate::polkavm::Dependency;
|
use crate::polkavm::Dependency;
|
||||||
use crate::PolkaVMDivisionFunction;
|
//use crate::PolkaVMDivisionFunction;
|
||||||
use crate::PolkaVMRemainderFunction;
|
//use crate::PolkaVMRemainderFunction;
|
||||||
use crate::PolkaVMSignedDivisionFunction;
|
//use crate::PolkaVMSignedDivisionFunction;
|
||||||
use crate::PolkaVMSignedRemainderFunction;
|
//use crate::PolkaVMSignedRemainderFunction;
|
||||||
|
|
||||||
/// Translates the arithmetic addition.
|
/// Translates the arithmetic addition.
|
||||||
pub fn addition<'ctx, D>(
|
pub fn addition<'ctx, D>(
|
||||||
@@ -64,11 +64,21 @@ pub fn division<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
let name = <PolkaVMDivisionFunction as RuntimeFunction<D>>::NAME;
|
let result_pointer = context.build_alloca_at_entry(context.word_type(), "div_result_pointer");
|
||||||
let declaration = <PolkaVMDivisionFunction as RuntimeFunction<D>>::declaration(context);
|
let operand_1_pointer = context.build_alloca_at_entry(context.word_type(), "operand_1_pointer");
|
||||||
Ok(context
|
let operand_2_pointer = context.build_alloca_at_entry(context.word_type(), "operand_2_pointer");
|
||||||
.build_call(declaration, &[operand_1.into(), operand_2.into()], "div")
|
|
||||||
.unwrap_or_else(|| panic!("revive runtime function {name} should return a value",)))
|
context.build_store(operand_1_pointer, operand_1)?;
|
||||||
|
context.build_store(operand_2_pointer, operand_2)?;
|
||||||
|
|
||||||
|
let arguments = &[
|
||||||
|
result_pointer.to_int(context).into(),
|
||||||
|
operand_1_pointer.to_int(context).into(),
|
||||||
|
operand_2_pointer.to_int(context).into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::DIV, arguments);
|
||||||
|
context.build_load(result_pointer, "div_result")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Translates the arithmetic remainder.
|
/// Translates the arithmetic remainder.
|
||||||
@@ -80,11 +90,21 @@ pub fn remainder<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
let name = <PolkaVMRemainderFunction as RuntimeFunction<D>>::NAME;
|
let result_pointer = context.build_alloca_at_entry(context.word_type(), "rem_result_pointer");
|
||||||
let declaration = <PolkaVMRemainderFunction as RuntimeFunction<D>>::declaration(context);
|
let operand_1_pointer = context.build_alloca_at_entry(context.word_type(), "operand_1_pointer");
|
||||||
Ok(context
|
let operand_2_pointer = context.build_alloca_at_entry(context.word_type(), "operand_2_pointer");
|
||||||
.build_call(declaration, &[operand_1.into(), operand_2.into()], "rem")
|
|
||||||
.unwrap_or_else(|| panic!("revive runtime function {name} should return a value",)))
|
context.build_store(operand_1_pointer, operand_1)?;
|
||||||
|
context.build_store(operand_2_pointer, operand_2)?;
|
||||||
|
|
||||||
|
let arguments = &[
|
||||||
|
result_pointer.to_int(context).into(),
|
||||||
|
operand_1_pointer.to_int(context).into(),
|
||||||
|
operand_2_pointer.to_int(context).into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::MOD, arguments);
|
||||||
|
context.build_load(result_pointer, "rem_result")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Translates the signed arithmetic division.
|
/// Translates the signed arithmetic division.
|
||||||
@@ -99,11 +119,21 @@ pub fn division_signed<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
let name = <PolkaVMSignedDivisionFunction as RuntimeFunction<D>>::NAME;
|
let result_pointer = context.build_alloca_at_entry(context.word_type(), "sdiv_result_pointer");
|
||||||
let declaration = <PolkaVMSignedDivisionFunction as RuntimeFunction<D>>::declaration(context);
|
let operand_1_pointer = context.build_alloca_at_entry(context.word_type(), "operand_1_pointer");
|
||||||
Ok(context
|
let operand_2_pointer = context.build_alloca_at_entry(context.word_type(), "operand_2_pointer");
|
||||||
.build_call(declaration, &[operand_1.into(), operand_2.into()], "sdiv")
|
|
||||||
.unwrap_or_else(|| panic!("revive runtime function {name} should return a value",)))
|
context.build_store(operand_1_pointer, operand_1)?;
|
||||||
|
context.build_store(operand_2_pointer, operand_2)?;
|
||||||
|
|
||||||
|
let arguments = &[
|
||||||
|
result_pointer.to_int(context).into(),
|
||||||
|
operand_1_pointer.to_int(context).into(),
|
||||||
|
operand_2_pointer.to_int(context).into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::SDIV, arguments);
|
||||||
|
context.build_load(result_pointer, "sdiv_result")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Translates the signed arithmetic remainder.
|
/// Translates the signed arithmetic remainder.
|
||||||
@@ -115,9 +145,19 @@ pub fn remainder_signed<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
let name = <PolkaVMSignedRemainderFunction as RuntimeFunction<D>>::NAME;
|
let result_pointer = context.build_alloca_at_entry(context.word_type(), "srem_result_pointer");
|
||||||
let declaration = <PolkaVMSignedRemainderFunction as RuntimeFunction<D>>::declaration(context);
|
let operand_1_pointer = context.build_alloca_at_entry(context.word_type(), "operand_1_pointer");
|
||||||
Ok(context
|
let operand_2_pointer = context.build_alloca_at_entry(context.word_type(), "operand_2_pointer");
|
||||||
.build_call(declaration, &[operand_1.into(), operand_2.into()], "srem")
|
|
||||||
.unwrap_or_else(|| panic!("revive runtime function {name} should return a value",)))
|
context.build_store(operand_1_pointer, operand_1)?;
|
||||||
|
context.build_store(operand_2_pointer, operand_2)?;
|
||||||
|
|
||||||
|
let arguments = &[
|
||||||
|
result_pointer.to_int(context).into(),
|
||||||
|
operand_1_pointer.to_int(context).into(),
|
||||||
|
operand_2_pointer.to_int(context).into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::SMOD, arguments);
|
||||||
|
context.build_load(result_pointer, "rsem_result")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
//! Translates the mathematical operations.
|
//! Translates the mathematical operations.
|
||||||
|
|
||||||
use inkwell::values::BasicValue;
|
|
||||||
|
|
||||||
use crate::polkavm::context::Context;
|
use crate::polkavm::context::Context;
|
||||||
use crate::polkavm::Dependency;
|
use crate::polkavm::Dependency;
|
||||||
|
|
||||||
@@ -15,17 +13,26 @@ pub fn add_mod<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
Ok(context
|
let result_pointer =
|
||||||
.build_call(
|
context.build_alloca_at_entry(context.word_type(), "addmod_result_pointer");
|
||||||
context.llvm_runtime().add_mod,
|
let operand_1_pointer = context.build_alloca_at_entry(context.word_type(), "addmod_operand_1");
|
||||||
&[
|
let operand_2_pointer = context.build_alloca_at_entry(context.word_type(), "addmod_operand_2");
|
||||||
operand_1.as_basic_value_enum(),
|
let modulo_pointer =
|
||||||
operand_2.as_basic_value_enum(),
|
context.build_alloca_at_entry(context.word_type(), "addmod_modulo_operand");
|
||||||
modulo.as_basic_value_enum(),
|
|
||||||
],
|
context.build_store(operand_2_pointer, operand_2)?;
|
||||||
"add_mod_call",
|
context.build_store(operand_1_pointer, operand_1)?;
|
||||||
)
|
context.build_store(modulo_pointer, modulo)?;
|
||||||
.expect("Always exists"))
|
|
||||||
|
let arguments = &[
|
||||||
|
result_pointer.to_int(context).into(),
|
||||||
|
operand_1_pointer.to_int(context).into(),
|
||||||
|
operand_2_pointer.to_int(context).into(),
|
||||||
|
modulo_pointer.to_int(context).into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::ADDMOD, arguments);
|
||||||
|
context.build_load(result_pointer, "addmod_result")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Translates the `mulmod` instruction.
|
/// Translates the `mulmod` instruction.
|
||||||
@@ -38,17 +45,26 @@ pub fn mul_mod<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
Ok(context
|
let result_pointer =
|
||||||
.build_call(
|
context.build_alloca_at_entry(context.word_type(), "mulmod_result_pointer");
|
||||||
context.llvm_runtime().mul_mod,
|
let operand_1_pointer = context.build_alloca_at_entry(context.word_type(), "mulmod_operand_1");
|
||||||
&[
|
let operand_2_pointer = context.build_alloca_at_entry(context.word_type(), "mulmod_operand_2");
|
||||||
operand_1.as_basic_value_enum(),
|
let modulo_pointer =
|
||||||
operand_2.as_basic_value_enum(),
|
context.build_alloca_at_entry(context.word_type(), "mulmod_modulo_operand");
|
||||||
modulo.as_basic_value_enum(),
|
|
||||||
],
|
context.build_store(operand_2_pointer, operand_2)?;
|
||||||
"mul_mod_call",
|
context.build_store(operand_1_pointer, operand_1)?;
|
||||||
)
|
context.build_store(modulo_pointer, modulo)?;
|
||||||
.expect("Always exists"))
|
|
||||||
|
let arguments = &[
|
||||||
|
result_pointer.to_int(context).into(),
|
||||||
|
operand_1_pointer.to_int(context).into(),
|
||||||
|
operand_2_pointer.to_int(context).into(),
|
||||||
|
modulo_pointer.to_int(context).into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::MULMOD, arguments);
|
||||||
|
context.build_load(result_pointer, "addmod_result")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Translates the `exp` instruction.
|
/// Translates the `exp` instruction.
|
||||||
@@ -60,13 +76,22 @@ pub fn exponent<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
Ok(context
|
let result_pointer = context.build_alloca_at_entry(context.word_type(), "exp_result_pointer");
|
||||||
.build_call(
|
let value_pointer = context.build_alloca_at_entry(context.word_type(), "exp_value_pointer");
|
||||||
context.llvm_runtime().exp,
|
let exponent_pointer =
|
||||||
&[value.as_basic_value_enum(), exponent.as_basic_value_enum()],
|
context.build_alloca_at_entry(context.word_type(), "exp_exponent_pointer");
|
||||||
"exp_call",
|
|
||||||
)
|
context.build_store(value_pointer, value)?;
|
||||||
.expect("Always exists"))
|
context.build_store(exponent_pointer, exponent)?;
|
||||||
|
|
||||||
|
let arguments = &[
|
||||||
|
result_pointer.to_int(context).into(),
|
||||||
|
value_pointer.to_int(context).into(),
|
||||||
|
exponent_pointer.to_int(context).into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::EXP, arguments);
|
||||||
|
context.build_load(result_pointer, "exponent_result")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Translates the `signextend` instruction.
|
/// Translates the `signextend` instruction.
|
||||||
@@ -78,11 +103,20 @@ pub fn sign_extend<'ctx, D>(
|
|||||||
where
|
where
|
||||||
D: Dependency + Clone,
|
D: Dependency + Clone,
|
||||||
{
|
{
|
||||||
Ok(context
|
let result_pointer =
|
||||||
.build_call(
|
context.build_alloca_at_entry(context.word_type(), "signext_result_pointer");
|
||||||
context.llvm_runtime().sign_extend,
|
let bytes_pointer = context.build_alloca_at_entry(context.word_type(), "bytes_pointer");
|
||||||
&[bytes.as_basic_value_enum(), value.as_basic_value_enum()],
|
let value_pointer = context.build_alloca_at_entry(context.word_type(), "signext_value_pointer");
|
||||||
"sign_extend_call",
|
|
||||||
)
|
context.build_store(bytes_pointer, bytes)?;
|
||||||
.expect("Always exists"))
|
context.build_store(value_pointer, value)?;
|
||||||
|
|
||||||
|
let arguments = &[
|
||||||
|
result_pointer.to_int(context).into(),
|
||||||
|
bytes_pointer.to_int(context).into(),
|
||||||
|
value_pointer.to_int(context).into(),
|
||||||
|
];
|
||||||
|
|
||||||
|
context.build_runtime_call(revive_runtime_api::polkavm_imports::EXP, arguments);
|
||||||
|
context.build_load(result_pointer, "signext_mod_result")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "resolc"
|
name = "resolc"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-runtime-api"
|
name = "revive-runtime-api"
|
||||||
version.workspace = true
|
version = "0.2.0"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -104,3 +104,19 @@ POLKAVM_IMPORT(uint64_t, set_storage, uint32_t, uint32_t, uint32_t, uint32_t, ui
|
|||||||
POLKAVM_IMPORT(void, value_transferred, uint32_t)
|
POLKAVM_IMPORT(void, value_transferred, uint32_t)
|
||||||
|
|
||||||
POLKAVM_IMPORT(void, weight_to_fee, uint64_t, uint64_t, uint32_t);
|
POLKAVM_IMPORT(void, weight_to_fee, uint64_t, uint64_t, uint32_t);
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, div, uint32_t, uint32_t, uint32_t);
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, sdiv, uint32_t, uint32_t, uint32_t);
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, addmod, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, mulmod, uint32_t, uint32_t, uint32_t, uint32_t);
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, mod, uint32_t, uint32_t, uint32_t);
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, smod, uint32_t, uint32_t, uint32_t);
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, exp, uint32_t, uint32_t, uint32_t);
|
||||||
|
|
||||||
|
POLKAVM_IMPORT(void, signext, uint32_t, uint32_t, uint32_t);
|
||||||
|
|||||||
@@ -68,9 +68,27 @@ pub static VALUE_TRANSFERRED: &str = "value_transferred";
|
|||||||
|
|
||||||
pub static WEIGHT_TO_FEE: &str = "weight_to_fee";
|
pub static WEIGHT_TO_FEE: &str = "weight_to_fee";
|
||||||
|
|
||||||
|
pub static DIV: &str = "div";
|
||||||
|
pub static SDIV: &str = "sdiv";
|
||||||
|
pub static ADDMOD: &str = "addmod";
|
||||||
|
pub static MULMOD: &str = "mulmod";
|
||||||
|
pub static MOD: &str = "mod";
|
||||||
|
pub static SMOD: &str = "smod";
|
||||||
|
pub static EXP: &str = "exp";
|
||||||
|
pub static SIGNEXT: &str = "signext";
|
||||||
|
|
||||||
/// All imported runtime API symbols.
|
/// All imported runtime API symbols.
|
||||||
/// Useful for configuring common attributes and linkage.
|
/// Useful for configuring common attributes and linkage.
|
||||||
pub static IMPORTS: [&str; 33] = [
|
pub static IMPORTS: [&str; 41] = [
|
||||||
|
DIV,
|
||||||
|
SDIV,
|
||||||
|
ADDMOD,
|
||||||
|
MULMOD,
|
||||||
|
MOD,
|
||||||
|
SMOD,
|
||||||
|
EXP,
|
||||||
|
SIGNEXT,
|
||||||
|
//
|
||||||
ADDRESS,
|
ADDRESS,
|
||||||
BALANCE,
|
BALANCE,
|
||||||
BALANCE_OF,
|
BALANCE_OF,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-stdlib"
|
name = "revive-stdlib"
|
||||||
version.workspace = true
|
version = "0.1.1"
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
repository.workspace = true
|
repository.workspace = true
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "revive-yul"
|
name = "revive-yul"
|
||||||
description = "The revive YUL parser library."
|
description = "The revive YUL parser library."
|
||||||
version = "0.2.0"
|
version = "0.2.1"
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
license.workspace = true
|
license.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
|||||||
@@ -204,10 +204,10 @@ where
|
|||||||
revive_llvm_context::PolkaVMEventLogFunction::<3>.declare(context)?;
|
revive_llvm_context::PolkaVMEventLogFunction::<3>.declare(context)?;
|
||||||
revive_llvm_context::PolkaVMEventLogFunction::<4>.declare(context)?;
|
revive_llvm_context::PolkaVMEventLogFunction::<4>.declare(context)?;
|
||||||
|
|
||||||
revive_llvm_context::PolkaVMDivisionFunction.declare(context)?;
|
//revive_llvm_context::PolkaVMDivisionFunction.declare(context)?;
|
||||||
revive_llvm_context::PolkaVMSignedDivisionFunction.declare(context)?;
|
//revive_llvm_context::PolkaVMSignedDivisionFunction.declare(context)?;
|
||||||
revive_llvm_context::PolkaVMRemainderFunction.declare(context)?;
|
//revive_llvm_context::PolkaVMRemainderFunction.declare(context)?;
|
||||||
revive_llvm_context::PolkaVMSignedRemainderFunction.declare(context)?;
|
//revive_llvm_context::PolkaVMSignedRemainderFunction.declare(context)?;
|
||||||
|
|
||||||
revive_llvm_context::PolkaVMSbrkFunction.declare(context)?;
|
revive_llvm_context::PolkaVMSbrkFunction.declare(context)?;
|
||||||
|
|
||||||
@@ -258,10 +258,10 @@ where
|
|||||||
revive_llvm_context::PolkaVMEventLogFunction::<3>.into_llvm(context)?;
|
revive_llvm_context::PolkaVMEventLogFunction::<3>.into_llvm(context)?;
|
||||||
revive_llvm_context::PolkaVMEventLogFunction::<4>.into_llvm(context)?;
|
revive_llvm_context::PolkaVMEventLogFunction::<4>.into_llvm(context)?;
|
||||||
|
|
||||||
revive_llvm_context::PolkaVMDivisionFunction.into_llvm(context)?;
|
//revive_llvm_context::PolkaVMDivisionFunction.into_llvm(context)?;
|
||||||
revive_llvm_context::PolkaVMSignedDivisionFunction.into_llvm(context)?;
|
//revive_llvm_context::PolkaVMSignedDivisionFunction.into_llvm(context)?;
|
||||||
revive_llvm_context::PolkaVMRemainderFunction.into_llvm(context)?;
|
//revive_llvm_context::PolkaVMRemainderFunction.into_llvm(context)?;
|
||||||
revive_llvm_context::PolkaVMSignedRemainderFunction.into_llvm(context)?;
|
//revive_llvm_context::PolkaVMSignedRemainderFunction.into_llvm(context)?;
|
||||||
|
|
||||||
revive_llvm_context::PolkaVMSbrkFunction.into_llvm(context)?;
|
revive_llvm_context::PolkaVMSbrkFunction.into_llvm(context)?;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@parity/resolc",
|
"name": "@parity/resolc",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"version": "0.2.0",
|
"version": "0.3.0",
|
||||||
"author": "Parity <admin@parity.io> (https://parity.io)",
|
"author": "Parity <admin@parity.io> (https://parity.io)",
|
||||||
"module": "index.ts",
|
"module": "index.ts",
|
||||||
"types": "./dist/index.d.ts",
|
"types": "./dist/index.d.ts",
|
||||||
|
|||||||
Generated
+1
-1
@@ -44,7 +44,7 @@
|
|||||||
},
|
},
|
||||||
"js/resolc": {
|
"js/resolc": {
|
||||||
"name": "@parity/resolc",
|
"name": "@parity/resolc",
|
||||||
"version": "0.2.0",
|
"version": "0.3.0",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "^22.9.0",
|
"@types/node": "^22.9.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user