d: Add `@simd` and `@simd_clones` attributes to compiler and library
commit6201277441db4023b833e6d643de8077fe38ed6e
authorIain Buclaw <ibuclaw@gdcproject.org>
Sat, 25 Jun 2022 13:06:43 +0000 (25 15:06 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Tue, 28 Jun 2022 17:05:42 +0000 (28 19:05 +0200)
treef352e3cda43ffefe86c022ec52655ebee1dc9f89
parented06274eacc17a224b87f23111d7ca874ea53b7c
d: Add `@simd` and `@simd_clones` attributes to compiler and library

The `@simd` attribute is equivalent to `__attribute__((simd))`, and
`@simd_clones` is a convenience alias to allow specifying whether the
compiler should generated masked or non-masked simd clones.

gcc/d/ChangeLog:

* d-attribs.cc (handle_omp_declare_simd_attribute): New function.
(d_handle_simd_attribute): New function.
(d_langhook_common_attribute_table): Add 'omp declare simd' attribute.
(d_langhook_attribute_table): Add simd attribute.

libphobos/ChangeLog:

* libdruntime/gcc/attributes.d (simd): Define.

gcc/testsuite/ChangeLog:

* gdc.dg/attr_simd1.d: New test.
* gdc.dg/attr_simd2.d: New test.
gcc/d/d-attribs.cc
gcc/testsuite/gdc.dg/attr_simd1.d [new file with mode: 0644]
gcc/testsuite/gdc.dg/attr_simd2.d [new file with mode: 0644]
libphobos/libdruntime/gcc/attributes.d