[PATCH] cipher: Fix SM3 avx/bmi2 compilation error

Tianjia Zhang tianjia.zhang at linux.alibaba.com
Wed Dec 22 03:50:33 CET 2021


Hi Jussi,

On 12/21/21 12:49 AM, Jussi Kivilinna wrote:
> Hello,
> 
> On 20.12.2021 5.23, Tianjia Zhang via Gcrypt-devel wrote:
>> * cipher/sm3-avx-bmi2-amd64.S: Fix assembler errors.
>>
>> -- 
>>
>> There are a lot of the following errors compiling with GNU assembler
>> version 2.27-41:
>>
>>    sm3-avx-bmi2-amd64.S: Assembler messages:
>>    sm3-avx-bmi2-amd64.S:402: Error: 0xf3988a32 out range of signed
>>      32bit displacement
>>
>> The newer GNU assembler does not have this issue. It is likely that
>> the old version of the assembler did not handle it well, but in order
>> to allow libgcrypt to be compiled on more systems, I still fixed this
>> problem, an additional add operation is added to the lea instruction
>> to calculate the sum of three elements. I did a benchmark test on an
>> Intel i5-6200U 2.30GHz CPU and found no significant performance
>> difference.
> 
> 
> Thanks for reporting. However, I think this can be fixed by changing
> K0-K63 macros from hex-format to signed decimal values. Patch attached.
> 

I'm very sorry, I was too careless, didn't notice that you have attached 
the patch.

Best regards,
Tianjia



More information about the Gcrypt-devel mailing list