[PATCH] Check for invalid NEON type qualifiers

Daniel Gutson dgutson@codesourcery.com
Fri Dec 25 08:53:00 GMT 2009


The attached patch adds some validations for detecting NEON type 
qualifiers used with non-NEON instructions to GAS.

I added and set the is_neon flag in the most primitive functions that 
all the neon encoding functions called, so if new neon instructions 
appear in the future, the flag would be also set if the same primitives 
are used.

I tested this patch by runnint the ld, binutils, and gas testsuites, the 
latter including a new test case I added.

Please let me know if OK to commit.

Thanks,
	Daniel.

ChangeLog:
2009-12-25  Daniel Gutson  <dgutson@codesourcery.com>

     gas/
     * config/tc-arm.c (struct arm_it): New flag 'is_neon'.
     (NEON_ENC_*): Macros renamed to _NEON_ENC_*.
     (NEON_ENCODE): New macro.
     (check_neon_suffixes): New macro.
     (do_vfp_cond_or_thumb): Set the 'is_neon' flag.
     (do_vfp_nsyn_opcode): Likewise.
     (do_vfp_nsyn_nmul): Use the new 'NEON_ENCODE' macro.
     (do_vfp_nsyn_cmp): Likewise.
     (do_neon_shl_imm): Likewise.
     (do_neon_qshl_imm): Likewise.
     (neon_dyadic_misc): Likewise.
     (do_neon_mac_maybe_scalar): Likewise.
     (do_neon_qdmulh): Likewise.
     (do_neon_qmovn): Likewise.
     (do_neon_qmovun): Likewise.
     (do_neon_movn): Likewise.
     (neon_mac_reg_scalar_long): Likewise.
     (do_neon_vmull): Likewise.
     (do_neon_trn): Likewise.
     (do_neon_ldx_stx): Likewise.
     (neon_dp_fixup): Changed signature and set the flag.
     (neon_three_same): Call the above with new signature.
     (neon_two_same): Likewise.
     (neon_imm_shift): Likewise.
     (neon_mul_mac): Likewise.
     (do_neon_abs_neg): Likewise.
     (neon_mixed_length): Likewise.
     (do_neon_ext): Likewise.
     (do_neon_mov): Likewise.
     (do_neon_tbl_tbx): Likewise.
     (do_neon_logic): Likewise, and use the new 'NEON_ENCODE' macro.
     (neon_compare): Likewise.
     (do_neon_shll): Likewise.
     (do_neon_cvt): Likewise.
     (do_neon_mvn): Likewise.
     (do_neon_dup): Likewise.
     (md_assemble): Call check_neon_suffixes ().

     gas/testsuite/
     * gas/arm/neon-suffix-bad.d: New test case.
     * gas/arm/neon-suffix-bad.s: New file.
     * gas/arm/neon-suffix-bad.l: New file.

-- 
Daniel Gutson
CodeSourcery
www.codesourcery.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: neon_suffixes.patch
Type: text/x-diff
Size: 22269 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20091225/6d31ed21/attachment.bin>


More information about the Binutils mailing list