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

Test 1: uops

Code:

  sdiv w0, w1, w2
  mov w1, #0x80000000
  mov w2, #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)03191e3f4d51schedule 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)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
10042039150061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039150061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039150061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039150061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039160061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039150061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039150961950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039150061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039150061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020402040
10042039150061950251000100010005372512039203918013189710001000200020392611110011000731161119801000100020402040204020812040

Test 2: Latency 1->2

Chain cycles: 2

Code:

  sdiv w0, w1, w2
  eor x1, x1, x0
  eor x1, x1, x0
  mov w1, #0x80000000
  mov w2, #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 data (0b)18191e1f3f4d51schedule 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)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9acc2cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
3020410003574900000619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000000191021711997223000030100100036100036100036100036100036
302041000357500005820619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000000191011711997223000030100100036100036100036100036100036
302041000357490000011029126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000000192911711997223000030100100036100036100036100036100036
3020410003574900000619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000000191011711998553000030100100036100036100036100036100036
3020410003574900000619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000090191011711997223000030100100036100036100036100036100036
30204100211749000007269126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000032191011731997223000030100100036100036100036100036100036
30204100035750000001039126125301003010030100949344314997136100035100035958733962423010030200602001002141931130201100991003010010000000030191011721997223000030100100036100215100036100036100036
30204100035749000001899126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000090191011712997223000030100100036100036100036100036100036
302041000357490000022249126125301003010030100950241014996955100035100035958733962423010030200602001000671931130201100991003010010000002000191011711997223000030100100036100036100036100036100036
3020410003574900057352619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000000000191011721997223000030100100036100036100036100036100126

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)18191e1f3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)5f60696a6d6emap 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
30024100035749000090849118225300103001030010947876701499695510003510003595885396265300103002060020100035193113002110910300101000000189051634997143000030010100036100036100036100036100036
300241000357490000006191182253001030010300109478767114996955100035100035958853962653011330020600201000351931130021109103001010000660189041643997143000030010100036100036100036100036100036
30024100035750000000619118225300103001030010947876711499695510003510003595885396265300103002060020100035193113002110910300101000003189031633997143000030010100036100036100036100036100036
30024100035749000000619118225300103001030010947876711989695510003510003595885396265300103002060020100035193113002110910300101000000189031633997143000030010100036100036100036100036100036
300241000357490000007269118225300103001030010947876711499695510003510003595885396265300103002060020100035193113002110910300101000000189031643997143000030010100036100036100036100036100036
30024100035750000000619118225300103001030010947876711499695510003510003595885396265300103002060020100035193113002110910300101000009189031654997143000030010100036100036100036100036100036
30024100035749000000619118225300103001030010947876701499695510003510003595885396265300103002060020100035193113002110910300101000000189041653997143000030010100036100036100036100036100036
30024100035750000000619118225300103001030010947876701499695510003510003595885396265301203002060020100035193113002110910300101000000189041631997143000030010100036100036100036100036100036
300241000357490004006191182253001030010300109478767114996955100035100035958833962653001030020600201000351931130021109103001010000880189031633997143000030010100036100036100036100036100036
300241000357490000003889118225300103001030010947876711499695510003510003595885396265300103002060020100035193113002110910300101000013189031633997143000630010100036100081100036100036100080

Test 3: Latency 1->3

Chain cycles: 2

Code:

  sdiv w0, w1, w2
  eor x2, x2, x0
  eor x2, x2, x0
  mov w1, #0x80000000
  mov w2, #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)03191e3f4d51schedule 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
3020410003574900619126125301003010030100949344304996955100035100035958733962423010030200602001000351931130201100991003010010000191021711997963000030100100214100036100036100036100036
3020410003574900619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000191011711997223000030100100036100036100036100036100036
30204100035749001569126125301003010030100949344304996955100035100035958733962423010030200602001000351931130201100991003010010000191011711997223000030100100036100036100036100036100036
3020410003574900619126125301003010030100949344304996955100035100035958733962423010030200602001000351931130201100991003010010000191011711997223000030100100036100036100036100036100036
3020410003574900619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000191011711997223000030100100036100036100036100036100036
30204100035749007269126125301003010030100949344304996955100035100035958733962423010030200602001000351931130201100991003010010000191011711997223000030100100214100036100036100036100036
3020410003574910619126125301003010030100949344314996955100035100035958733962423010030200602001000351931130201100991003010010000191011711997223000030100100036100036100036100036100036
30204100035749006191261253010030100301009493443049969551000351000359587322962423010030200602001000351931130201100991003010010000191011711997223000030100100036100036100036100036100036
30204100035749007269126125301003010030100949344304996955100035100035958733962423010030200602001000351931130201100991003010010000191011711997223000030100100036100036100036100036100036
3020410003575005739089126125301003010030100949344304996955100035100035958733962423010030200602001000351931130201100991003010010000191011711997223000030100100036100036100036100036100036

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)03mmu table walk instruction (07)l2 tlb miss instruction (0a)1e1f3f4d51schedule 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 cache writeback (a8)acbranch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
3002410003574900009491002253002030010300109478767049969550100035100035958853962653001030020600201000352031130021109103001010000189021622997143000030010100036100036100036100036100036
30024100066749000072691182253001030010300109512304149969550100035100035958853962653001030020600201000352031130021109103001010000189001655997253000230010100036100036100036100036100036
3002410003574900006191182253001030010300109478767149969550100035100035958853962653001030020600201000351931130021109103001010000189021623997253000230010100036100036100036100036100036
3002410003574900006191182253001030010301159478767049969550100035100035958853962653001030020600201000351931130021109103001010001189021622997143000030010100036100036100036100036100036
3002410003574900006191182253001030010300109478767049969550100035100035958853962653001030020600201000351931130021109103001010000189021622997143000030010100036100036100036100036100036
3002410003574900006191182253001030010300109478767149969550100035100035958853962653001030020600201000351931130021109103001010000189021622997143000030010100036100036100036100036100036
3002410003574900006191182253001030010300109478767149969550100035100035958853962653001030020600201000351931130021109103001010100189021622997143000030010100036100036100036100036100036
30024100035749000061911822530010300103001094787670499695501000351000359588539626530010300206002010003519311300211091030010106500189021622997143000030010100036100036100036100036100036
300241000357490015886191182253001030010300109478767049969550100035100035958963962653001030020600201000351931130021109103001010000189021622997143000030010100036100036100036100036100036
30024100035749000072691182253001030010300109478767149969550100035100035958853962653001030020600201000351931130021109103001010100189021622997143000030010100036100036100036100036100036

