IMPALA-4058: ByteSwap256 assumed memory was 16-byte aligned.

This changes the code to use the lddqu and movdqu instructions (via
Intel intrinsics) to allow unaligned memory access.

Change-Id: I39b2b47bb717d5ac9727512a24fcf8a8a6a8dcc6
Reviewed-on: http://gerrit.cloudera.org:8080/4205
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Reviewed-by: Dan Hecht <dhecht@cloudera.com>
Tested-by: Internal Jenkins
This commit is contained in:
Jim Apple
2016-09-01 05:53:42 -07:00
committed by Internal Jenkins
parent a60ba6d274
commit 20ef3b016e
4 changed files with 43 additions and 13 deletions

View File

@@ -2482,3 +2482,15 @@ select cast('1.23' as double), cast('.1.23' as float), cast('123.456.' as double
---- TYPES
double,float,double,double,float,double
====
---- QUERY
# IMPALA-4058: reverse assumed memory was 16-byte aligned; reverse 16, 17, 32, 33, and 64
# byte strings
select reverse('123456789abcdef0'), reverse('123456789abcdef01'),
reverse('123456789abcdef0!@#$%^&*(ABCDEF)'),
reverse('123456789abcdef0!@#$%^&*(ABCDEF)`'),
reverse('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ345678901234')
---- RESULTS
'0fedcba987654321','10fedcba987654321',')FEDCBA(*&^%$#@!0fedcba987654321','`)FEDCBA(*&^%$#@!0fedcba987654321','432109876543ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba'
---- TYPES
STRING,STRING,STRING,STRING,STRING
====