https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63260
Oleg Endo <olegendo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kkojima at gcc dot gnu.org --- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to Oleg Endo from comment #0) > Created attachment 33490 [details] > Proposed patch > > The fabs and fneg insns do not require an FPSCR.PR or FPSCR.SZ mode setting > as they operate on the high part of a double register pair. Thus they are > the same for single and double precision I've tested the proposed patch on sh-sim, there are some new failures: -m4 -mb: FAIL: g++.dg/torture/type-generic-1.C -O0 execution test FAIL: gcc.c-torture/execute/builtins/complex-1.c execution, -O0 FAIL: gcc.c-torture/execute/builtins/complex-1.c execution, -Og -g FAIL: gcc.c-torture/execute/complex-6.c -O0 execution test FAIL: gcc.c-torture/execute/gofast.c -O0 execution test FAIL: gcc.c-torture/execute/ieee/20010114-2.c execution, -O0 FAIL: gcc.c-torture/execute/ieee/20010114-2.c execution, -O1 FAIL: gcc.c-torture/execute/ieee/20010114-2.c execution, -Og -g FAIL: gcc.c-torture/execute/ieee/20030331-1.c execution, -O0 FAIL: gcc.c-torture/execute/ieee/copysign1.c execution, -O0 FAIL: gcc.c-torture/execute/ieee/mzero3.c execution, -O0 FAIL: gcc.dg/torture/type-generic-1.c -O0 execution test -m4 -ml: FAIL: g++.dg/torture/type-generic-1.C -O0 execution test FAIL: g++.dg/torture/type-generic-1.C -O1 execution test FAIL: g++.dg/torture/type-generic-1.C -O2 execution test FAIL: g++.dg/torture/type-generic-1.C -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test FAIL: g++.dg/torture/type-generic-1.C -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: g++.dg/torture/type-generic-1.C -O3 -fomit-frame-pointer execution test FAIL: g++.dg/torture/type-generic-1.C -O3 -g execution test FAIL: g++.dg/torture/type-generic-1.C -Os execution test FAIL: gcc.c-torture/execute/builtins/complex-1.c execution, -O0 FAIL: gcc.c-torture/execute/builtins/complex-1.c execution, -Og -g FAIL: gcc.c-torture/execute/complex-6.c -O0 execution test FAIL: gcc.c-torture/execute/conversion.c -O0 execution test FAIL: gcc.c-torture/execute/gofast.c -O0 execution test FAIL: gcc.c-torture/execute/ieee/20010114-2.c execution, -O0 FAIL: gcc.c-torture/execute/ieee/20010114-2.c execution, -O1 FAIL: gcc.c-torture/execute/ieee/20010114-2.c execution, -Og -g FAIL: gcc.c-torture/execute/ieee/20030331-1.c execution, -O0 FAIL: gcc.c-torture/execute/ieee/copysign1.c execution, -O0 FAIL: gcc.c-torture/execute/ieee/mzero3.c execution, -O0 FAIL: gcc.dg/pr28796-2.c execution test FAIL: gcc.dg/torture/fp-int-convert-float.c -O0 execution test FAIL: gcc.dg/torture/fp-int-convert-float.c -O1 execution test FAIL: gcc.dg/torture/fp-int-convert-float.c -O2 execution test FAIL: gcc.dg/torture/fp-int-convert-float.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test FAIL: gcc.dg/torture/fp-int-convert-float.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: gcc.dg/torture/fp-int-convert-float.c -O3 -fomit-frame-pointer execution test FAIL: gcc.dg/torture/fp-int-convert-float.c -O3 -g execution test FAIL: gcc.dg/torture/fp-int-convert-float.c -Os execution test FAIL: gcc.dg/torture/type-generic-1.c -O0 execution test FAIL: gcc.dg/torture/type-generic-1.c -O1 execution test FAIL: gcc.dg/torture/type-generic-1.c -O2 execution test FAIL: gcc.dg/torture/type-generic-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test FAIL: gcc.dg/torture/type-generic-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: gcc.dg/torture/type-generic-1.c -O3 -fomit-frame-pointer execution test FAIL: gcc.dg/torture/type-generic-1.c -O3 -g execution test FAIL: gcc.dg/torture/type-generic-1.c -Os execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O0 execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O1 execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O2 execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O3 -fomit-frame-pointer execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O3 -fomit-frame-pointer -funroll-loops execution test FAIL: gcc.dg/torture/vec-cvt-1.c -O3 -g execution test FAIL: gcc.dg/torture/vec-cvt-1.c -Os execution test This seems to be due to the implementation in GDB. sim/sh/interp.c: #define FP_UNARY(n, OP) \ { \ if (FPSCR_PR) \ { \ if ((n) & 1) \ RAISE_EXCEPTION (SIGILL); \ else \ SET_DR (n, (OP (DR (n)))); \ } \ else \ SET_FR (n, (OP (FR (n)))); \ } while (0) sim/sh/gencode.c: /* sh2e */ { "", "", "fabs <FREG_N>", "1111nnnn01011101", "FP_UNARY (n, fabs);", "/* FIXME: FR (n) &= 0x7fffffff; */", /* sh2e */ { "", "", "fneg <FREG_N>", "1111nnnn01001101", "FP_UNARY (n, -);", }, As the FIXME in the fabs code above suggests, fabs and fneg there are treated like a real unary FP operations, which seems not entirely accurate. I think GDB's sh-sim needs a patch for that. Kaz, could you please add the proposed patch to your test run and let me know of the result? I'd like to sort this out before proceeding with PR 53513.