Skip to content

Add llvm_is_fpclass (llvm.is.fpclass) to ldc.intrinsics#5157

Merged
thewilsonator merged 2 commits into
ldc-developers:masterfrom
QuantumSegfault:llvm-instrinsic-is-fpclass
Jun 24, 2026
Merged

Add llvm_is_fpclass (llvm.is.fpclass) to ldc.intrinsics#5157
thewilsonator merged 2 commits into
ldc-developers:masterfrom
QuantumSegfault:llvm-instrinsic-is-fpclass

Conversation

@QuantumSegfault

Copy link
Copy Markdown
Contributor

Adds llvm_is_fpclass to ldc.intrinsics (for scalars only).

https://llvm.org/docs/LangRef.html#llvm-is-fpclass-intrinsic

@QuantumSegfault

Copy link
Copy Markdown
Contributor Author

Requesting review

@thewilsonator @JohanEngelen

Comment thread runtime/druntime/src/ldc/intrinsics.di Outdated
if (__traits(isFloating, T));

/// The ‘llvm.is.fpclass’ intrinsic returns a boolean value or vector of
/// boolean values depending on whether the first argument satisfies the

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.

this doesn't look to handle the vector return case (though I'm not sure we can or need to).

@QuantumSegfault QuantumSegfault Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. I copied those docs from the LangRef.

Boolean vector output is for when you have a vector input.

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.

then please update the doc to either remove reference to the vector case or add a note that it is not (yet) supported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done (vector mention removed).

Something to re-evaluate if/when support for vector intrinsics gets added.

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.

FWIW we have intrinsic support for vectors, but not for vector of bools.

@thewilsonator thewilsonator merged commit ac64c3c into ldc-developers:master Jun 24, 2026
19 checks passed
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