On Tue, Aug 22, 2023 at 9:54 PM Jakub Jelinek <ja...@redhat.com> wrote: > > On Tue, Aug 22, 2023 at 09:35:44PM +0800, Hongtao Liu wrote: > > Ok, then we can't avoid TARGET_AVX10_1 in those existing 256/128-bit > > evex instruction patterns. > > Why? > Internally for md etc. purposes, we should have the current > TARGET_AVX512* etc. ISA flags, plus one new one, whatever we call it > (TARGET_EVEX512 even if it is not completely descriptive because of kandq > etc., or some other name) which says if 512-bit vector modes can be used, > if g modifier can be used, if the 64-bit mask operations can be used etc. > Plus, if AVX10.1 contains any instructions not covered in the preexisting > TARGET_AVX512* sets, TARGET_AVX10_1 which covers that delta, otherwise > keep -mavx10.1 just as an command line option which enables/disables Let's assume there's no detla now, AVX10.1-512 is equal to AVX512{F,VL,BW,DQ,CD,BF16,FP16,VBMI,VBMI2,VNNI,IFMA,BITALG, VPOPCNTDQ} > other stuff. > The current common/config/i386/i386-common.cc OPTION_MASK_ISA*SET* would be > like now, except that the current AVX512* sets imply also EVEX512/whatever > it will be called, that option itself enables nothing (or TARGET_AVX512F), > and unsetting it doesn't disable all the TARGET_AVX512*. > -mavx10.1 would enable the AVX512* sets without EVEX512/whatever. So for -mavx512bw -mavx10.1-256, -mavx512bw will set EVEX512, but -mavx10.1-256 doesn't clear EVEX512 but just enable all AVX512* sets?. then the combination basically is equal to AVX10.1-512(AVX512* sets + EVEX512) If this is your assumption, yes, there's no need for TARGET_AVX10_1. (My former understanding is that you want -mavx512bw -mavx10.1-256 enable all 128/256/scalar invariants but only avx512bw 512-bit invariants, this can't be done without TARGET_AVX10_1). So the whole point is -mavx10.x-256 shouldn't clear nor set EVEX512, and -mavx10.x-512 should set EVEX512. > At the end of the option processing, if EVEX512/whatever is set but > TARGET_AVX512VL is not, disable TARGET_AVX512F with all its dependencies, > because VL is a precondition of 128/256-bit EVEX and if 512-bit EVEX is not > enabled, there is nothing left. There's scalar evex instruction under TARGET_AVX512F(and other non-avx512vl) w/o EVEX512, not nothing left. > > Jakub >
-- BR, Hongtao