Agner`s CPU blog

Software optimization resources | E-mail subscription to this blog | www.agner.org

Test results for AMD Ryzen
Author: Agner Date: 2017-05-03 00:12
Peter Cordes wrote:
does vxorps-zeroing of a ymm register still only take 1 micro-op? Unlike the non-special case, where vxorps ymm1,ymm2,ymm3 which is split into two?

I'm worried that the special-case of xor-zeroing might not be identified until after the decoder has already split it in two. Or that if it still needs an execution port, ymm zeroing might still use two instead of taking advantage of AVX implicit zero-extension to high lanes.

xor'ing a ymm register with itself generates two micro-ops, while xor'ing an xmm register with itself generates only one micro-op. So you have a point. Zeroing a register as 128 bit and relying on implicit zero extension to 256 bits is faster. The throughput of these is four micro-ops per clock, i.e. four 128 bit xor or two 256 bit xor per clock. These micro-ops go to any of the four floating point units in the Ryzen. There is no dependence on the previous value of the register.
 
thread Test results for AMD Ryzen new - Agner - 2017-05-02
replythread Ryzen analyze new - Daniel - 2017-05-02
last reply Ryzen analyze new - Agner - 2017-05-02
replythread Test results for AMD Ryzen new - Peter Cordes - 2017-05-02
last replythread Test results for AMD Ryzen - Agner - 2017-05-03
last replythread Test results for AMD Ryzen new - Phenominal - 2017-05-06
last replythread Test results for AMD Ryzen new - Agner - 2017-05-06
last replythread Test results for AMD Ryzen new - Phenominal - 2017-05-06
last reply Test results for AMD Ryzen new - Agner - 2017-05-06
replythread Test results for AMD Ryzen new - Tacit Murky - 2017-05-05
last reply Test results for AMD Ryzen new - Tacit Murky - 2017-07-08
replythread Test results for AMD Ryzen--POPCNT new - Xing Liu - 2017-05-08
last reply Test results for AMD Ryzen--POPCNT new - Agner - 2017-05-11
replythread Test results for AMD Ryzen new - Justin - 2017-07-11
last reply EPYC new - Agner - 2017-07-11
replythread Test results for AMD Ryzen new - Lefty - 2017-07-12
last replythread Test results for AMD Ryzen new - Agner - 2017-07-12
replythread Test results for AMD Ryzen new - cvax - 2017-07-13
last reply Test results for AMD Ryzen new - Agner - 2017-07-13
last replythread Test results for AMD Ryzen new - Lefty - 2017-07-13
reply Test results for AMD Ryzen new - Agner - 2017-07-13
last replythread Test results for AMD Ryzen new - Travis - 2017-07-13
last reply Test results for AMD Ryzen new - Johannes - 2017-07-25
last replythread Test results for AMD Ryzen new - Conrad - 2017-09-22
reply Test results for AMD Ryzen new - Agner - 2017-09-22
last reply Test results for AMD Ryzen new - Travis - 2017-09-26