[PATCH][AArch64][PR20319] Prevent undefined FMOV instructions.
Egeyar Bagcioglu
egeyar.bagcioglu@oracle.com
Wed Jun 6 13:26:00 GMT 2018
Hello,
The attached patch is essentially the patch Nick proposed two years ago
to fix pr 20319: https://sourceware.org/bugzilla/show_bug.cgi?id=20319
It introduces QL_INT2FP_FMOV and QL_FP2INT_FMOV to be used with fmov
rather than QL_INT2FP and QL_FP2INT so that the instructions of the form
fmov   x0, s0
fmov   s0, x0
fmov   w0, d0
fmov   d0, w0
are not accepted by the assembler.
The differences with the originally proposed patch:
I picked Nick's patch up, re-based it, completed the missing parts of
"verify_fmov" function according to the now-available ARMv8.2
documentation. I've also added the test cases that this function was
checking. As a result, I realized that most of the test-cases already
pass before the patch. Therefore, I trimmed that patch accordingly, down
to the attached patch. It now makes only the necessary changes in the
code; however, preserves the newly-added already-passing test cases.
   [AArch64][PR20319] Prevent undefined FMOV instructions.
   Detect illegal FMOV instructions that changes the size from 32 bits
to 64
   bits and vice versa. Add tests for these and other undefined FMOV
   instructions.
   gas/ChangeLog:
       PR 20319
       * testsuite/gas/aarch64/illegal-3.s: Test if unallocated FMOV
encodings
       are detected as undefined.
       * testsuite/gas/aarch64/illegal-3.d: Likewise.
       * testsuite/gas/aarch64/illegal.s: Test if FMOV instructions
that are
       changing the size from 32 bits to 64 bits and vice versa
trigger an
       error.
       * testsuite/gas/aarch64/illegal.l: Likewise.
   opcodes/ChangeLog:
       PR 20319
       * aarch64-tbl.h: Introduce QL_INT2FP_FMOV and QL_FP2INT_FMOV.
       (aarch64_opcode_table) : Use QL_INT2FP_FMOV and QL_FP2INT_FMOV.
The patch is tested on aarch64-unknown-linux-gnu and introduced no
regressions.
Please take a look and apply if legitimate.
Regards,
Egeyar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr20319.patch
Type: text/x-patch
Size: 6403 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180606/0e3764ab/attachment.bin>
More information about the Binutils
mailing list