Test 4: throughput

Count: 8

Code:

  sdiv w0, w8, w9
  sdiv w1, w8, w9
  sdiv w2, w8, w9
  sdiv w3, w8, w9
  sdiv w4, w8, w9
  sdiv w5, w8, w9
  sdiv w6, w8, w9
  sdiv w7, w8, w9
  mov w8, #0x80000000
  mov w9, #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)03mmu table walk data (08)18191e1f3f4d51schedule 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)a9acc2branch cond mispred nonspec (c5)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
80204160039119900000100947949455980324801008013944043871491587831618681602351500548149997801618217016421216190626139180201100991008010010000000005110216111599808000080100160040160040160040160040160040
8020416003911990000010579950258012580100801004399351049156959160039160039149901314999780100802001602001600392611180201100991008010010000000005110116111599808000080100160040160040160040160040160040
802041600391199000006179950258010080100801004399225049156959160039160039149901314999780100802001602001600392751180201100991008010010000000005110116111599808000080100160040160040160040160040160040
802041600391198000006179950258010080113801004399225049156959160039160039149901314999780100802001602001600392611180201100991008010010001000005110216231599808000080100160040160040160040160040160040
802041600391199000006179950258010080100801004399225149156959160039160039149901314999780100802001602001600392611180201100991008010010000000005110117211599808000080100160040160040160040160040160040
802041600391199000006179950258010080100801004399225149156959160039160039149901314999780100802001602001600392611180201100991008010010000000005110116011599808000080100160040160040160040160040160040
802041600391199000006179950258010080100801004399225049156959160039160039149901314999780100802001602001600392751180201100991008010010000000005110116111599808000080100160040160040160040160040160040
802041600391198000006179950258010080100801004399225049156959160039160039149901314999780100802001602001600392611180201100991008010010002030005110116111599808000080100160083160040160040160040160040
802041600391198000006179950258010080100801004399225049156959160039160039149901314999780100802641602001600392611180201100991008010010000000005110116111599808000080100160139160040160040160040160239
802041600391199000006179950258010080100801004399225049156959160039160039149901314999780100802001602001600392751180201100991008010010001060005110116111599808000080100160040160040160040160040160040

1000 unrolls and 10 iterations

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

retire uop (01)cycle (02)0309l2 tlb miss instruction (0a)l2 tlb miss data (0b)1e3a3f4d51schedule uop (52)schedule int uop (53)dispatch int uop (56)int uops in schedulers (59)5f60696a6b6d6emap 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)accfd0l1i cache miss demand (d3)d5map dispatch bubble (d6)d9ddfetch restart (de)e0? int output thing (e9)? int retires (ef)f5f6f7f8fd
8002416003911980000061799502580010800108001043987750049156959016003916003914992331500198001080020160020160039261118002110910800101000305020042160221599808000080010160040160040160040160040160040
8002416003911980000061799502580010800108001043987750149156959016003916003914992331500198001080020160020160039261118002110910800101000005020032160221599808000080010160040160040160040160040160040
800241600391199000001037995025800108001080010439877500491569590160039160039149923315001980010800201600201600392611180021109108001010001125020032160221599808000080010160040160040160040160040160040
80024160039119900090726799502580010800108001043987751149156959016003916003914992331500198001080020160020160039261118002110910800101000005020033160221599808000080010160040160040160040160040160040
8002416003911980000061799502580010800108001043987750049156959016003916003914992331500198001080020160020160039261118002110910800101000005080035160221599808000080010160040160237160040160040160040
80024160039119800012061799502580010800108001043987750049156959016003916003914992331500198001080020160020160039261118002110910800101000005020033160221599808000080010160040160040160040160040160040
8002416003911990000061799502580010800108001043987751149156959016003916003914992331500198001080020160020160039261118002110910800101000135020032160221599808004180010160139160040160040160040160139
80024160186119910112061799502580010800108001043987750149156959016003916003914992331500198001080020160020160039261118002110910800101034834725020032160221599808000080010160040160040160040160040160040
8002416003911980000061799502580010800108001043987750149156959016003916003914992331500198001080020160020160039261118002110910800101000005020032160221599808000080010160040160040160040160040160040
8002416003911980000084799502580010800108001043987750149156959016003916003914992331500198001080020160020160039261118002110910800101000005020033160221599808000080010160040160040160040160040160040