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, 4S)

Test 1: uops

Code:

  sadalp v0.4s, v1.8h
  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)03071e3f4e51inst 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)accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
100430372200612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
100430372300612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
100430372309612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
100430372200612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
1004303723057612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
100430372200612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
100430372300612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
100430372300612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
1004303722063612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038
1004303723018612548251000100010003983130301830373037241532895100010002000303730371110011000073216222630100030383038303830383038

Test 2: Latency 1->1

Code:

  sadalp v0.4s, v1.8h
  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)031e3a3f4e51inst 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)9fa0a7a8a9accdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102043003722400612954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071021622296340100001003003830038300383003830038
102043003722500612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071021622296340100001003003830038300383003830038
102043003722500612953925101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010020000071021622296340100001003003830038300383003830038
102043003722500612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071021622296340100001003003830038300383003830038
102043003722500612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071021622296340100001003003830038300383003830038
10204300372250020192954825101001001000010010000500427731303001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071021623296340100001003003830038300383003830038
102043003722500612954825101001001000010010149500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071021622296340100001003003830038300383003830038
102043003722500612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000171021622296340100001003003830038300383003830038
102043003722500612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071021622296340100001003003830038300383003830038
102043003722500612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000071021622296340100001003003830038300383003830038

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)9fa6a9acc5cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000294806402162229630010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037225061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038
1002430037224061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001020006402162229630010000103003830038300383003830038
1002430037224094295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000006402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  sadalp v0.4s, v0.8h
  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)0309181e3a3f4e51inst 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)696b6d6edispatch stall (70)72scheduler 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)9fa8acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372240000762295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100001117222242229629100001003003830038300383003830038
1020430037224000197295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100031117222242229629100001003003830038300383003830038
1020430037225000197295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100001117222242229629100001003003830038300383003830038
1020430037225000197295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100001117222242229629100001003003830038300383003830038
1020430037225000197295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100001117222242229629100001003003830038300383003830038
1020430037225000197295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100101117222242229629100001003003830038300383003830038
1020430037225000197295472510100100100071001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100001117222242229629100001003003830038300383003830038
1020430037225000197295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100001117222242229629100001003003830038300383003830038
1020430037225000197295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100001117222242229629100001003003830038300383003830038
1020430037224000197295472510100100100001001000050042771603001803003730037282520628733101002001000020020000300373003711102011009910010010000100001117222242229629100001003003830038300383003830038

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)9fa1a7a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372252710329547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
1002430037225021729547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
1002430037225010329547441001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
10024300372251832929547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
1002430084225032429547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
100243003722508429547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
1002430037225053529547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
1002430037225056029547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
1002430037225036929547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038
10024300372250122729547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000640316332962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  sadalp v0.4s, v8.8h
  movi v1.16b, 0
  sadalp v1.4s, v8.8h
  movi v2.16b, 0
  sadalp v2.4s, v8.8h
  movi v3.16b, 0
  sadalp v3.4s, v8.8h
  movi v4.16b, 0
  sadalp v4.4s, v8.8h
  movi v5.16b, 0
  sadalp v5.4s, v8.8h
  movi v6.16b, 0
  sadalp v6.4s, v8.8h
  movi v7.16b, 0
  sadalp v7.4s, v8.8h
  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)0307080a191e1f3f51inst 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)696d6escheduler 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)9fa8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602042006515110100029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000001111011921611200621600001002006620066200662006620066
16020420065151101000113258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000001111011911611200621600001002006620066200662006620066
1602042013315110100052258011610080016100800285006401962004520065200656128012820080028200160056200652013311160201100991001001600001000061111011911611200621600001002006620066200662006620066
1602042006515010100029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001001031111011911611200621600001002006620066200662006620066
1602042006515010100029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000001111011911611200621600001002006620066200662006620066
1602042006515010100029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000001111011911611200621600001002006620066200662006620066
1602042006515010100029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000001111011911611200621600001002006620066200662006620066
1602042006515010100029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001001031111011911611200621600001002006620066200662006620066
1602042006515010100029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001001031111011911611200621600001002006620066200662006620066
1602042006515110100029258011610080016100800285006401962004520065200656128012820080028200160056200652006511160201100991001001600001000001111011911611200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)031e3f51inst 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)5f6061696d6escheduler 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)e0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024200811500452580010108000010800005064000011520027200462004632280010208000020160000200462004611160021109101016000010000100348211220211111120043150160000102004720047200472004720047
16002420046150087258001010800001080000506400001152002720046200463228001020800002016000020046200461116002110910101600001000010032821920211121120043150160000102004720047200472004720047
1600242004615004565800101080000108000050640000115200272004620046322800102080000201600002004620046111600211091010160000100001003282192021191020043150160000102004720047200472004720047
1600242004615004525800101080000108000050640000115200272004620046322800102080000201600002004620046111600211091010160000100001003482192021189200431552160000102004720047200472004720047
160024200461500452580010108000010800005064000011520027200462004632280010208000020160000200462004611160021109101016000010100100328219202119920043310160000102004720047200472004720047
160024200461500512580010108000010800005064000011520027200462004632280010208000020160000200462004611160021109101016000010000100348211020211121220043150160000102004720047200472004720047
16002420046150045258001010800001080000506400001152002720046200463228001020800002016000020046200461116002110910101600001000010033821112021191220043150160000102004720047200472004720047
160024200461500452580010108000010800005064000011520027200462004632280010208000020160000200462004611160021109101016000010000100338218202118920043150160000102004720047200472004720047
160024200461500452580010108000010800005064000011520027200522004632280010208000020160000200462004611160021109101016000010000100328219244119920043150160000102004720047200472004720047
160024200461500512580010108000010800005064000011520027200462004632280010208000020160000200462004611160021109101016000010000100338211220211121120043300160000102004720047200472004720047

