Skip to content

implement sqrt and add fixme for f128#4902

Merged
RalfJung merged 1 commit intorust-lang:masterfrom
folkertdev:fix-f128-fixme
Mar 14, 2026
Merged

implement sqrt and add fixme for f128#4902
RalfJung merged 1 commit intorust-lang:masterfrom
folkertdev:fix-f128-fixme

Conversation

@folkertdev
Copy link
Copy Markdown
Contributor

Trevor and I have been tracking remaining f128 items using FIXME(f128), this makes it easier to keep track.

The sqrt function is implemented using softfloat, that already works for f128 scalars, this just tests the simd version. I'm looking into updating portable_simd to expose the f16 and f128 vector types. That has a bit of a dependency chain though, so it may take a little while.

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 14, 2026

Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two.
Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Mar 14, 2026
);

assert_eq!((a * a).sqrt(), a);
assert_eq!((b * b).sqrt(), b.abs());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We use direct simd_* calls everywhere else in the test, it looks strangely inconsistent to use overloaded operators here.

@RalfJung RalfJung changed the title add fixme for f128 implement sqrt and add fixme for f128 Mar 14, 2026
FloatTy::F32 => host_unary_float_op::<SingleS>(this, &op, host_op, &dest)?,
FloatTy::F64 => host_unary_float_op::<DoubleS>(this, &op, host_op, &dest)?,
FloatTy::F128 => unimplemented!("f128"),
FloatTy::F128 => unimplemented!("f128"), // FIXME(f128)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While you're at it, do you also want to add FIXMEs for powf128 and powif128?

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.

Yes, fixed

@RalfJung
Copy link
Copy Markdown
Member

This looks great, thanks! Please squash the commits. You can squash manually if there are multiple independent commits you want to preserve, or use ./miri squash (make sure to pick a suitable commit message). Then write @rustbot ready after you force-pushed the squashed PR.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: Waiting for the PR author to address review comments and removed S-waiting-on-review Status: Waiting for a review to complete labels Mar 14, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 14, 2026

Reminder, once the PR becomes ready for a review, use @rustbot ready.

also implement sqrt for f128 (using softfloat) and test sqrt for f16 and f128
@folkertdev
Copy link
Copy Markdown
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Waiting for a review to complete and removed S-waiting-on-author Status: Waiting for the PR author to address review comments labels Mar 14, 2026
@RalfJung RalfJung added this pull request to the merge queue Mar 14, 2026
Merged via the queue into rust-lang:master with commit 932cb99 Mar 14, 2026
13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting for a review to complete label Mar 14, 2026
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.

3 participants