westerndigitalcorporation / swerv-ISS

Western Digital’s Open Source RISC-V SweRV Instruction Set Simulator
200 stars 41 forks source link

Default c++ build flag -mfma causing Illegal Instruction error #19

Closed joeski65 closed 4 years ago

joeski65 commented 4 years ago

This flag makes the compiler generate code that takes advantage of the UltraSPARC Fused Multiply-Add Floating-point instructions.

This causes cryptic 'Illegal Instruction' errors on CPU's that don't support this (which has proved to be plentiful). Can this not be made default, please?

Thanks.

jrahmeh commented 4 years ago

No problem. I will remove it. It seems to work on x86. On which processor does it not work?

jrahmeh commented 4 years ago

Removed -fmfa from GNUmakefile

joeski65 commented 4 years ago

No problem. I will remove it. It seems to work on x86. On which processor does it not work?

Thanks! The behaviour changes slightly depending on processor, some give illegal instructions when constructing static variables, others give it right at the end after successful execution of a program. Two examples respectively: Intel(R) Xeon(R) CPU E5-2650 Intel(R) Xeon(R) CPU X5670