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

support tile builtins #623

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

g4titanx
Copy link
Contributor

@g4titanx g4titanx commented Feb 7, 2025

this pr fixes #563

Copy link
Contributor

@antoyo antoyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also enable the tile tests by adressing this comment.

@g4titanx
Copy link
Contributor Author

g4titanx commented Feb 8, 2025

@antoyo i need some clarity on impl. the tile intrinsics. currently, I see a few possible approaches:

  1. Using get_target_builtin_function, but this fails with "Cannot find target builtin" errors since these don't have GCC builtin equivalents.

  2. Creating custom functions with inline assembly, something like:

"llvm.x86.ldtilecfg" => {
    let name = "__rustc_tile_ldtilecfg";
    let func = cx.context.new_function(
        None,
        FunctionType::Internal,
        cx.type_void(),
        &[/* params */],
        name,
        false,
    );
}

@antoyo
Copy link
Contributor

antoyo commented Feb 9, 2025

Yeah, get_target_builtin_function won't work.

Perhaps your solution #2 would be the simplest (if that works). You could add the attribute AlwaysInline to make sure it's efficient.

Otherwise, I see another solution involving changing the type Function to an enum that would either take a Function or inline asm, but that might be a lot of work, so I would go with #2 if that works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement the tile intrinsics
2 participants