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

SDIV (medium, 64-bit)

Test 1: uops

Code:

  sdiv x0, x1, x2
  mov x1, #0xffffffff80000000
  mov x2, #3

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 1.000

Integer unit issues: 1.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 0.000

retire uop (01)cycle (02)033f4d51schedule 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
10042039156195025100010001000537250203920391801318971000100020002039261111001100000733162219801000100020402040204020402040
10042039156195025100010001000537250203920391801318971000100020002039261111001100000732162219801000100020402040204020402040
10042039156195025100010001000537250203920391801318971000100020002039261111001100000732162119801000100020402040204020402040
10042039156195025100010001000537250203920391801318971000100020002039261111001100000732162219801000100020402040204020402040
10042039166195025100010001000537250203920391801318971000100020002039261111001100000732162219801000100020402040204020402040
10042039156195025100010001000537250203920391801318971000100020002039261111001100006732162219801000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000731162219801000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000732162219801000100020402040204020402040
10042039166195025100010001000537250203920391801318971000100020002039261111001100023732162219801000100020402040204020402040
10042039156195025100010001000537250203920391801318971000100020002039261111001100000732162219801000100020402040204020402040

Test 2: Latency 1->2

Chain cycles: 2

Code:

  sdiv x0, x1, x2
  eor x1, x1, x0
  eor x1, x1, x0
  mov x1, #0xffffffff80000000
  mov x2, #3

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code, minus 2 chain cycles): 8.0035

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)1e3f4d51schedule 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)9fld unit uop (a6)l1d cache writeback (a8)a9acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
302041000357490006191261253012930100301009493443049969551000351000359587339624230100302006020010003519311302011009910030100100000000191021711997223000030100100036100036100036100036100036
302041000357490108991261253010030100301009493443049969551000351000359587339624230100302006020010003519311302011009910030100100010000191011711997223000030100100036100036100036100036100036
30204100035749002766191261253010030100301009493443049969551000351000359587339630630203302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
302041000357490006191261253010030100301009493443049969551000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
302041000357490009491261253010030100301009493443049969551000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
3020410003574900072691261253010030100301009493443049939151000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
302041000767490006191261253010030100301009493443049969551000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
3020410003575000061912612530100301003010094934430499695510003510003595873209624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
3020410003575000100872691261253010030100301009493443049969551000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
302041000357500006191261253010030100301009493443049969551000351000359587339624230100302006048610003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036

1000 unrolls and 10 iterations

Result (median cycles for code, minus 2 chain cycles): 8.0035

retire uop (01)cycle (02)031e3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)60696a6b6d6emap 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)a9accdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
300241000357490984911822530010300103001094787671499695501000351000359588539626530010300206002010003519311300211091030010100000018901616716997143000730010100036100036100036100036100036
300241000357500619118225300103001030010947876714996955010003510003595885396265300103002060020100035193113002110910300101004000189016161615997143000030010100036100036100036100036100036
30024100035749061911822530010300103001094787671499695501000351000359588539626530010300206028410003519311300211091030010100000018901316715997143000030010100036100036100036100036100036
300241000357490619118225300103001030010947876714996955010003510003595885396265300103002060020100035193113002110910300101000000189016161615997143000030010100036100036100036100036100036
300241000357490619118225300103001030010947876714996955010003510003595885396265300103002060020100035193113002110910300101000000189016161316997143000030010100036100036100036100036100036
30024100035749246619118225300103001030010947876714996955010003510003595885396265300103002060020100035193113002110910300101000000189016161316997143000030010100036100036100036100036100036
300241000357490619118225300103001030010947876714996955010003510003595885396265300103002060020100035193113002210910300101000001189016161515997143000030010100036100036100036100036100036
300241000357500619118225300103001030010947876704996955010003510003595885996265300103002060020100035193113002110910300101000000189013161613997143000030010100036100036100036100036100036
30024100035749061911822530010300103001094787670499695501000661000359588539626530010300206002010003519311300211091030010100000018901416714997143000030010100036100036100036100036100036
300241000357490619118225300103001030010947876704996955010003510003595885396265300103002060020100035193113002110910300101000000189016161316997143000030010100036100036100036100036100036

Test 3: Latency 1->3

Chain cycles: 2

Code:

  sdiv x0, x1, x2
  eor x2, x2, x0
  eor x2, x2, x0
  mov x1, #0xffffffff80000000
  mov x2, #3

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code, minus 2 chain cycles): 8.0035

retire uop (01)cycle (02)03mmu table walk data (08)191e3f4d51schedule 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)a9acc2branch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
30204100035749000619114525301003010030100949344314996955100035100035958673962423010030200602001000351931130201100991003010010000000191021712997223000030100100036100036100036100036100036
30204100035750000619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
30204100035749000619126125301003010030201949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
30204100035749000619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
30204100035749000619126125301003010030100949344304996955100035100035958733962623010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
302041000357490007269126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000300191011711997223000030100100036100036100036100036100036
30204100035749000619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010022209800191011711997223000030100100036100036100036100036100036
30204100035749000829126125301003010030100949344304996955100035100035958733962423010030200602001000351931130201100991003010010000000191011721997223000030100100036100036100036100036100036
302041000357500007269126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
30204100035749000619126125301003010030100949344314993925100035100035958733962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036

1000 unrolls and 10 iterations

