Comments (4)
No worries, I could translate! I will answer in English, so you can pick your favorite translation engine!
I can confirm, this is a bug in the implementation of uchar Vc::Detail::max(__m128i a, uchar)
. It should use uchar
instead of schar
in it's implementation. The bug also occurs when the function is called via the public API:
uint8_t a[32]{0, 10, 250};
std::cout << (int)Vc::schar_v((signed char*)a).max() << '\n'; // correctly returns 10
std::cout << (int)Vc::uchar_v(a).max() << '\n'; // returns 10, should be 250
See: https://godbolt.org/z/8K6Yb3oYv.
Would you like to provide us with a pull request? Otherwise, I can fix it myself.
from vc.
不用担心,我可以翻译!我会用英语回答,所以你可以选择你最喜欢的翻译引擎!
我可以确认,这是实现中的错误。它应该使用而不是在其实现中使用。当通过公共 API 调用函数时,也会发生此错误:
uchar Vc::Detail::max(__m128i a, uchar)``uchar``schar
uint8_t a[32]{0, 10, 250}; std::cout << (int)Vc::schar_v((signed char*)a).max() << '\n'; // correctly returns 10 std::cout << (int)Vc::uchar_v(a).max() << '\n'; // returns 10, should be 250请参阅:https://godbolt.org/z/8K6Yb3oYv。
您想向我们提供拉取请求吗?否则,我可以自己修复它。
我不太会pull请求,您可以自己修复它。
from vc.
No worries, I could translate! I will answer in English, so you can pick your favorite translation engine!
I can confirm, this is a bug in the implementation of
uchar Vc::Detail::max(__m128i a, uchar)
. It should useuchar
instead ofschar
in it's implementation. The bug also occurs when the function is called via the public API:uint8_t a[32]{0, 10, 250}; std::cout << (int)Vc::schar_v((signed char*)a).max() << '\n'; // correctly returns 10 std::cout << (int)Vc::uchar_v(a).max() << '\n'; // returns 10, should be 250See: https://godbolt.org/z/8K6Yb3oYv.
Would you like to provide us with a pull request? Otherwise, I can fix it myself.
实际上min也有问题,不过我当时只列出了max的测试,抱歉!
对于min的测试如下
https://godbolt.org/z/d36c8YPsY
显然第二个的min应该是0而不是1。
对于a[2+16]=250,如果没有这一句,很容易发现不出错误。
https://godbolt.org/z/q9dnqx4v8
造成这个的原因大概是使用Vc_AVX_TO_SSE_2_NEW,导致先使用了AVX2中的unsigned函数,后使用SSE2中的signed函数,使得250先与1进行min_epu8,导致发现不出错误。
from vc.
Reopen, because of remaining issue with clang.
from vc.
Related Issues (20)
- Compilation failure with Clang-cl: iterators.h nextBit
- Visual Studio 22 doesn't like scatter implementation
- Consider adding permutation operations
- I followed all the installation instructions, but I can't run #include <Vc/Vc>. HOT 2
- Build broken with Ninja
- Add SVE2 instructions to SIMD. HOT 3
- cmake selects the wrong MSVC compiler HOT 2
- Cast tests fail with g++11
- porting Vc code to highway HOT 5
- icpx fails test memory_scalar with -O3
- Include vcpkg patch HOT 1
- Export internal function HOT 2
- vc 1.4.3 build failure HOT 8
- Ambiguous call to overloaded function (MSVC latest, Vc 1.4.3, AVX fighting SSE)
- zimt - a SIMD abstraction layer - can use Vc as a back-end
- enumerator value "None" in the "simdize.h" header file of Vc conflicts with the preprocessor macro "None" defined in the X11 header file "X.h" HOT 1
- Fix warnings in `Vc` that arise when compiling ROOT HOT 5
- Tests fail to build because no-SSE options are used HOT 1
- Assessment of the difficulty in porting CPU architecture for vc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vc.