toolchain icon indicating copy to clipboard operation
toolchain copied to clipboard

ARC64: fp-int-convert-timode-* fails in Linux

Open claziss opened this issue 3 years ago • 6 comments

Investigate why they are failing:

FAIL: gcc.dg/torture/fp-int-convert-timode-3.c   -O0  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c   -O1  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c   -O2  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c   -O3 -g  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c   -Os  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c   -O0  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c   -O1  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c   -O2  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c   -O3 -g  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c   -Os  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  execution test
FAIL: gcc.dg/torture/fp-int-convert-timode-4.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  execution test

claziss avatar Jul 02 '21 10:07 claziss

It seems the fesetround is not implemented. This is what the compiler is showing: fp-int-convert-timode-3.c:(.text+0x68): warning: fesetround is not implemented and will always fail

claziss avatar Jul 05 '21 12:07 claziss

The linker warning is benign - for soft-float builds we always get them (even in ARCv2) and still have no extraneous failures in ARCv2 or ARCv3. You need to triage the real problem.

vineetgarc avatar Jul 06 '21 17:07 vineetgarc

Without a proper implementation of fesetround the tests are bound to fail. Moreover, the tests are also failing whenever we relay on soft-fp implementation, regardless if fesetround is implemented.

claziss avatar Jul 07 '21 09:07 claziss

Without a proper implementation of fesetround the tests are bound to fail. Moreover, the tests are also failing whenever we relay on soft-fp implementation, regardless if fesetround is implemented.

glibc soft-fp only implements FE_TONEAREST. And since the test uses FE_UPWARD it is bound to fail. The reason it doesn't fail for ARCv2 is int128 is not supported so the test is not even build there. These need to be marked XFAIL for soft-fp (I'm surprised they are not already)

int
__fesetround (int round)
{
#ifdef FE_TONEAREST
  return (round == FE_TONEAREST) ? 0 : 1;
#else
  return 1;	/* Signal we are unable to set the direction.  */
#endif
}

vineetgarc avatar Jul 07 '21 20:07 vineetgarc

With my glibc hard-float build, it seems to be hitting abort() due to conversion failures: this needs investigation whether gcc is generating the right 128-bit conversion etc.

float fs = s128; if (fs != -0x1.fffffep+126) abort (); double ds = s128; if (ds != -0x1.fffffffffffffp+126) abort ();

vineetgarc avatar Jul 07 '21 21:07 vineetgarc

I suppose the conversion still relay on soft implementation. Hence, the error.

claziss avatar Jul 08 '21 05:07 claziss

These tests are now stated as UNSUPPORTED.

These tests were modified to require the use of hard floating point, as shown in:

commit ff01849dccd4355ac6491c04eff8b2e39ecee70e
Author: Vineet Gupta <[email protected]>
Date:   Sun Jun 26 15:03:52 2022 -0400

    [PATCH] testsuite: constraint some of fp tests to hard_float
    
    These tests validate fp conversions with various rounding modes which
    would not work on soft-float ABIs.
    
    On -march=rv64imac/-mabi=lp64 this reduces 5 unique failures (overall 35
    due to multi flag combination builds)
    
    gcc/testsuite/Changelog:
            * gcc.dg/torture/fp-double-convert-float-1.c: Add
            dg-require-effective-target hard_float.
            * gcc.dg/torture/fp-int-convert-timode-3.c: Ditto.
            * gcc.dg/torture/fp-int-convert-timode-4.c: Ditto.
            * gcc.dg/torture/fp-uint64-convert-double-1.c: Ditto.
            * gcc.dg/torture/fp-uint64-convert-double-2.c: Ditto.

However, since this feature is not implemented yet, it has led to the UNSUPPORTED output in the new dejagnu result:

UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c   -O0 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c   -O1 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c   -O2 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c   -O3 -g 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c   -Os 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c   -O0 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c   -O1 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c   -O2 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c   -O3 -g 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c   -Os 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none 
UNSUPPORTED: gcc.dg/torture/fp-int-convert-timode-4.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects

luismgsilva avatar May 19 '23 11:05 luismgsilva