llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

AARCH64 big endian accuracy problem of float complex division

Open Neilzhangtianhao opened this issue 3 years ago • 2 comments

Hello, I’m tring to use llvm AARCH64 big endian target toolchain to compile float complex division demo, I find a problem that AARCH64 big endian target is error, AARCH64 little endian target is ok. I wrote like this: LLVM VERSION: 15.0.1 Demo:

 #include <complex>
 #include <cmath>
 #include <cstdlib>
 #include <iostream>

 typedef float A;

 int main(){
    std::complex<A> x (30.0, 40.0);
    std::complex<A> y (40.0, 40.0);

    std::complex<A> res = x / y;

    std::cout << res  << std::endl;
 }

compilation command: AARCH64 big endian target: clang++ -O1 demo.c result: (0.0273438,0.00390625) clang++ -O0 demo.c result: (0.875,0.125) clang++ -O1 -fno-inline demo.c result: (0.875,0.125)

AARCH64 little endian target: clang++ -O1 demo.c result: (0.875,0.125)

double complex division is ok in AARCH64 big endian target toolchain

Neilzhangtianhao avatar Aug 14 '23 06:08 Neilzhangtianhao

@llvm/issue-subscribers-backend-aarch64

llvmbot avatar Aug 14 '23 14:08 llvmbot

Please could you provide more information about the toolchain that you are using and how to reproduce this?

tommat01 avatar Aug 29 '23 10:08 tommat01