Hi, On Tue, May 08, 2018 at 05:04:33PM -0700, Carl Love wrote: > On Tue, 2018-05-08 at 11:24 -0500, Segher Boessenkool wrote: > > What ISA version is required for the TH field to do anything? Will > > it work on older machines too (just ignored)? What assembler version > > is required? > > I went back and checked. The mnemonics for > > dcbtt RA,RB dcbt for TH value of 0b10000 > dcbtstt RA,RB dcbtst for TH value of 0b10000. > > were introduced in ISA 2.06.
So we need a check for that. TH=0b10000 is new in ISA 2.06 as well. For older CPUs the hint is undefined. I think we can assume that all assemblers for which we can compile with -mcpu=power7 will support the 3-argument form of dcbt, and have dcbtt etc. as well. So you just need to test for TARGET_POPCNTD I think? > There is another pair of mnemonics > > dcbtds RA,RB,TH dcbt for TH values of 0b00000 or > 0b01000 - 0b01111; > other TH values are invalid. > > dcbtstds RA,RB,TH dcbtst for TH values of 0b00000 > or 0b01000 - 0b01010; > other TH values are invalid. > > that could be used instead. These are both supported starting with > ISA 2.05. The dcbtds is actually supported back to ISA 2.03 but the > dcbtstds is not. Those do not cover 0b10000. > #ifndef HAVE_AS_POPCNTB > > #undef TARGET_POPCNTB > > #define TARGET_POPCNTB 0 > > #endif > > I haven't found anything that I could use specifically for Power 7 and > newer. Not sure if it is worth defining a HAVE_AS_DCBTT to do > something similar? Seems a bit over kill. Thoughts on how to limit > the generation of dcbtt and dcbtstt to Power 7 or newer? There is TARGET_POPCNTD. (TARGET_POPCNTB is for ISA 2.02). Segher