This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 20 June 2012 12:29, Julian Brown <julian@codesourcery.com> wrote: > On Wed, 20 Jun 2012 11:56:39 +0100 > Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> wrote: > >> Hi, >> >> This patch helps use the __builtin_shuffle intrinsics to implement the >> Neon permute intrinsics following on from Julian's and my patch last >> week. It needed support for __builtin_shuffle in the C++ frontend >> which is now in and has been for the past few days , so I'm a little >> happier with this going in now.The changes to Julian's patch are to >> drop the "mask" generation and now this directly generates the vector >> constants instead. > > A small stylistic point I noticed: in, > > let rec print_lines = function > [] -> () > - | [line] -> Format.printf "%s" line > - | line::lines -> Format.printf "%s@," line; print_lines lines in > + | [line] -> if line <> "" then Format.printf "%s" line else () > + | line::lines -> (if line <> "" then Format.printf "%s@," line); > print_lines lines in > print_lines body; close_braceblock ffmt; > end_function ffmt > > You can use constant strings in pattern matches, so this can be just: > > let rec print_lines = function > [] | ""::_ -> () > | [line] -> Format.printf... > | line::lines -> Format.printf... > > You didn't need the brackets () around the if, btw. It's semantically > quite like C: only a single statement after the "then" is conditional. > If you want multiple statements conditionalised, the idiomatic > way to do it is use begin...end (equivalent to { } in C) after the then > keyword. > This is what I committed finally. 2012-07-05 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> Julian Brown <julian@codesourcery.com> PR target/49891 PR target/51980 * config/arm/neon-gen.ml (return_by_ptr): Delete. (print_function): Handle empty strings. (return): Delete use of return_by_ptr. (mask_shape_for_shuffle): New function. (mask_elems): Likewise. (shuffle_fn): Likewise. (params): Simplify and remove use of return_by_ptr. (get_shuffle): New function. (print_variant): Update. * config/arm/neon.ml (rev_elems): New function. (permute_range): Likewise. (zip_range): Likewise. (uzip_range): Likewise. (trn_range): Likewise. (zip_elems): Likewise. (uzip_elems): Likewise. (trn_elems): Likewise. (features): New enumeration Use_shuffle. Delete ReturnPtr. (pf_su_8_16): New. (suf_32): New. (ops): Update entries for Vrev64, Vrev32, Vrev16, Vtr, Vzip, Vuzp. * config/arm/arm_neon.h: Regenerate. 2012-07-05 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> PR target/49891 PR target/51980 * gcc/testsuite/gcc.target/arm/neon/vtrnf32.c: Update. * gcc/testsuite/gcc.target/arm/neon/vtrns32.c: Update. * gcc/testsuite/gcc.target/arm/neon/vtrnu32.c: Update. * gcc/testsuite/gcc.target/arm/neon/vzipf32.c: Update. * gcc/testsuite/gcc.target/arm/neon/vzips32.c: Update. * gcc/testsuite/gcc.target/arm/neon/vzipu32.c: Update. Ramana > HTH, > > Julian
Attachment:
final-neon-shuffles-patch.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |