http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60446

            Bug ID: 60446
           Summary: [PATCH] [TIC6X] implementing abssf2/absdf2 insns,
                    _fabs/_fabsf/__builtin_c6x_fabs/__builtin_c6x_fabsf
                    intrinsics
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wojtek.golf at interia dot pl
              Host: Linux wmigda-desktop 3.11.0-13-generic #20-Ubuntu SMP
                    Wed Oct 23 17:26:33 UTC 2013 i686 i686 i686 GNU/Linux
            Target: tic6x-none-elf
             Build: tic6x-none-elf-gcc-4.8.3 (GCC) 4.8.3 20140303
                    (prerelease)

TI's SPRU187u document lists _fabs and _fabsf intrinsics, being resolved to
absdp and abssp, respectively. TIC6X machine definition lacks specification of
abs:SF and abs:DF alike instructions and _fabs/_fabsf intrinsics. This patch is
intended to amend that.

According to SPRUFE8B abssp and absdp are available for C67 family (TARGET_FP).

gcc already can inline fabs/fabsf but these require the <math.h> header. When
implemented, __builtin_c6x_fabs/__builtin_c6x_fabsf may be used without pulling
in any headers, or _fabs/_fabsf when c6x_intrinsics.h is included.

ChangeLog
2014-03-06  Wojciech Migda  <wojtek.g...@interia.pl>

    * gcc/config/c6x/c6x.c: added __builtin_c6x_fabs{,f} intrinsics.
    * gcc/config/c6x/c6x.md: added abssf2/absdf2 instructions.
    * gcc/config/c6x/c6x_intrinsics.h: definitions for _fabs and _fabsf.
    * gcc/testsuite/gcc.target/tic6x/fpabs-scan.c: new testcases for fabs,
    _fabs, and __builtin_c6x_fabs, as well as their 'float' variants.

Bootstrapping and testing
Host: Linux wmigda-desktop 3.11.0-13-generic #20-Ubuntu SMP Wed Oct 23 17:26:33
UTC 2013 i686 i686 i686 GNU/Linux
Target: tic6x-none-elf
Results for the new testcases (run with make check-gcc
RUNTESTFLAGS="CFLAGS_FOR_TARGET='$CFLAGS_FOR_TARGET
--sysroot=${CXTOOLS}${TRIPLET}/sysroot' -v -v tic6x.exp")

PASS: gcc.target/tic6x/fpabs-scan.c (test for excess errors)
PASS: gcc.target/tic6x/fpabs-scan.c scan-assembler-times abssp 3
PASS: gcc.target/tic6x/fpabs-scan.c scan-assembler-times absdp 3

Patch attached.
Thanks.

Reply via email to