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, lsl, 32-bit)

Test 1: uops

Code:

  negs w0, w0, lsl #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
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000731431119202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100010731431119202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000731431119202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000731431119202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000731431119202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000731431119202000100020362036203620362036
10042035150611000186225200020001000126235120352035172931866100010001000203541111001100000731431119202000100020362036203620362036
10042035150611000186225200020001000126235020352035172931866100010001000203541111001100000731431119202000100020362036203620362036
10042035150611000186225200020001000126235120352035172931866100010001000203541111001100000731431119202000100020362036203620362036
10042035160611000186225200020001000126235020352035172931866100010001000203541111001100000731431119202000100020362036203620362036

Test 2: Latency 1->2

Code:

  negs w0, w0, lsl #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)03181e1f3f4c4d51schedule 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)l1d cache writeback (a8)a9acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10204200351500006110000198622520100201001010013051211491695520035200351858131872010100102001020020035411110201100991001010010000000710139111992220000101002003620036200362003620036
10204200351500006110000198622520100201001010013051211491695520035200351858131872010100102001020020035411110201100991001010010000000710139111992220000101002003620036200362003620036
10204200351500006110000198622520100201001010013051210491695520035200351858131872010100102001020020035411110201100991001010010000000710139111992220000101002003620036200362003620036
10204200351500006110000198622520100201001010013051210491695520035200351858131872010100102001020020035411110201100991001010010000000710139111992220000101002003620036200362003620036
10204200351500006110000198622520100201001010013051210491695520035200351858131872010100102001020020035411110201100991001010010001000710139111992220000101002003620036200362003620036
10204200351500006110000198622520100201001010013051211491695520035200351858131872010100102001020020035411110201100991001010010000000710139111992220000101002003620036200362003620036
10204200351500006110000198622520100201001010013051210491695520035200351858131872010100102001020020035411110201100991001010010000000710139111992220000101002003620036200362003620036
10204200351500006110009198622520100201001010013051210491695520035200351858131872010100102001020020035411110201100991001010010000200710139111992220000101002003620036200362003620036
10204200351500006110000198622520100201001010013051211491695520035200351858131872010100102001020020035411110201100991001010010000000710139111992220000101002003620036200362003620036
10204200351500006110000198622520100201001010013051210491695520035200351858131872010100102001020020035411110201100991001010010000001710139111992220000101002003620036200362003620036

1000 unrolls and 10 iterations

Result (median cycles for code): 2.0035

retire uop (01)cycle (02)031e3f4c4d51schedule 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
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101010640341221993020000100102003620036200362003620036
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101000640241221993020000100102003620036200362003620036
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101000640241221993020000100102003620036200362003620036
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101000640241221993020000100102003620036200362003620036
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101000640241221993020000100102003620036200362003620036
1002420035150025110000198622520010200101001013052291491695520035200351860331874010010100201002020035411110021109101001010270640241221993020000100102003620036200362003620036
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101000640241221993020000100102003620036200362003620036
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101000640241221993020000100102003620036200362003620036
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101003640241221993020000100102003620036200362003620036
10024200351500611000019862252001020010100101305229049169552003520035186033187401001010020100202003541111002110910100101000640241221993020000100102003620036200362003620036

Test 3: Latency 3->2

Chain cycles: 1

Code:

  negs w0, w1, lsl #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)03mmu table walk instruction (07)l2 tlb miss instruction (0a)1e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6d6emap 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)9fld unit uop (a6)l1d cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
20204300352251106110000298992530100301002010719562404926955300353003527391827485201072022420224300358521202011009910020100101000001111319416112998630000201003003630036300363003630036
20204300352251106110000298992530100301002010719562404926955300353003527391727486201072022420224300358511202011009910020100101000001111319116112998630000201003003630036300363003630036
20204300352251106110000298992530100301002010719562404926955300353003527391827485201072022420224300358511202011009910020100101000061111319116112998630000201003003630036300363003630036
20204300352251106110000298992530100301002010719562404926955300353003527391727486201072022420224300358511202011009910020100101000001111319116112998630000201003003630036300363003630036
20204300352251106110000298992530100301002010719562404926955300353003527391727485201072022420224300358511202011009910020100101000001111319116112998630000201003003630036300363003630036
20204300352251108910000298992530100301002010719562404926955300353003527391827486201072022420224300358511202011009910020100101000001111320116112998630000201003003630036300363003630036
20204300352251106110000298992530100301002010719562404926955300353003527391827486201072022420224300358511202011009910020100101000001111319116112998730000201003003630036300363003630036
20204300352251106110000298992530100301002010719562404926955300353003527391727485201072022420224300358511202011009910020100101000001111320116112998630000201003003630036300363003630036
20204300352241106110000298992530100301002010719562404926955300353003527391827486201072022420224300358511202011009910020100101000101111320116112998630000201003003630036300363003630036
202043003522511012410000298992530100301002010719562404926955300353003527391727486201072022420224300358511202011009910020100101000001111319116112998730000201003003630036300363003630036

