Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@grant-d
Copy link

@grant-d grant-d commented Jan 31, 2019

Fixes #22326
cc @tannergooding @benaadams

  • Recent code in SpanHelpers uses a intrinsic with a software fallback, but the latter returns a different answer to the former for an input of 0.
  • Benchmarking showed a branchless expression was slower (1.4x) than an idiomatic guard clause, so a simple if was introduced.
  • All BitOps methods pass units

Grant Dickinson added 2 commits January 31, 2019 13:44
@grant-d
Copy link
Author

grant-d commented Feb 1, 2019

@tannergooding or @benaadams please advise what to do about the one failed check - it looks spurious

@benaadams
Copy link
Member

Windows_NT x64 Checked CoreFX Tests
System.IO.Tests.FileSystemWatcherTests_netstandard17
.EndInit_ResumesPausedEnableRaisingEvents

MESSAGE:
Deleted event did not occur as expected\r\nExpected: True\r\nActual: False
+++++++++++++++++++
STACK TRACE:
at System.IO.Tests.FileSystemWatcherTest.ExecuteAndVerifyEvents(FileSystemWatcher watcher, WatcherChangeTypes expectedEvents, Action action, Boolean assertExpected, String[] expectedPaths, Int32 timeout) in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem.Watcher\tests\Utility\FileSystemWatcherTest.cs:line 261
 at System.IO.Tests.FileSystemWatcherTest.ExpectEvent(FileSystemWatcher watcher, WatcherChangeTypes expectedEvents, Action action, Action cleanup, String[] expectedPaths, Int32 attempts, Int32 timeout) in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem.Watcher\tests\Utility\FileSystemWatcherTest.cs:line 179
 at System.IO.Tests.FileSystemWatcherTest.ExpectEvent(FileSystemWatcher watcher, WatcherChangeTypes expectedEvents, Action action, Action cleanup) in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem.Watcher\tests\Utility\FileSystemWatcherTest.cs:line 134
 at System.IO.Tests.FileSystemWatcherTests_netstandard17.EndInit_ResumesPausedEnableRaisingEvents() in D:\j\workspace\windows-TGrou---74aa877a\src\System.IO.FileSystem.Watcher\tests\FileSystemWatcher.cs:line 208

@dotnet-bot test Windows_NT x64 Checked CoreFX Tests

@grant-d
Copy link
Author

grant-d commented Feb 6, 2019

@dotnet-bot test coreclr-ci please

@grant-d
Copy link
Author

grant-d commented Feb 6, 2019

From reading other PRs, it looks like the coreclr-ci test failure is spurious.
No more changes expected from my side, can we merge

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

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

LGTM.

Might be good if @jkotas, who signed off on the original PR, also approves before this is merged.

@grant-d grant-d changed the title Fix for 22326 Fix for 22326: BitOps.TrailingZeroCount has inconsistent software fallback Feb 6, 2019
Grant Dickinson added 2 commits February 7, 2019 11:06
@grant-d
Copy link
Author

grant-d commented Feb 8, 2019

Can we merge?

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thanks

@grant-d
Copy link
Author

grant-d commented Feb 15, 2019

@tannergooding, @jkotas should we look at implement the TZCNT/REP BSF and LZCNT/31 ^ BSR optimizations suggested here:
https://github.com/dotnet/corefx/issues/32075#issuecomment-462078039 ?

@tannergooding
Copy link
Member

AFAIK, there doesn't exist any intrinsic or recognized pattern for BSF or BSR

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants