The ordering of registers in BinaryRRF instructions are wrong, and affects the copysign instruction (CPSDR). This results in the wrong magnitude and sign being set.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
A simple testcase is:
#include <stdio.h> #include <cmath> double cpsdr(double a, double b) { return copysign(a,b); } double a = 1.0; double b = -2.0; int main () { printf("ret is %lf\n", cpsdr(a, b)); return 0; }
The expected result is -1.0, but the return of clang is 2.0.