1000 unrolls and 10 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)696a6d6emap 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)acc2branch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
2002430035225002018100002989125300103001020010195628949269553003530035273919274982001020020200203003585112002110910200101001000001270133112995930000200103003630036300363003630036
2002430035225001789100002989125300103001020010195628949269553003530035273913274982001020020200203003585112002110910200101001000001270133112995930000200103003630036300363003630036
200243003522500631100002989125300103001020010195628949269553003530035273913274982001020020200203003585112002110910200101001000001270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628949269553003530035273913274982001020020200203003585112002110910200101001000001270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628949269553003530035273913274982001020020200203003585112002110910200101001010001270133112995930000200103003630036300363003630036
200243003522500588100002989125300103001020010195628949269553003530035273913274982001020020200203003585112002110910200101001000001270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628949269553003530035273913274982001020020200203003585112002110910200101001000001270133112995930000200103003630036300363003630036
2002430035224001117100002989125300103001020010195628949269553003530035273913274982001020020200203003585112002110910200101001000001270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628949269553003530035273913274982001020020200203003585112002110910200101001000001270133112995930000200103003630036300363003630036
20024300352250061100002989125300103001020010195628949239273003530035273913274982001020020200203003585112002110910200101001003001270117212995930000200103003630036300363003630036

Test 4: throughput

Count: 8

Code:

  negs w0, w8, lsl #17
  negs w1, w8, lsl #17
  negs w2, w8, lsl #17
  negs w3, w8, lsl #17
  negs w4, w8, lsl #17
  negs w5, w8, lsl #17
  negs w6, w8, lsl #17
  negs w7, w8, lsl #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)l2 tlb miss instruction (0a)1e3a3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6b6d6emap 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)9fld unit uop (a6)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
802045343040011019508001348791291601371601378017634418901495033405341453414433453024843355801768028880288534143911802011009910080100100000011151266168753411160037801005341553415534155341453415
80204534144001101858000048741251601001601008010034400050495044605341053410432982909343360801008020080200534103911802011009910080100100040000051129248753390160000801005341153411534115341153411
802045341040011012548000048741251601001601008010034400050495033005341053410432983024343360801008020080200534103911802011009910080100100000000051128248753390160000801005341153411534115341153411
80204534103991101648000048741251601001601008010034400050495033005341053410432983024343360801008020080200534103911802011009910080100100000000051127248953390160000801005341153411534115341153411
80204534104001101648000048741251601001601008010034400050495033005341053410432983024343360801008020080200534103911802011009910080100100000000051128247753390160000801005341153411534115341153411
80204534104001101648000048741251601001601008010034400050495033005341053410432983024343360801008020080200534103911802011009910080100100000000051127248753390160000801005341153411534115341153411
8020453410400110110318000048741251601001601008010034400050495038605341053410432982909343360801008020080200534103911802021009910080100100000000051128247653390160000801005341153411534115341153411
80204534104001101648000048741251601001601008010034400050495033005341053410432983024343360801008020080200534103911802011009910080100100000000051128248653390160000801005341153411534115341153411
80204534104001101648000048741251601001601008010034400050495033005341053410432983024343360801008020080200534103911802011009910080100100000000051127247853390160000801005341153411534115341153411
802045341040011011698000048741251601001601008010034400050495033005341053410432982909343360801008020080200534103911802011009910080100100000000051148246653390160000801005341153411534115341153411

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)09l2 tlb miss data (0b)191e3f4c4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6b6d6emap 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 access (a0)l1d cache writeback (a8)acc2branch cond mispred nonspec (c5)cfd0d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80024534014000000061800004794625160010160010800103438130049503000533805338043290325134335280010800208002053380391180021109108001010000005020011242653360160000800105338153381533815338153381
8002453380400000006180000479462516001016001080010343813004950300053380533804329032513433528001080020800205338039118002110910800101000000502002246253360160000800105338153381533815338153381
8002453380400000006180000479462516001016001080010343813004950300053438534374329027493433528001080020800205338039118002110910800101000000502002246253360160000800105338153381533815338153381
8002453380400000006180000479462516001016001080010343813014950300053380533804329032513433528001080020801125338039118002110910800101001000502003242253360160000800105338153381533815338153381
8002453380400000006180000479462516001016001080010343813004950300353380533804329027493433528001080020800205338039118002110910800101000000502006242253360160000800105338153381533815338153381
8002453380399000006180000479462516001016001080010343813004950300053380533804329029363433528001080020800205338039118002110910800101000000502002243653360160000800105338153381533815338153381
8002453380400000006180000479462516001016001080010343813004950300053380533804329029363433528001080020800205338039118002110910800101000000502002242253360160000800105338153381533815338153381
8002453380400000006180000479462516001016001080010343813004950300053380533804329032513433528001080020800205338039118002110910800101000000502002242653360160000800105338153381533815338153381
8002453380400000006180000479462516001016001080010343813004950300053380533804329032513433528001080020800205338039118002110910800101000000502006242253360160000800105338153381533815338153381
8002453380399000006180000479462516001016001080010343813004950300053380533804329032513433528001080020800205338039118002110910800101001000502002242653360160000800105338153381533815338153381