Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_with_carry function not found #1474

Open
proppy opened this issue Jun 12, 2024 · 2 comments
Open

add_with_carry function not found #1474

proppy opened this issue Jun 12, 2024 · 2 comments
Labels
bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end ir

Comments

@proppy
Copy link
Member

proppy commented Jun 12, 2024

Describe the bug

When trying to use the documented built-in add_with_carry like in the snippet below:

import float32;
import std;

pub fn double_fraction_carry(f: float32::F32) -> (uN[float32::F32_FRACTION_SZ], u1) {
    let f = f.fraction as uN[u32:23 + u32:1];
    let (c, f_x2) = add_with_carry(f, f);
    (f_x2[0+:u23], c)
}

ir_converter_main fails with the following error:

xls_work_dir/user_module.x:8:35-8:41
0006: pub fn double_fraction_carry(f: float32::F32) -> (uN[float32::F32_FRACTION_SZ], u1) {
0007:     let f = f.fraction as uN[u32:23 + u32:1];
0008:     let (c, f_x2) = add_with_carry(f, f);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^----^ IrConversionError: Could not find name for invocation: `add_with_carry`; available: [double_fraction_carry]
0009:     (f_x2[0+:u23], c)
0010: }

@proppy proppy added bug Something isn't working or is incorrect ir labels Jun 13, 2024
@cdleary
Copy link
Collaborator

cdleary commented Jun 15, 2024

If we're not going to add an IR node for it (and I don't think we have any active plans to) I think we should probably remove this in favor of stdlib userspace helper function.

@cdleary cdleary added the dslx DSLX (domain specific language) implementation / front-end label Jun 15, 2024
@cdleary
Copy link
Collaborator

cdleary commented Jun 15, 2024

(And note this is technically a frontend issue since it's an error in IR conversion.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end ir
Projects
None yet
Development

No branches or pull requests

2 participants