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

UDIV (medium, 64-bit)

Test 1: uops

Code:

  udiv x0, x1, x2
  mov x1, #0xffffffff
  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
10042039156195025100010001000537251203920391801318971000100020002039261111001100000733161119801000100020402040204020402040
10042039166195025100010001000537251203920391801318971000100020002039261111001100000731161119801000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000731161120311000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000731161119801000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000731161119801000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000731161119801000100020402040204020402040
10042039166195025100010001000537250203920391801318971000100020002039261111001100000731161119801000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000731161119801000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000731161119801000100020402040204020402040
10042039156195025100010001000537251203920391801318971000100020002039261111001100000731161119801000100020402040204020402040

Test 2: Latency 1->2

Chain cycles: 2

Code:

  udiv x0, x1, x2
  eor x1, x1, x0
  eor x1, x1, x0
  mov x1, #0xffffffff
  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)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)9fl1d tlb access (a0)l1d tlb miss (a1)ld unit uop (a6)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
302041000357490814912612530100301003010094934430499695501000351000359587339624230100302006020010003519311302011009910030100100000000191021711997223000030100100036100036100036100036100036
30204100035749061912612530100301003010094934431499695501000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
30204100035749061912612530100301003010094934431499695501000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
30204100035750061912612530100301003010094934431499695501000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223001530100100036100036100036100036100036
30204100035749061912612530100301003010094934431499695501000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
30204100035749061912612530100301003010094934430499695531000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
302041000357490210912612530100301003010094934431499695501000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
30204100035750061912612530100301003010094934431499695501000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
30204100035749061912612530100301003010094934431499695501000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100036100036100036
30204100035749061912612530100301003010094934431499695501000351000359587339624230100302006020010003519311302011009910030100100000000191011711997223000030100100036100036100077100036100036

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)18191e1f3f4d51schedule 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 miss (a1)l1d cache writeback (a8)acc2cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
30024100035750000150726911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101001000189021622997143000030010100036100036100036100036100036
300241000357490000061911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101000000189021622997143000030010100036100036100036100036100036
300241000357490000061911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101000000189021622997143000030010100036100036100036100036100036
300241000357490000061911822530010300103001094787674996955100075100035958850396265300103002060020100035193113002110910300101000000189021622997143000030010100036100036100036100036100036
300241000357490000061911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101000000189021622997143000030010100036100036100036100036100036
300241000357490000061911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101000000189021622997143000030010100036100036100036100036100036
300241000357500000061911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101000000189021622997143000030010100036100036100036100036100036
300241000357490000082911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101000020189024122997143001730010100036100036100036100036100036
3002410003575000000103911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101000000189022422997143000030010100036100036100036100036100036
300241000357490000082911822530010300103001094787674996955100035100035958850396265300103002060020100035193113002110910300101000000189021622997143000030010100036100036100036100036100036

Test 3: Latency 1->3

Chain cycles: 2

Code:

  udiv x0, x1, x2
  eor x2, x2, x0
  eor x2, x2, x0
  mov x1, #0xffffffff
  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)03l2 tlb miss instruction (0a)18191e3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)696a6b6d6emap 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 cache writeback (a8)acbranch cond mispred nonspec (c5)branch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
30204100035749000066912612530100301003010094803904996955010003510003595873013962423010030200602001000351931130201100991003010010000000191021713997223000030100100036100036100036100036100036
3020410003575000096191261253010030100301009493443499695501000351000359587303962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
3020410003574900006191261253010030100301009493443499695501000351000359587303962423010030200602001000351931130201100991003010010020000191011712997223000030100100036100036100036100036100036
3020410003574900006191261253010030100301009493443499695501000351000359587303962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
3020410003574900006191261253010030100301009493443499695501000351000359587303962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100077100036100036
30204100035749000061912612530100301003010094934434996955010003510003595873039624230100302006020010003519311302011009910030100100003300191011712997223000030100100036100036100036100036100036
30204100035749000072691261253010030100301009493443499695501000351000359587303962423010030200602001000351931130201100991003010010000000191021711997223000030100100036100036100036100036100036
3020410003574900006191261253010030100301009493443499695501000351000359587303962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
3020410003574900006191261253010730100301009493443499695501000351000359587303962423010030200602001000351931130201100991003010010000000191011711997223000030100100036100036100036100036100036
3020410003574900006191261253010030100301009493443499695501000351000359587303962423010030200602001000351931130201100991003010010000010191011711997223000030100100036100036100036100036100036

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)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 tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)accfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
3002410003574906191182253001030010300109478767499695510003510003595885396265300103002060020100035193113002110910300101000000189041633997143000030010100036100036100036100036100036
3002410003574906191182253001030010300109484530499695510003510003595885396265300103002060020100035193113002110910300101000000189031633997143000030010100036100036100036100036100036
3002410003574906191182253001030010300109478767499695510003510003595885396265300103002060020100035193113002110910300101000000189031633997143000030010100036100036100036100036100036
3002410003574906191182253001030010300109478767989695510003510003595885396265300103002060020100035193113002110910300101000000189031633997143000030010100036100036100036100036100036
3002410003574906191182253001030010300109478767499695510003510003595885396265300103002060020100035193113002110910300101000030189031633997143000030010100036100036100036100036100036
3002410003574906191182253001030010300109478767499695510003510003595885396265300103002060020100035193113002110910300101000000189031633997143000030010100036100036100036100036100036
3002410003574906191182253001030010300109478767499695510003510003595885396265300103002060020100035193113002110910300101000003189031633997143000030010100077100036100036100036100036
3002410003574906191182253001030010300109478767499695510003510003595885396265300103002060020100035193113002110910300101000000189031633997143000030010100036100036100036100036100036
3002410003574906191182253001030010300109478767499695510003510003595885396265300103002060020100035193113002110910300101000000189031633997143000030010100036100036100036100036100036
3002410003575006191182253001030010300109478767499695510003510003595885396265300103002060020100035193113002110910300101000000189031633997143000030010100036100036100036100036100036

