mirror of
https://github.com/boostorg/endian.git
synced 2025-07-29 12:07:31 +02:00
For X86 and X64 architectures, which permit unaligned loads and stores, unaligned little endian buffer and arithmetic types use regular loads and stores when the size is exact. This makes unaligned little endian buffer and arithmetic types significantly more efficient on these architectures.(Pull request from Jeremy Maitin-Shepard) Docs updated, but timing results have not yet been updated.
This commit is contained in:
@ -26,16 +26,26 @@ int cpp_main(int, char *[])
|
||||
{
|
||||
cout << "byte swap intrinsics: " BOOST_ENDIAN_INTRINSIC_MSG << endl;
|
||||
|
||||
cout << " construct" << endl;
|
||||
cout << " construct big endian aligned" << endl;
|
||||
bel::big_int32_buf_t x(1122334455);
|
||||
|
||||
cout << " assign from built-in integer" << endl;
|
||||
cout << " assign to buffer from built-in integer" << endl;
|
||||
x = 1234567890;
|
||||
|
||||
cout << " operator==(buffer, built-in)" << endl;
|
||||
cout << " operator==(buffer.value(), built-in)" << endl;
|
||||
bool b1(x.value() == 1234567890);
|
||||
BOOST_TEST(b1);
|
||||
|
||||
cout << " construct little endian unaligned" << endl;
|
||||
bel::little_int32_buf_ut x2(1122334455);
|
||||
|
||||
cout << " assign to buffer from built-in integer" << endl;
|
||||
x2 = 1234567890;
|
||||
|
||||
cout << " operator==(buffer.value(), built-in)" << endl;
|
||||
bool b2(x2.value() == 1234567890);
|
||||
BOOST_TEST(b2);
|
||||
|
||||
cout << " done" << endl;
|
||||
|
||||
return ::boost::report_errors();
|
||||
|
Reference in New Issue
Block a user