[PATCH][AVX512] Add class to group common template arguments related to vector type
Adam Nemet
anemet at apple.com
Mon Aug 18 08:09:52 PDT 2014
Hi Robert,
On Aug 18, 2014, at 1:23 PM, Robert Khasanov <rob.khasanov at gmail.com> wrote:
> Hi Adam,
>
> In addition to Elena's comment, I suggest to add separate mask register classes, e.g. KRC and KRCWM. Mask and cmp instructions writes to all mask registers including k0.
Makes sense, especially that we wouldn't have to rename the uses of KRC to KRCWM when we add KRC.
Adam
>
>
> 2014-08-18 11:31 GMT+04:00 Demikhovsky, Elena <elena.demikhovsky at intel.com>:
> Hi Adam,
>
> Some things that I see:
>
> 1) I suggest to rename EltNum to NumOfElts
>
> 2)
> + // Corresponding write-mask register class.
> + RegisterClass KRC = !cast<RegisterClass>("VK" # EltNum # "WM");
> +
> + // The GPR register class that can hold the write mask.
> + RegisterClass MRC = !cast<RegisterClass>("GR" # EltNum);
>
> VK2 is possible, GR2 is not.
>
> 2) I don't think that default rc is good. Let everybody specify register class explicitly.
> +class X86VectorVTInfo<int EltNum, ValueType EltVT, RegisterClass rc = VR512,
> + string suffix = ""> {
>
> 3) Let's assume that I'm building
> def v16f32_info : X86VectorVTInfo<16, f32, VR512, "ps">
> how FloatVT will look like?
> Do we need IntVT for completeness?
>
> 4) I suggest to add broadcast string {1toX} to the info.
>
>
>
> - Elena
>
>
> -----Original Message-----
> From: Adam Nemet [mailto:anemet at apple.com]
> Sent: Monday, August 18, 2014 09:17
> To: Demikhovsky, Elena; Khasanov, Robert
> Cc: llvm-commits
> Subject: [PATCH][AVX512] Add class to group common template arguments related to vector type
>
> Hi,
>
> We discussed the issue of generality vs. readability of the AVX512 classes recently. I proposed this approach to try to hide and centralize the mappings we commonly perform based on the vector type. A new class X86VectorVTInfo captures these.
>
> The idea is to pass an instance of this class to classes/multiclasses instead of the corresponding ValueType. Then the class/multiclass can use its field for things that derive from the type rather than passing all those as separate arguments.
>
> I modified avx512_valign to demonstrate this new approach. As you can see instead of 7 related template parameters we now have one. The downside is that we have to refer to fields for the derived values. I named the argument '_' in order to make this as invisible as possible. Please let me know if you absolutely hate this. (Also once we allow local initializations in multiclasses we can recover the original version by assigning the fields to local variables.)
>
> Another possible use-case for this class is to directly map things, e.g.:
>
> RegisterClass KRC = X86VectorVTInfo<32, i16>.KRC
>
> Please let me know if it looks good.
>
> Adam
>
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140818/a7e0db94/attachment.html>
More information about the llvm-commits
mailing list