diff --git a/sway-core/src/asm_lang/mod.rs b/sway-core/src/asm_lang/mod.rs index aabea4edfc8..91feeb1264a 100644 --- a/sway-core/src/asm_lang/mod.rs +++ b/sway-core/src/asm_lang/mod.rs @@ -596,6 +596,10 @@ impl Op { let (r1, r2, r3, i0) = three_regs_imm_06(handler, args, immediate, whole_op_span)?; VirtualOp::LDC(r1, r2, r3, i0) } + "bldd" => { + let (r1, r2, r3, r4) = four_regs(handler, args, immediate, whole_op_span)?; + VirtualOp::BLDD(r1, r2, r3, r4) + } "log" => { let (r1, r2, r3, r4) = four_regs(handler, args, immediate, whole_op_span)?; VirtualOp::LOG(r1, r2, r3, r4) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/Forc.lock deleted file mode 100644 index cd43bbf78d8..00000000000 --- a/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/Forc.lock +++ /dev/null @@ -1,8 +0,0 @@ -[[package]] -name = "core" -source = "path+from-root-02C557D3012ABF18" - -[[package]] -name = "ecall_basic" -source = "member" -dependencies = ["core"] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/test.toml deleted file mode 100644 index 0f3f6d7e866..00000000000 --- a/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/test.toml +++ /dev/null @@ -1 +0,0 @@ -category = "unit_tests_pass" diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/Forc.lock new file mode 100644 index 00000000000..b7234531207 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/Forc.lock @@ -0,0 +1,3 @@ +[[package]] +name = "bldd" +source = "member" diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/Forc.toml new file mode 100644 index 00000000000..43b72c376c0 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/Forc.toml @@ -0,0 +1,6 @@ +[project] +authors = ["Fuel Labs "] +license = "Apache-2.0" +name = "bldd" +entry = "main.sw" +implicit-std = false \ No newline at end of file diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/src/main.sw new file mode 100644 index 00000000000..6377b6e9929 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/src/main.sw @@ -0,0 +1,10 @@ +library; + +// Intentionally not using `b256::zero()` to avoid dependency to `core`. +const B256_ZERO: b256 = 0x0000000000000000000000000000000000000000000000000000000000000000; + +pub fn main() { + asm(r1: B256_ZERO, r2: B256_ZERO, r3: 42u64, r4: 21u64) { + bldd r1 r2 r3 r4; + } +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/test.toml new file mode 100644 index 00000000000..e816041d3f8 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/bldd/test.toml @@ -0,0 +1 @@ +category = "compile" diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/Forc.lock new file mode 100644 index 00000000000..c877dd0642d --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/Forc.lock @@ -0,0 +1,3 @@ +[[package]] +name = "ecall" +source = "member" diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/Forc.toml new file mode 100644 index 00000000000..2828da2b86f --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/Forc.toml @@ -0,0 +1,6 @@ +[project] +authors = ["Fuel Labs "] +license = "Apache-2.0" +name = "ecall" +entry = "main.sw" +implicit-std = false \ No newline at end of file diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/src/main.sw similarity index 77% rename from test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/src/main.sw rename to test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/src/main.sw index 8e5d877eaf5..a0c83888d98 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/src/main.sw @@ -1,6 +1,6 @@ -script; +library; -fn main() { +pub fn main() { asm(r1: 1u64, r2: 2u32, r3: 3u32, r4: 4u32) { ecal r1 r2 r3 r4; } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/test.toml new file mode 100644 index 00000000000..e816041d3f8 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/ecall/test.toml @@ -0,0 +1 @@ +category = "compile" diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/Forc.lock similarity index 52% rename from test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/Forc.lock rename to test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/Forc.lock index 3b576dee330..801eb46b57f 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/Forc.lock +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/Forc.lock @@ -1,13 +1,13 @@ -[[package]] -name = "asm_wqxx_instructions" -source = "member" -dependencies = ["std"] - [[package]] name = "core" -source = "path+from-root-DEA77F133437397D" +source = "path+from-root-6CA79EAC12B0D10A" [[package]] name = "std" -source = "path+from-root-DEA77F133437397D" +source = "path+from-root-6CA79EAC12B0D10A" dependencies = ["core"] + +[[package]] +name = "wqxx" +source = "member" +dependencies = ["std"] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/Forc.toml similarity index 52% rename from test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/Forc.toml rename to test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/Forc.toml index 13c1b6e9982..f97c1eb9aa1 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/ecall/ecall_basic/Forc.toml +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/Forc.toml @@ -1,9 +1,8 @@ [project] -name = "ecall_basic" authors = ["Fuel Labs "] entry = "main.sw" -implicit-std = false license = "Apache-2.0" +name = "wqxx" [dependencies] -core = { path = "../../../../../../../sway-lib-core" } +std = { path = "../../../../../../reduced_std_libs/sway-lib-std-assert" } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/src/main.sw similarity index 100% rename from test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/src/main.sw rename to test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/src/main.sw diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/test.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/test.toml similarity index 100% rename from test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/test.toml rename to test/src/e2e_vm_tests/test_programs/should_pass/language/asm/instructions/wqxx/test.toml diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/Forc.toml deleted file mode 100644 index c44f1f66715..00000000000 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/asm_wqxx_instructions/Forc.toml +++ /dev/null @@ -1,8 +0,0 @@ -[project] -authors = ["Fuel Labs "] -entry = "main.sw" -license = "Apache-2.0" -name = "asm_wqxx_instructions" - -[dependencies] -std = { path = "../../../../reduced_std_libs/sway-lib-std-assert" }