1# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py 2# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=x86-64 -iterations=100 -resource-pressure=false -timeline -timeline-max-iterations=3 < %s | FileCheck %s 3 4# movss/movsd explicitly zeroes out the high bits of xmm, 5# so addps can start immediately, without waiting for sqrtss to finish. 6# AMD SOG for the AMD family 10h and 12h processors, 4.8 Partial-Register Writes 7 8# LLVM-MCA-BEGIN 9sqrtss %xmm0, %xmm0 10movss (%eax), %xmm0 11addps %xmm0, %xmm0 12# LLVM-MCA-END 13 14# LLVM-MCA-BEGIN 15sqrtsd %xmm0, %xmm0 16movsd (%eax), %xmm0 17addps %xmm0, %xmm0 18# LLVM-MCA-END 19 20# CHECK: [0] Code Region 21 22# CHECK: Iterations: 100 23# CHECK-NEXT: Instructions: 300 24# CHECK-NEXT: Total Cycles: 1403 25# CHECK-NEXT: Total uOps: 300 26 27# CHECK: Dispatch Width: 4 28# CHECK-NEXT: uOps Per Cycle: 0.21 29# CHECK-NEXT: IPC: 0.21 30# CHECK-NEXT: Block RThroughput: 14.0 31 32# CHECK: Instruction Info: 33# CHECK-NEXT: [1]: #uOps 34# CHECK-NEXT: [2]: Latency 35# CHECK-NEXT: [3]: RThroughput 36# CHECK-NEXT: [4]: MayLoad 37# CHECK-NEXT: [5]: MayStore 38# CHECK-NEXT: [6]: HasSideEffects (U) 39 40# CHECK: [1] [2] [3] [4] [5] [6] Instructions: 41# CHECK-NEXT: 1 14 14.00 sqrtss %xmm0, %xmm0 42# CHECK-NEXT: 1 6 0.50 * movss (%eax), %xmm0 43# CHECK-NEXT: 1 3 1.00 addps %xmm0, %xmm0 44 45# CHECK: Timeline view: 46# CHECK-NEXT: 0123456789 0123456789 47# CHECK-NEXT: Index 0123456789 0123456789 01234 48 49# CHECK: [0,0] DeeeeeeeeeeeeeeER . . . . . . sqrtss %xmm0, %xmm0 50# CHECK-NEXT: [0,1] DeeeeeeE--------R . . . . . . movss (%eax), %xmm0 51# CHECK-NEXT: [0,2] D======eeeE-----R . . . . . . addps %xmm0, %xmm0 52# CHECK-NEXT: [1,0] D==============eeeeeeeeeeeeeeER . . . sqrtss %xmm0, %xmm0 53# CHECK-NEXT: [1,1] .DeeeeeeE---------------------R . . . movss (%eax), %xmm0 54# CHECK-NEXT: [1,2] .D======eeeE------------------R . . . addps %xmm0, %xmm0 55# CHECK-NEXT: [2,0] .D===========================eeeeeeeeeeeeeeER sqrtss %xmm0, %xmm0 56# CHECK-NEXT: [2,1] .DeeeeeeE-----------------------------------R movss (%eax), %xmm0 57# CHECK-NEXT: [2,2] . D======eeeE-------------------------------R addps %xmm0, %xmm0 58 59# CHECK: Average Wait times (based on the timeline view): 60# CHECK-NEXT: [0]: Executions 61# CHECK-NEXT: [1]: Average time spent waiting in a scheduler's queue 62# CHECK-NEXT: [2]: Average time spent waiting in a scheduler's queue while ready 63# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage 64 65# CHECK: [0] [1] [2] [3] 66# CHECK-NEXT: 0. 3 14.7 8.0 0.0 sqrtss %xmm0, %xmm0 67# CHECK-NEXT: 1. 3 1.0 1.0 21.3 movss (%eax), %xmm0 68# CHECK-NEXT: 2. 3 7.0 0.3 18.0 addps %xmm0, %xmm0 69# CHECK-NEXT: 3 7.6 3.1 13.1 <total> 70 71# CHECK: [1] Code Region 72 73# CHECK: Iterations: 100 74# CHECK-NEXT: Instructions: 300 75# CHECK-NEXT: Total Cycles: 2103 76# CHECK-NEXT: Total uOps: 300 77 78# CHECK: Dispatch Width: 4 79# CHECK-NEXT: uOps Per Cycle: 0.14 80# CHECK-NEXT: IPC: 0.14 81# CHECK-NEXT: Block RThroughput: 21.0 82 83# CHECK: Instruction Info: 84# CHECK-NEXT: [1]: #uOps 85# CHECK-NEXT: [2]: Latency 86# CHECK-NEXT: [3]: RThroughput 87# CHECK-NEXT: [4]: MayLoad 88# CHECK-NEXT: [5]: MayStore 89# CHECK-NEXT: [6]: HasSideEffects (U) 90 91# CHECK: [1] [2] [3] [4] [5] [6] Instructions: 92# CHECK-NEXT: 1 21 21.00 sqrtsd %xmm0, %xmm0 93# CHECK-NEXT: 1 6 0.50 * movsd (%eax), %xmm0 94# CHECK-NEXT: 1 3 1.00 addps %xmm0, %xmm0 95 96# CHECK: Timeline view: 97# CHECK-NEXT: 0123456789 0123456789 0123456789 98# CHECK-NEXT: Index 0123456789 0123456789 0123456789 012345 99 100# CHECK: [0,0] DeeeeeeeeeeeeeeeeeeeeeER . . . . . . . . . sqrtsd %xmm0, %xmm0 101# CHECK-NEXT: [0,1] DeeeeeeE---------------R . . . . . . . . . movsd (%eax), %xmm0 102# CHECK-NEXT: [0,2] D======eeeE------------R . . . . . . . . . addps %xmm0, %xmm0 103# CHECK-NEXT: [1,0] D=====================eeeeeeeeeeeeeeeeeeeeeER. . . . . sqrtsd %xmm0, %xmm0 104# CHECK-NEXT: [1,1] .DeeeeeeE-----------------------------------R. . . . . movsd (%eax), %xmm0 105# CHECK-NEXT: [1,2] .D======eeeE--------------------------------R. . . . . addps %xmm0, %xmm0 106# CHECK-NEXT: [2,0] .D=========================================eeeeeeeeeeeeeeeeeeeeeER sqrtsd %xmm0, %xmm0 107# CHECK-NEXT: [2,1] .DeeeeeeE--------------------------------------------------------R movsd (%eax), %xmm0 108# CHECK-NEXT: [2,2] . D======eeeE----------------------------------------------------R addps %xmm0, %xmm0 109 110# CHECK: Average Wait times (based on the timeline view): 111# CHECK-NEXT: [0]: Executions 112# CHECK-NEXT: [1]: Average time spent waiting in a scheduler's queue 113# CHECK-NEXT: [2]: Average time spent waiting in a scheduler's queue while ready 114# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage 115 116# CHECK: [0] [1] [2] [3] 117# CHECK-NEXT: 0. 3 21.7 15.0 0.0 sqrtsd %xmm0, %xmm0 118# CHECK-NEXT: 1. 3 1.0 1.0 35.3 movsd (%eax), %xmm0 119# CHECK-NEXT: 2. 3 7.0 0.3 32.0 addps %xmm0, %xmm0 120# CHECK-NEXT: 3 9.9 5.4 22.4 <total> 121