Apple Microarchitecture Research by Dougall Johnson

M1/A14 P-core (Firestorm): Overview | Base Instructions | SIMD and FP Instructions
M1/A14 E-core (Icestorm):  Overview | Base Instructions | SIMD and FP Instructions

NEGS (register, lsr, 32-bit)

Test 1: uops

Code:

  negs w0, w0, lsr #17
  mov x0, 1
  mov x1, 2

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 2.000

Integer unit issues: 2.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 0.000

retire uop (01)cycle (02)031e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)606d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst int alu (97)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10042035150611000186225200020001000126235120352035172931866100010001000203541111001100000732432219202000100020362036203620362036
1004203515198611000186225200020001000126235120352035172931866100010001000203541111001100000732432219202000100020362036203620362036
10042035150611000186225200020001000126235120352035172931866100010001000203541111001100000732432219202000100020362036203620362036
10042035150611000186225200020001000126235120352035172931866100010001000203541111001100000732432219202000100020362036203620362036
10042035150611000186225200020001000126235120352035172931866100010001000203541111001100000732432219202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000732432219202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000732432219202000100020362036203620362036
10042035150611000186225200020001000126235120352035172931866100010001000203541111001100000732432219202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000732432219202000100020362036203620362036
100420351512611000186225200020001000126235120352035172931866100010001000203541111001100000732432219202000100020362036203620362036

Test 2: Latency 1->2

Code:

  negs w0, w0, lsr #17
  mov x0, 1
  mov x1, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.0035

retire uop (01)cycle (02)03l2 tlb miss data (0b)1e1f3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
102042003515000061100001986225201002010010100130512114916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
1020420035150024061100001986225201352010010100130512114916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
102042003515000061100001986225201002010010100130512114916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
102042003515000061100001986225201002010010100130512104916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
102042003515000061100001986225201002010010100130512104916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
102042003515000082100001986225201002014510100130512114916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
102042003515010061100001986225201002010010100130512104916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
102042003515000061100001986225201002010010100130512114916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
102042003515000061100001986225201002010010100130512114916955200352003518581318720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036
1020420035150000611000019862252010020100101001305121149169552003520035185811418720101001020010200200354111102011009910010100100710139111992220000101002003620036200362003620036

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0035

retire uop (01)cycle (02)03l2 tlb miss data (0b)1e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)flags prf full (73)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d cache writeback (a8)acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10024200351500061100091986825200332003310010130597904917001200352003518603031874010010100201002020035411110021109101001010000640541331993020000100102003620036200362003620036
10024200351500061100001986225200102001010010130522904916955200352003518603031874010010100201002020035411110021109101001010030640341331993020000100102003620036200362003620036
10024200351500061100001986225200102001010010130522904916955200352003518603031874010010101081010820035411110021109101001010000640341331993020000100102003620036200362003620036
10024200351500061100001986225200102001010010130522914916955200352003518603031874010010100201002020035411110021109101001010000640341331993020000100102003620036200362003620036
10024200351500061100001986225200102001010010130522904916955200352003518603031874010010100201002020035411110021109101001010000640349331993020000100102003620036200362003620036
100242003515001261100001986225200102001010010130522904916955200352003518603031874010010100201002020035411110021109101001010000640341331993020000100102003620036200362003620036
10024200351500061100001986225200102001010010130522904916955200352003518603031874010010100201002020035411110021109101001010000640341331993020000100102003620036200362003620036
10024200351500061100001986225200102001010010130522904916955200352003518603031874010010100201002020035411110021109101001010000640341331993020000100102003620036200362003620036
10024200351500661100001986225200102001010010130522904916955200352003518603031874010010100201002020035411110021109101001010000640341331993020000100102003620036200362003620036
10024200351500061100001986225200102001010010130522904916955200352003518603031874010010100201002020035411110021109101001010000640341331993020000100102003620036200362003620036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  negs w0, w1, lsr #17
  cset x1, cc
  mov x0, 1
  mov x1, 2
  mov x2, 3
  mov x3, 4
  mov x4, 5

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code, minus 1 chain cycle): 2.0035

retire uop (01)cycle (02)03l2 tlb miss data (0b)1e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d tlb access (a0)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
202043003522500441100002989925301003010020107195624014926955300353003527391827485201072022420224300358511202011009910020100101000000001111321016202998230000201003003630036300363003630036
2020430035225024611000029899253010030100201071956240149269553003530035273917274852010720224202243003585112020110099100201001010000014001111321316122998330000201003003630036300363003630036
20204300352250061100002989925301003010020107195624014926955300353003527391727486201072022420224300358511202011009910020100101000000001111322316122998230000201003003630036300363003630036
202043003522510611000029899253010030100201071956240149269553003530035273911127486201072022420224300358511202011009910020100101000000001111321016302998230000201003003630036300363003630036
20204300352250061100002989925301003010020107195624014926955300353003527391827486201072022420224300358511202011009910020100101000000001111321016202998230000201003003630036300363003630036
20204300352250061100002989925301003010020107195624014926955300353003527391727485201072022420224300358511202011009910020100101000000001111322316332998230000201003003630036300363003630036
20204300352250061100002989925301003010020107195624014926955300353003527391727485201072022420224300358511202011009910020100101000000001111322316202998330000201003003630036300363003630036
20204300352250061100002989925301003010020107195624014926955300353003527391727486201072022420224300358511202011009910020100101000000001111321316212998230000201003003630036300363003630036
20204300352241061100002989925301003010020107195624014926955300353003527391827486201072022420224300358511202011009910020100101000000001111322016202998330000201003003630036300363003630036
20204300352250061100002989925301003010020107195624014926955300353003527391827486201072022420224300358511202011009910020100101000000001111321216122998230000201003003630036300363003630036

