Apple M1 Microarchitecture Research by Dougall Johnson

Firestorm: Overview | Base Instructions | SIMD and FP Instructions
Icestorm:  Overview | Base Instructions | SIMD and FP Instructions

SADALP (vector, 4H)

Test 1: uops

Code:

  sadalp v0.4h, v1.8b
  movi v0.16b, 1
  movi v1.16b, 2

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 1.000

Integer unit issues: 0.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 1.000

retire (01)cycle (02)03191e3f4e51inst issue (52)~issue fp/simd (54)~dispatch fp/simd (57)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op fp/simd (7e)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst neon or fp (9a)a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
10043037230012125482510001000100039831313018303730372415328951000100020003037303711100110000073216112630100030383038303830383038
1004303723006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303722006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
10043037220015625482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303722006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
10043084230698225482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723036125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303723006125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372201566125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  sadalp v0.4h, v1.8b
  movi v0.16b, 1
  movi v1.16b, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)031e3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372256612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
102043003723324612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
102043003722507262954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
102043003722527612954825101001001000010010000500427731330018300373003728265328745104102121000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
102043003722504412954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
102043003722501562954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102021009910010010000100007101161129634100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0318191e1f3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa1a8accdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225031207129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000640316222963010000103003830038300383003830038
1002430037225001806129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000640216222963010000103003830038300383003830038
100243003722500006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000640216222963010000103003830038300383003830038
100243003722500006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300841110021109101010000100000640216222963010000103003830038300383003830038
100243003722500006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000640216222963010000103003830038300383003830038
1002430037224020025129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000640216222963010000103003830038300383003830038
1002430037225023961766129548251002010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000640216222963010000103003830038300383003830038
1002430037225000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000150640216222963010000103003830038300383003830038
100243003723300006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000640216222963010000103003830038300383003830038
1002430037225000063129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000102001640216222963010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  sadalp v0.4h, v0.8b
  movi v0.16b, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0318191e3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8acc2c5branch mispredict (cb)cdcfd6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372250006129547251010010010000100100005004277160030018300373003728274628740101002001000820020016300373003711102011009910010010000100000111717160029645100001003003830038300383003830038
102043003722400072629547251010010010000100100005004277160030018300373003728271628740101002001000820020016300373003711102011009910010010000100000111718160029645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271728741101002001000820020016300373003711102011009910010010000100000111718160029646100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271628741101002001000820020016300373003711102011009910010010000100000111717160029645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271728740101002001000820020016300373003711102011009910010010000100000111718160029646100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160130018300373003728271728740101002001000820020016300373003711102011009910010010000100000111717160029645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271628740101002001000820020016300373003711102011009910010010000100000111718160029645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300843003728271728741101002001000820020016300373003711102011009910010010000100000111717160029645100001003003830038300383003830038
10204300372250006129547251010010010000100100005004277160030018300373003728271728741101002001000820020016300373003711102011009910010010000100130111718160029645100001003003830038300383003830038
10204300372240006129547251010010010000100100005004277160030018300373003728271628740101002001000820020016300373003711102011009910010010000100000111718160029645100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)031e3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8accdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225126129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000102960640316222962910000103003830038300383003830038
1002430037225010329547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000100450662216222962910000103003830038300383003830038
100243003722506129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000105190640216222962910000103003830038300383003830038
100243003722506129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000104390640216222962910000103003830038300383003830038
100243003722506129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000105160640216222962910000103003830038300383003830038
100243003722506129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000105490640216222962910000103003830038300383003830038
100243003722506129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000103600640216222962910000103003830038300383003830038
100243003722506129547441001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000101210640216222962910000103003830038300383003830038
100243003722506129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000100840640216222962910000103003830038300383003830038
100243003722506129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000105100640216222962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  sadalp v0.4h, v8.8b
  movi v1.16b, 0
  sadalp v1.4h, v8.8b
  movi v2.16b, 0
  sadalp v2.4h, v8.8b
  movi v3.16b, 0
  sadalp v3.4h, v8.8b
  movi v4.16b, 0
  sadalp v4.4h, v8.8b
  movi v5.16b, 0
  sadalp v5.4h, v8.8b
  movi v6.16b, 0
  sadalp v6.4h, v8.8b
  movi v7.16b, 0
  sadalp v7.4h, v8.8b
  movi v8.16b, 9

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)03080918191e1f3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6escheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa1a8a9acc2c5branch mispredict (cb)cdcfd5d6dde0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204200901500000002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000030111101191490200621600001002006620066200662006620066
160204200651510000002925801161008001610080028500641060120045200652016861280128200800282001600562006520065111602011009910010016000010000000111101190160200621600001002006620066201482006620066
16020420065150000002642925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000060111101190480200621600001002006620066200662006620066
1602042014615000000029258011610080016100800285006401961200452006520065633801282008002820016005620065200651116020110099100100160000100028000111101190160200621600001002006620066200662006620066
160204200651500000002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000004111101190160200621600001002006620066200662006620066
160204200651510000002925801161008001610080028500641036020045200652006561280128200800282001600562006520065111602011009910010016000010000000111101470160200621600001002006620066200662014820066
160204200651510100002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000000111101190160200621600001002006620147200662006620066
1602042006515100000029258011610080016100800285006401960200452006520065141280128200800282001600562006520065111602011009910010016000010000000111101190160200621600001002006620066200662006620066
1602042006515000000029258011610080016100800285006401960200452006520065131280128200800282021600562006520065111602011009910010016000010000000111101190160200621600001002006620066200662006620066
160204200651500000002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000000111101190160200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)033f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)5f60696d6escheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8acc5cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024200731505125800101080000108000050640000012003120046200503228001020800002016000020050200501116002110910101600001000010027611420212342004315160000102005520047200472004720047
160024200461505525800101080000108000050640000102002720046200463228001020800002016000020046200461116002110910101600001000010028311420211432004315160000102005520047200472004720047
160024200461504525800101080000108000050640000102002720046200463228001020800002016000020046200461116002110910101600001010010028311320211452004315160000102005520047200472004720047
160024200461504525800101080000108000050640000102002720046200463228001020800002016000020046200461116002110910101600001000010027311420221442004315160000102006720047200472004720047
160024200461504525800101080000108000050640000112002720046200463228001020800002016000020050200461116002110910101600001013010027311420211342004730160000102005520047200472005120047
1600242004615045258001010800001080000506400001020027200462004632280010208000020160000200462005011160021109101016000010021010030311320211262004315160000102005920047200472004720047
160024200501504525800101080000108000050640000102002720046200463228001020800002016000020046200461116002110910101600001000010026311320211432004315160000102005520047200472004720047
160024200461504525800101080000108000050640000112002720046200463228001020800002016000020046200461116002110910101600001000010026311420211442004315160000102006720047200472004720047
160024200461504575800101080000108000050640000112002720046200463228001020800002016000020046200461116002110910101600001000010028611420221532004315160000102006720047200472004720047
160024200461504525800101080000108000050640000012003120046200463228001020800002016000020046200461116002110910101600001000010027312320211352004315160000102005920047200472004720047