Test 4: throughput

Count: 8

Code:

  udiv x0, x8, x9
  udiv x1, x8, x9
  udiv x2, x8, x9
  udiv x3, x8, x9
  udiv x4, x8, x9
  udiv x5, x8, x9
  udiv x6, x8, x9
  udiv x7, x8, x9
  mov x8, #0xffffffff
  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)030918191e3f4d51schedule 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)9fl1d tlb access (a0)l1d tlb miss (a1)ld unit uop (a6)l1d cache writeback (a8)acc2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
8020416003911990000617995025801008010080100439922514915695901600391600391499013149997801008020016020016003926111802011009910080100100000000005110416441599808000080100160040160040160040160040160040
8020416003911990000617995025801008010080100439922504915695901600391600391499013149997801008020016020016003926111802011009910080100100000000005110416451599808000080100160040160040160040160040160040
8020416003911990009617995025801298010080100439922504915695901600391600391499013149997801008020016020016003926111802011009910080100100000000005110316451599808000080100160040160040160040160040160079
8020416003911990000617995025801008010080100439922504915695901600391600391499013149997801008020016020016003926111802011009910080100100000000105110416441599808000080100160040160186160040160040160040
802041600391199000061799502580100801008010043992250491569590160039160039149901314999780100802001602001600392611180201100991008010010000001350005131416441599808000080100160040160040160040160040160040
8020416003911990000617995025801008010080100439922504915695901600391600391499013149997801008020016020016003926111802011009910080100100000000005110516541599808000080100160040160083160040160040160040
8020416003911990000617995025801008010080100439922514915695901600391600391499013150027801008020016020016003926111802011009910080100100000000005110516451599808000080100160040160040160040160040160040
8020416003911980000617995025801008010080271439922504915695901600391600891499013149997801008020016020016003926111802011009910080100100000000005110516541599808000080100160040160040160040160040160040
802041600391198000648617995025801008010080100439922504915695901600391600391499013149997801008020016020016003926111802011009910080100100000000015110416331599808000080100160040160040160040160040160040
8020416003911980000617995025801008010080100439922504915695901600391600391499013149997801008020016020016003926111802011009910080100100000090005110416441599808000080100160040160040160040160040160040

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03191e1f3f4d5051schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)6061696a6d6emap 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)acbranch mispred nonspec (cb)cfd0d2d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
800241600391199000726799500258001080010800104398775104915695916003916003914992331500198001080020160020160039261118002110910800101000100502050416441599808000080010160040160040160040160040160040
80024160039119806570279799500258001080010800104398775154915695916003916003914992331500198001080020160020160039261118002110910800101000000502050516431599808000080010160040160040160040160040160040
80024160039119800061799500258001080010800104398775154915695916003916003914992331500198001080020160020160039261118002110910800101000400502051516541599808000080010160040160040160040160040160040
800241600391199000617995001108002580010800104399347154915695916003916018814992331500198001080020160020160039261118002110910800101000000502051416431599808000080010160040160040160040160040160040
80024160039119900061799500258001080010800104398775154915695916003916003914992331500198001080020160020160039261118002110910800101000000502051316341599808000080010160040160040160040160040160040
80024160039119900011277995002580010800108001043987751549156959160039160039149923315001980010800761601221600392611180021109108001010003120502051316441599808000080010160040160040160040160040160040
800241600391199000726799500258001080010800104398775104915695916003916003914992331500198001080020160020160039261118002110910800101000000507651516441599808000080010160040160040160040160040160040
80024160039119910598902799500678001080010800104398924154915695916003916003914992331500198001080020160020160039261118002110910800101000130502051416451601248001580010160040160040160090160089160089
80024160089120002406179950025800648002480010439877515491569591600391600391499233150019800108002016002016003926111800211091080010100258700502051316431599808000080010160040160040160040160040160040
80024160039119900061799500258001080010800104398775154915695916003916003914992331500198001080020160020160039261118002110910800101000000502051416441599808000080010160040160040160040160040160040