1000 unrolls and 10 iterations

Result (median cycles for code, minus 1 chain cycle): 2.0035

retire uop (01)cycle (02)03mmu table walk instruction (07)1e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20024300352240015910000298912530010300102001019562890492695530035300352739132749820010200202002030035851120021109102001010010031270133112995930000200103003630036300363003630036
2002430035224008210000298912530010300102001019562890492695530035300352739132749820010200202002030035851120021109102001010010001270133112995930000200103003630036300363003630036
2002430035225006110000298912530010300102001019562890492695530035300352739132749820010200202002030035851120021109102001010010061270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628914926955300353003527391327498200102002020020300358511200211091020010100100901270133212995930000200103003630036300363003630036
200243003522500611000029891253001030010200101956289049269553003530035273913274982001020020200203003585112002110910200101001001441270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628904926955300353003527391327498200102002020020300358511200211091020010100100631270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628904926955300353003527391327498200102002020020300358511200211091020010100100721270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628904926955300353003527391327498200102002020020300358511200211091020010100100841270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628904926955300353003527391327498200102002020020300358511200211091020010100100961270233112995930000200103003630036300363003630036
2002430035225106110000298912530010300102001019562890492695530081300352739132749820010200202002030035851120021109102001010010091270133112995930000200103003630036300363003630036

Test 4: throughput

Count: 8

Code:

  negs w0, w8, lsr #17
  negs w1, w8, lsr #17
  negs w2, w8, lsr #17
  negs w3, w8, lsr #17
  negs w4, w8, lsr #17
  negs w5, w8, lsr #17
  negs w6, w8, lsr #17
  negs w7, w8, lsr #17
  mov x8, 9
  mov x9, 10
  mov x10, 11

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code divided by count): 0.6676

retire uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)l2 tlb miss instruction (0a)1e3a3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)flags prf full (73)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d tlb miss (a1)l1d cache writeback (a8)acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
802045345040000100848000048741251601001601008010034400051495033053410534104329829093433608010080200804005341039118020110099100801001000096051107247853390160000801005341153411534115341153411
80204534104000000161800004874125160100160100801003440005049503305341053410432983024343360801008020080200534103911802011009910080100100000051109249753390160000801005341153411534115341153411
802045341040000100618000048741251601001601008010034400051495033053410534104329829093433608010080200802005341039118020110099100801001000021051107248753390160000801005341153411534115341153411
8020453410400000006180000487412516010016010080100344000514950330534105341043298290934336080100802008020053410391180201100991008010010000123051108246753390160000801005341153411534115341153411
80204534104000000061800004874125160100160100801003440005049503305341053410432982909343360801008020080200534103911802011009910080100100003051107247853390160000801005341153411534115341153411
802045341040000000618000048741251601001601008010034400050495033053410534104329829093433608010080200802005341039118020110099100801001000090051107247853390160000801005341153411534115341153411
802045341040000000618000048741251601001601008010034400051495033053410534104329830243433608010080200802005341039118020110099100801001000084051107249753390160000801005341153411534115341153411
80204534104000001110726800004874125160100160100801003440005049503305341053410432982909343360801008020080200534103911802011009910080100100003051109249953390160000801005341153411534115341153411
8020453410400000006180000487412516010016010080100344000504950330534105341043298302434336080100802008020053410391180201100991008010010000153051108248753390160000801005341153411534115341153411
802045341040000000618000048741251601001601008010034400050495033053410534104329830243433608010080200802005341039118020110099100801001000018051108249753390160000801005341153411534115341153411

1000 unrolls and 10 iterations

Result (median cycles for code divided by count): 0.6673

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)1e1f3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6d6emap stall dispatch (70)flags prf full (73)map rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map int uop inputs (7f)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int alu (97)9fl1d cache writeback (a8)acc2cfd0d5map dispatch bubble (d6)dbddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
800245340140000006180000479462516001016001080010343813014950300533805338043290325134335280010800208002053380391180021109108001010243050200112402253360160000800105338153381533815338153381
80024533804000000397800004794625160010160010800103438130049503005338053380432903251343352800108002080020533803911800211091080010106005020062406253360160000800105338153381533815338153381
800245338040000001135800004794625160010160010800103438130149503005338053380432902936343352800108002080020533803911800211091080010104305020062402653360160000800105338153381533815338153381
8002453380400000061800004794625160010160010800103438130049503005338053380432903251343352800108002080020533803911800211091080010106005020022402653360160000800105338153381533815338153381
8002453380400000061800004794625160010160010800103438130149503005338053380432903251343352800108002080020533803911800211091080010103005020032406253360160000800105338153381533815338153381
800245338040000240618000047946251600101600108001034381301495030053380533804329027493433528001080020800205338039118002110910800101010005020022402253360160000800105338153381533815338153381
8002453380400000061800004794625160010160010800103438130149503005338053380432902936343352800108002080020533803911800211091080010106005020022402253360160000800105338153381533815338153381
80024533804000000726800004794625160010160010800103438130049503005338053380432902749343352800108002080020533803911800211091080010105605020022402253360160000800105338153381533815338153381
8002453380399000061800004794625160010160010800103438130149503005338053380432902749343352800108002080020533803911800211091080010103005020022403253360160000800105338153381533815338153381
8002453380400000061800004794625160010160010800103438130149503005338053380432903251343352800108002080020533803911800211091080010107005020022402253360160000800105338153381533815338153381