Result (median cycles for code, minus 2 chain cycles): 8.0035

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)1e3a3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6d6emap stall dispatch (70)int prf full (71)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 tlb miss (a1)l1d cache writeback (a8)a9accdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
300241000357500000619118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000000189051635997143000030010100036100036100036100036100036
30024100035749000018399118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000000189031653997143000030010100036100036100036100067100036
300241000357490000619118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000000189041647997143000030010100036100036100036100036100036
300241000357490000619118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000000189031635997143000030010100036100036100036100036100036
30024100035749000012499118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000000189071674997143000030010100036100036100036100036100036
300241000357490000619118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000000189031635997143000030010100036100036100036100036100036
300241000357490000619118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000000189031673997143000030010100036100036100036100036100036
3002410003574900007269118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000000189051653997143000030010100036100036100036100036100036
300241000357490000619118225300103001030010947876749969551000351000359588503962653001030020600201000351931130021109103001010000001189051635997143000030010100036100036100036100036100036
300241000357490000619118225300103001030010947876749969551000351000359588533962653001030020600201000351931130021109103001010000000189071635997143000030010100036100067100036100036100036

Test 4: throughput

Count: 8

Code:

  sdiv x0, x8, x9
  sdiv x1, x8, x9
  sdiv x2, x8, x9
  sdiv x3, x8, x9
  sdiv x4, x8, x9
  sdiv x5, x8, x9
  sdiv x6, x8, x9
  sdiv x7, x8, x9
  mov x8, #0xffffffff80000000
  mov x9, #3

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire uop (01)cycle (02)031e3a3f4d51schedule 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 tlb access (a0)l1d cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd0d5map dispatch bubble (d6)ddfetch restart (de)dfe0? int output thing (e9)? int retires (ef)f5f6f7f8fd
8020416003911990072679950258010080100801004399225491569591600781600391499013149997801008020016020016003926111802011009910080100100000010511302161131599808000080100160040160040160040160040160040
802041600391199016779950258010080100801004399225491569591600391600391499013149997801008020016020016003926111802011009910080100100000000511331161131599808000080100160040160040160040160040160040
802041600391199016779950258010080100801004399225491569591600391600391499013149997801008020016020016003926111802011009910080100100000000511331161131599808000080100160040160040160040160040160040
80204160039119901218879950258010080100803104399225981569591600391600391499013149997801008020016020016003926111802011009910080100100000000511331161131599808000080100160040160040160040160040160040
80204160039119901295579950258010080100801004399225491569591600391600391499013149997801008020016020016003926111802011009910080100100000000511331161131599808000080100160040160040160040160040160040
80204160039119901114079950258010080100801004399225491569591600391600391499013149997801008020016020016003926111802011009910080100100000000511331161131599808000080100160040160040160040160040160040
80204160039119901283579950258010080100801004399225491569591600391600391499013149997801008020016020016003926111802011009910080100100010000511331161131599808000080100160040160040160040160040160040
80204160039119901240779950258010080100801004399225491569591600391600391499013149997801008020016020016003926111802011009910080100100000000511331161131599808000080100160040160040160040160040160040
80204160039119901237479950258010080100801004399440491569591600391600391499013149997801008020016020016003926111802011009910080100100000000511331161131599808000080100160040160040160040160040160040
80204160039119801304179950258010080100801004399225491569591600801600391499013149997801008020016020016003926111802011009910080100100000000511331161131599808000080100160040160040160040160040160040

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)l2 tlb miss instruction (0a)l2 tlb miss data (0b)0f18191e1f3f4d51schedule 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 tlb miss (a1)l1d cache writeback (a8)a9acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfl1i cache miss demand (d3)d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80024160039119900000041207267995025800108001080010439877514915695916003916003914992331500198001080020160020160237261118002110910800101000300000050200916631599808000080010160040160040160040160040160040
800241600391199000000000617995025800108001080010439877504915695916003916003914992331500198001080020160020160039261118002110910800101000003000050200316531599808000080010160040160040160040160040160040
800241600391198000000000617995025800108001080010439877504915695916003916003915000331500198001080020160020160039261118002110910800101000000000050420516531599808000080010160040160040160040160040160040
8002416003911990001040006179950110800108001080010439877504915695916003916003914992331500198001080020160020160039261118002110910800101030300000050200516351599808000080010160040160040160040160040160040
800241600391199000000090617995025800108001080010439877504915715616003916003914992331500198001080020160020160039261118002110910800101000000000050200316351599808000080010160237160040160040160040160040
800241600391199000014000726799501118001080010800104398775049157008160039160039149923121500198001080020160020160039261118002110910800101000100000150200316551599808000080010160040160040160040160040160040
800241600391198010000000617995025800108001080010439877504915695916023616003914992331500198001080020160020160039261118002110910800101002000000050200316451599808000080010160040160040160040160040160040
8002416003911990000000007267993825800628001080010439877504915695916003916003915000031500198001080020160020160039261118002110910800101000000000050200516531599808000080010160040160040160040160040160040
800241600391199000000057352617995025800108001080010439877504915695916003916023714992331501558001080020160020160039261518002110910800101000400000050200516351599808000080010160040160040160040160040160040
8002416003911980100000005577995025800108001080010439877504915695916003916003914992331500198001080020160020160039261518002110910800101000000000050200348351599808000080010160040160040160040160040160040