On Thu, 2 May 2019 at 03:14, Maciej Rozycki <ma...@wdc.com> wrote:
>
> From: Maciej W. Rozycki <ma...@wdc.com>
>
> Fix assembly errors:
>
> .../libphobos/src/std/math.d: Assembler 
> messages:.../libphobos/src/std/math.d:4773: Error: unrecognized opcode 
> `frflags a0'
> .../libphobos/src/std/math.d:4856: Error: unrecognized opcode `fsflags a5'
> .../libphobos/src/std/math.d:4856: Error: unrecognized opcode `fsflags a5'
> .../libphobos/src/std/math.d:4773: Error: unrecognized opcode `frflags a0'
> .../libphobos/src/std/math.d:5549: Error: unrecognized opcode `fscsr a5'
> .../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a5'
> .../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a5'
> .../libphobos/src/std/math.d:5549: Error: unrecognized opcode `fscsr a5'
> .../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a5'
> .../libphobos/src/std/math.d:5549: Error: unrecognized opcode `fscsr a0'
> .../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a0'
> .../libphobos/src/std/math.d:5456: Error: unrecognized opcode `frcsr a0'
> .../libphobos/src/std/math.d:5549: Error: unrecognized opcode `fscsr s2'
> make[8]: *** [Makefile:1119: std/math.lo] Error 1
>
> triggered with the RISC-V lp64 multilib in a GCC build configured with
> `--enable-multilib --enable-languages=all --target=riscv64-linux-gnu'.
> This is due to unconditional explicit use of F extension instructions
> within inline assembly, to access IEEE exception flags.  The use of
> these instructions is not allowed when building for a soft-float ABI.
>
> Correct the problem by wrapping said inline assembly into a conditional
> such that if `D_SoftFloat' is true, then reads from IEEE exception flags
> return 0 and writes are ignored instead, complementing r270522
> ("libphobos: Add D support for RISC-V Linux"), which is an updated
> version of <https://gcc.gnu.org/ml/gcc-patches/2019-04/msg00325.html>,
> where the problematic code has originated from.
>
>         libphobos/
>         * std/math.d (IeeeFlags.getIeeeFlags): Handle RISC-V soft-float
>         ABI.
>         (IeeeFlags.resetIeeeFlags): Likewise.
>         (FloatingPointControl.getControlState): Likewise.
>         (FloatingPointControl.setControlState): Likewise.
> ---
> Hi,
>
>  I believe this change is obviously correct, and I also verified generated
> code using `objdump -d'.  I have no way to regression-test it right now.
>
>  Please confirm if I correctly referred to identifiers in the ChangeLog
> entry though, as my experience WRT the D programming language and its
> syntax in particular is nil.
>
>  My understanding is changes to `libphobos' are supposed to go upstream
> first, but r270522 is a local change anyway AFAICT, and technically a
> `--enable-languages=all' build regression, so we better fix it ASAP.
>
>  Finally my WDC copyright assignment with FSF is still in the works, but I
> believe this change can be considered legally insignificant for copyright
> purposes, i.e. having at most 15 lines or so, unless adding white space
> for indentation counts against that limit as well (which I doubt).
>
>  With all of the above in mind, OK to apply to trunk and to GCC 9?
>

Hi,

Looks OK to me.

--
Iain.

Reply via email to