Test 5: throughput

Count: 16

Code:

  sadalp v0.4s, v16.8h
  sadalp v1.4s, v16.8h
  sadalp v2.4s, v16.8h
  sadalp v3.4s, v16.8h
  sadalp v4.4s, v16.8h
  sadalp v5.4s, v16.8h
  sadalp v6.4s, v16.8h
  sadalp v7.4s, v16.8h
  sadalp v8.4s, v16.8h
  sadalp v9.4s, v16.8h
  sadalp v10.4s, v16.8h
  sadalp v11.4s, v16.8h
  sadalp v12.4s, v16.8h
  sadalp v13.4s, v16.8h
  sadalp v14.4s, v16.8h
  sadalp v15.4s, v16.8h
  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)0309191f373f51inst 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)696b6d6edispatch 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)9fa8acc5branch mispredict (cb)cdcfd6dde0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440085299100096251601171001600171001600205001320130400200400484004019977619991160120200160032200320064400394004911160201100991001001600001000011110118160400371600001004005040040400414005040049
160204400403000001730251601081001600081001600205001320132400210400394003919977619990160120200160032200320064400404004911160201100991001001600001000011110118160400461600001004004040041400504004040040
16020440048300000040251601091001600081001600205001320129400210400484003919977620000160120200160032200320064400494003911160201100991001001600001000011110118160400371600001004004040050400404004140050
1602044003930000001892516010810016000810016002050013201314002004003940040199771520025160120200160032200320064400484004811160201100991001001600001000011110118160400361600001004004040041400414004040040
16020440039300000040251601081001600171001600205001280132400210400404003919977620000160120200160032200320064400394004911160201100991001001600001000011110118160400371600001004004140050400404004140040
16020440040300000040251601081001600081001600205001280132400210400404004919977620000160120200160032200320064400404004911160201100991001001600001000011110118160400371600001004004140050400404004140040
16020440040300000039251601171001600091001600205002399159400200400404004919977619991160120200160032200320064400494003911160201100991001001600001006011110118160400361600001004004140050400404004140040
16020440040300000193251601081001600171001600205001280132400300400394003919977620000160120200160032200320064400484004011160201100991001001600001000011110118160400451600001004004040041400504004040041
16020440040300000030251601081001600091001600205001280132400300400394004019977619991160120200160032200320064400404004011160201100991001001600001000011110118160400371600001004004040049400414004140041
16020440040300000039251601081001600091001600205001280132400210400394003919977619991160120200160032200320064400394004011160201100991001001600001000011110118160400461600001004004940050400404004940041

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03080b18191e1f373a3f4e51inst 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)72scheduler 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)9fa0a1a6a8a9acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002440040300000000180560251600111016001810160000501319997115400304004940049199960320028160010201600002032000040048400391116002110910101600001000000001002211324162113240046156160000104005040040403284035140452
16002440525304118911889685911521417116118910161106101612226117366680154036740573404942013204720317161204201609812032232840629405581011600211091010160000100222040330100228412164114240046156160000104005040050400504005040040
160024400493000000510180890251600101016000110160000501280000115400294004040040199960132007816001020160000203200004004940049211600211091010160000100000000100228413162113340036155160000104004940040400404004140040
160024400403000030001801840251600281016001710160307502438865115400304004940039199960320028160010201600002032000040049400491116002110910101600001000010001002211512162113240036156160000104005040050400404005040050
1600244004930001000018046025160467101600001016000050243886511540030400484004819996032010816001020160000203200004004040048111600211091010160000100000000100248423162123340045155160000104004140049400404004940102
1600244003930000000018056025160028101600181016000050239902711540030400494004919996032014616001020160000203200004004940049111600211091010160000100001000100228412162112340046156160000104005040050400504004040040
16002440049300000000180460251600281016001810160000502438865115400204004940049199960820086160010201600002032000040048400992116002110910101600001000012001004281013552213340046156160000104005040040400504005040040
16002440049300000012018055025160028101601131016000050128000001540020400494004919996032001916001020160000203200004004940039111600211091010160000100000000100228412162113340046156160000104005040050400504004040050
1600244004930000001200055025160011101600171016000050239899911540029400404004019996032001916001020160000203200004004940049111600211091010160000100000030100248413162113340046156160000104005040050400494004040049
1600244004929900000018056025160028101600001016000050128000011540029400494004919996032001916001020160000203200004004940049111600211091010160000100000000100228512162112340046156160000104005040040401004005040050