Skip to content

[SYCL] Implement sycl_ext_oneapi_fp4 extension#22437

Open
dm-vodopyanov wants to merge 2 commits into
intel:syclfrom
dm-vodopyanov:fp4_cri
Open

[SYCL] Implement sycl_ext_oneapi_fp4 extension#22437
dm-vodopyanov wants to merge 2 commits into
intel:syclfrom
dm-vodopyanov:fp4_cri

Conversation

@dm-vodopyanov

Copy link
Copy Markdown
Contributor

@dm-vodopyanov dm-vodopyanov requested a review from a team as a code owner June 25, 2026 14:40
significand = static_cast<uint64_t>(frac);
uint64_t tmp = significand;
leadingBit = -1;
while (tmp != 0u) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: I do not like this loop but it is necessary evil. There are alternatives:

  1. Use C++20 feature std::bit_width which is not an option because we need to support C++17, as I understand
  2. Compiler intrinsics. It has drawback since GCC/clang intrinsic name(__builtin_clz) is not equal to MSVC(__lzcnt) one.

I am just curious if option 2 faster than this loop.
@dm-vodopyanov Do you think we can try to use №2 if it is faster?

: static_cast<ToT>(narrowed));
return static_cast<ToT>(narrowed);
} else {
(void)R;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: the alternative is [[maybe_unused]] which can reduce the number of lines.

#endif
}

static constexpr void CheckConstraints(rounding r) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please, mark it with [[maybe_unused]]. Otherwise, build with --no-assertions will fail.

@dm-vodopyanov dm-vodopyanov requested a review from gmlueck June 25, 2026 18:05
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.

2 participants