Skip to content

Commit

Permalink
Add bldd case to Op::parse_opcode() (#6957)
Browse files Browse the repository at this point in the history
## Description

The `bldd` opcode was not covered in the `Op::parse_opcode()` which
resulted in `Unknown opcode: "bldd"` error.

The remaining part of the `bldd` opcode integration chain is already
implemented in #6254.

## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](/~https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](/~https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
  • Loading branch information
ironcev authored Feb 25, 2025
1 parent f871a48 commit a879ffb
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 29 deletions.
4 changes: 4 additions & 0 deletions sway-core/src/asm_lang/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[package]]
name = "bldd"
source = "member"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[project]
authors = ["Fuel Labs <contact@fuel.sh>"]
license = "Apache-2.0"
name = "bldd"
entry = "main.sw"
implicit-std = false
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
category = "compile"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[package]]
name = "ecall"
source = "member"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[project]
authors = ["Fuel Labs <contact@fuel.sh>"]
license = "Apache-2.0"
name = "ecall"
entry = "main.sw"
implicit-std = false
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
category = "compile"
Original file line number Diff line number Diff line change
@@ -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"]
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[project]
name = "ecall_basic"
authors = ["Fuel Labs <contact@fuel.sh>"]
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" }

This file was deleted.

0 comments on commit a879ffb

Please sign in to comment.