Test 5: throughput

Count: 16

Code:

  sadalp v0.4h, v16.8b
  sadalp v1.4h, v16.8b
  sadalp v2.4h, v16.8b
  sadalp v3.4h, v16.8b
  sadalp v4.4h, v16.8b
  sadalp v5.4h, v16.8b
  sadalp v6.4h, v16.8b
  sadalp v7.4h, v16.8b
  sadalp v8.4h, v16.8b
  sadalp v9.4h, v16.8b
  sadalp v10.4h, v16.8b
  sadalp v11.4h, v16.8b
  sadalp v12.4h, v16.8b
  sadalp v13.4h, v16.8b
  sadalp v14.4h, v16.8b
  sadalp v15.4h, v16.8b
  movi v16.16b, 17

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)0309181e373a3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696b6d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa6a8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440059300009003025160117100160008100160020500239921414002004003940048199776199991601202001600322003200644003940048111602011009910010016000010000001111011821611400361600001004004040049400494004040040
16020440039299000103925160117100160017100160020500128013214002104004040049199776199991601202001600322003200644003940039111602011009910010016000010000001111011811611400371600001004004140049400494004040041
16020440040301020003925160108100160105100160020500128013214002104004940049199776199901601202001600322003200644004040049111602011009910010016000010000001111011811611400461600001004004040040400404005040041
16020440040300000004025160108100160017100160020500132013114002104004940039199776199901601202001600322003200644003940040111602011009910010016000010000001111011811611400361600001004005040049402554004040049
16020440048300100103025160109100160009100160020500128013214003004004040040199776199901601202001600322003200644003940040111602011009910010016000010000001111011811611400361600001004004140040400504004040040
160204400492990001703025160117100160017100160020500239915914002004004940039199776199991601202001600322003200644004940039111602011009910010016000010000001111011811611400461600001004004940049400404004040050
16020440039300000004025160109100160009100160020500239913104002004004040040199776199991601202001600322003200644003940040111602011009910010016000010000001111011821611400371600001004004940049400404004040050
16020440049300000104025160108100160017100160020500132013214002104004940039199776199991601202001600322003200644004940039111602011009910010016000010000001111011811611400361600001004004040040400414004140040
1602044003930000010230251601091001600081001600205001320129140029040040400481997761999116012020016003220032006440039400401116020110099100100160000100056031111011811611400451600001004004940040400404004140049
16020440048300000103125160118100160018100160020500128013214002004004940039199776199901601202001600322003200644004940039111602011009910010016000010000001111011811611400451600001004004040040400414005040041

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03080b18191e1f373f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)5f6061696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa1a8acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024400503000000615005502516002810160000101600005023989991154002940039400391999632002016001020160000203200004004840040111600211091010160000100000100228216162114540036155160000104005040049400494004040050
160024400493000000000520251600101016001710160000502399027110400214003940039199963200201600102016000020320000400494003911160021109101016000010000010024115251642255400363010160000104004940040400494004040041
1600244004929900000005502516001110160001101600005023990271154002140039400391999632002816001020160000203200004003940048111600211091010160000100000100228215162115440046155160000104005040040400494004040040
160024400392990000000550251600271016000110160000502398999105400204004840102199963200191600102016000020320000400394004911160021109101016000010002370100246524164225440037305160000104004040040400494005040040
1600244004030000000004702516001010160000101600005023990271154002940039400391999632001916001020160000203200004003940039111600211091010160000100000100228414162115440045155160000104004040049400404004940040
160024400392990000000560251600111016000010160000501280000115400204003940049199963200281600102016000020320000400484003911160021109101016000010009350100228415162116540045156160000104004040040400494004040172
16002440060300000000043302516001010160017101600005023990271104011440040400391999632001916001020160000203200004005140049111600211091010160000100004100448414162114540045155160000104004040437400414005040040
1600244004030000200005602516001010160001101600005023990271154003040040400481999632001916001020160000203200004003940049111600211091010160000100000100223415412115440036155160000104004140040400504004040050
1600244004930000000017560251600271016001710160000502398999105400294004040048199963200191600102016000020320000400394004811160021109101016000010001290100468416162115540036155160000104005240050400414004040050
16002440040300000000175602516001010160000101600005023990271054002040040400491999632002916001020160000203200004004940040111600211091010160000100000100228415162115440046155160000104004940049400404004940040