Apple M1 Microarchitecture Research by Dougall Johnson

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

USQADD (vector, 4S)

Test 1: uops

Code:

  usqadd v0.4s, v1.4s
  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)03080b18191e1f3a3f4e51inst 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)a0a1a6a7a8a9acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
100430372400000006125482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
1004303723000000014725482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
1004303724000000032925482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000006125482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372400000006125482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000006125482510001000100039831303018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372400000006125482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000008925482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
1004303723000000014725482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
1004303724000000052125482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  usqadd v0.4s, v1.4s
  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)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)9fa8acc2branch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102043003723306129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038
102043003723306129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038
102043003723206129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010010017101161129634100001003003830087300383003830038
102043003723306129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038
102043003723306129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038
102043003723206129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038
102043003723306129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038
102043003723206129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038
102043003723306129548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038
1020430037232071629548251010010010000100100005004277313130018030037300372826532874510100200100002002000030037300371110201100991001001000010000007101161129634100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03080b18191e1f3a3f4e51inst 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)9fa8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003722500000026229548251001010100001010000504277313130018030037300372828721287671001020100002020000300373003711100211091010100001000557106441016101029630010000103003830038300383003830038
100243003722500002190262295302510010101000010100005042773130300373300373003728287328767100102010000202000030037300371110021109101010000100000644816101029630010000103003830038300383003830038
1002430037225000000262295482510010101000010100005042773130300180300373003728287328767100102010000202000030084300371110021109101010000100000644101651029630010000103003830038300383003830059
10024300372250000002622954825100101010000101000050427731303001803003730037282873287671001020100002021294300373003711100211091010100001000006441016101029630010000103003830038300853003830038
10024300372250000002622954825100101010000101000050427731313001803003730037282873287671001020100002020000300373003711100211091010100001000006441016101029630010000103003830038300383003830038
100243003722500006602662954825100101010000101000050427731313001803003730037282873287671001020100002020000300373003731100211091010100001000006441016111129630010000103003830038300383003830038
10024300372250000002662954825100101010000101000050427731303001803003730037282873287671001020100002020000300373003711100211091010100001000006441116101029630010000103003830038300383003830038
10024300372250000002662954825100101010000101000061427867003001803003730037282873287671001020100002020000300373003711100211091010100001000006441016101029630010000103003830038300383003830038
10024300372250000002662954825100101010000101044750427731303001803003730037282873287671001020100002020000300373003711100211091010100001000006441116101029630010000103003830038300383003830038
10024300372250000002662954825100101010000101000050427731303001803003730037282873287671001020100002020000300373003711100211091010100001000306441016101029630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  usqadd v0.4s, v0.4s
  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)03191e1f3a3f4e5051inst 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)9fa0a1a8acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372240000612954730021251010010010000100100005004277160130018300373003728271628733101002001000820020016300373003711102011009910010010000100000011171701600296450100001003003830038300383003830038
1020430037225000061295470251010010010000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009910010010000100000011171701600296460100001003003830038300713003830038
1020430037225000061295470251010010010000100100005004277160130018300373003728271728740101002001000820020016300373003711102011009910010010000100000011171801600296450100001003003830038300383003830038
1020430037225000061295470251010010010000100100005004277160130018300373003728271728741101002001000820020016300373003711102011009910010010000100000011171701600296450100001003003830038300383003830038
1020430037225000061295470251010010010000100100005004277160130018300373003728271728741101002001000820020016300373003711102011009910010010000100000011171701600296450100001003003830038300383003830038
1020430037225000061295470251010010010000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009910010010000100000311171701600296450100001003003830038300383003830038
1020430037225000061295470251010010010000100100005004277160130018300373003728271728740101002001000820020016300373003711102011009910010010000100000011171701600296450100001003003830038300383003830038
1020430037225000061295470251010010410000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009910010010000100000011171701600296450100001003003830038300383003830038
1020430037225000061295470251010010010000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009910010010000100000011171701600296450100001003003830038300383003830038
1020430037224000061295470251010010010000100100005004277160130018300373003728271728741101002001000820020016300373003711102011009910010010000100000011171801600296460100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)030b181e3f4e51inst 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)9fa8a9accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372330006129547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000103009640316332962910000103003830038300383003830038
1002430037233000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010303640316332962910000103003830038300383003830038
100243003723300061295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000150640316332962910000103003830038300383003830038
10024300372330003572954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010400640316332962910000103003830038300383003830038
1002430037232000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010400640316332962910000103003830038300383003830038
10024300372330006129547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000103709640316332962910000103003830038300383003830038
10024300372320007262954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010200640316332962910000103003830038300383003830038
10024300372320001032954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010400640316332962910000103003830038300383003830038
1002430037233000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010400640316332962910000103003830038300383003830038
100243003723300126129547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000105400640316332962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  usqadd v0.4s, v8.4s
  movi v1.16b, 0
  usqadd v1.4s, v8.4s
  movi v2.16b, 0
  usqadd v2.4s, v8.4s
  movi v3.16b, 0
  usqadd v3.4s, v8.4s
  movi v4.16b, 0
  usqadd v4.4s, v8.4s
  movi v5.16b, 0
  usqadd v5.4s, v8.4s
  movi v6.16b, 0
  usqadd v6.4s, v8.4s
  movi v7.16b, 0
  usqadd v7.4s, v8.4s
  movi v8.16b, 9

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)03071e1f3f51inst 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)9fa6a8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204200651560002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600201291600001002006620066200662006620066
16020420065156016225234925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010001001111011901600200621600001002006620066200662006620066
160204200651560005725801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600200621600001002006620066200662006620066
160204200651550002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600200621600001002006620066200662006620066
160204200651560002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600200621600001002006620066200662006620066
160204200651560006025801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600200621600001002006620066200662006620066
16020420065155019202925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600200621600001002006620066200662006620066
1602042006515500013825801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600200621600001002006620066200662006620066
160204200651550002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600200621600001002006620066200662006620066
160204200651550006425801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001111011901600200621600001002006620066200662006620066

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)9fa1a8accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaebec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1600242008715607325800101080000108000050640000111020027200462004632280010208000020160000200462004611160021109101016000010000100331632720422692004730390160000102005120051200512004720051
16002420050155125125800101080000108000050640000011020031200502005032280010208000020160000200502005011160021109101016000010000100351662924422692004730330160000102005120051200512005120052
1600242005015505125800101080000108000050640000011020031200502005032280010208000020160000200502005011160021109101016000010000100321662924422792004730330160000102005120051200512005120051
16002420050156051258001010800001080000506400000110200312004620050322800102080000201600002005020050111600211091010160000100401003516621024422962004730310160000102005120051200512005120051
16002420051155056225800101080000108000050640000011020031200502005032280010208000020160000200502005011160021109101016000010000100361662924422962004730310160000102005120051200512005120051
1600242014015505125800101080000108000050640000011020031200502005032280010208000020160000200502005111160021109101016000010000100351662924422692004732310160000102005420051200512005120051
16002420050155051258001010800001080000506400000110200312005020050322800102080000201600002005320050111600211091010160000100001003516621024422992004732300160000102004720051200512005120051
16002420050155051258001010800001080000506400000110200332005020050322800102080000201600002005020050111600211091010160000100001003216629244226920047304590160000102005120051200552005520051
1600242005015505125800101080000108000050640000011020031200462005032280010208000020160000200502005011160021109101016000010000100321662924422972004730310160000102005120051200512005120051
16002420050155051258001010800001080000506400000110200312005020051322800102080000201600002005020050111600211091010160000100001003316626244229620047303190160000102005120051200512005120141

Test 5: throughput

Count: 16

Code:

  usqadd v0.4s, v16.4s
  usqadd v1.4s, v16.4s
  usqadd v2.4s, v16.4s
  usqadd v3.4s, v16.4s
  usqadd v4.4s, v16.4s
  usqadd v5.4s, v16.4s
  usqadd v6.4s, v16.4s
  usqadd v7.4s, v16.4s
  usqadd v8.4s, v16.4s
  usqadd v9.4s, v16.4s
  usqadd v10.4s, v16.4s
  usqadd v11.4s, v16.4s
  usqadd v12.4s, v16.4s
  usqadd v13.4s, v16.4s
  usqadd v14.4s, v16.4s
  usqadd v15.4s, v16.4s
  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)03080b1e3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)~dispatch ld/st (58)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)9fa6acc5branch mispredict (cb)cdcfd5d6dbddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440059310000302516010810016000810016002005001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000011110118016000400361600001004004040040400404004040040
16020440039310000302516010810016000810016002005001280132140020400394003919977619990160120200160032200320282400394003911160201100991001001600001000011110118016000400361600001004004040040400404004040040
16020440039310000302516010810016000810016002005001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000011110118016000400361600001004004040040400404004040040
16020440039310000302516010810016000810016002005001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000011110118016000400361600001004004040040400404004040040
16020440039310000302516010810016000810016002005001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000011110118016000400361600001004004040040400404004040040
16020440039311000302516010810016000810016002005001280132040020400394003919977619990160120200160032200320064400394003911160201100991001001600001000011110118016000400361600001004004040040400404004040040
16020440039310000302516010810016000810016002005001280132140020400394003919977619990160120200160032200320064400394003911160201100991001001600001000011110118016000400361600001004004040040400404004040040
160204400393100006426160116100160016100160028050012801960400294004940048199761019986160128200160038200320076400484004911160201100991001001600001000022210128123011400461600001004004940049400494004940049
1602044004831000126426160116100160016100160028050012801961400294004840048199761019986160128200160038200320076400484004811160201100991001001600001000022210128123012400461600001004005040050400504004940050
16020440048311000642616011610016001610016002805001280196140029400494004819976919986160128200160038200320076400484004811160201100991001001600001000022210129123011400451600001004004940049400504010040049

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03090a18191e1f3f51inst 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)9fa8a9accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002440039310000000110251600101016000010160000501280000110400204003940039199963200191600102016000020320000400394003911160021109101016000010000100248111216211101140036305160000104004040040400404004040040
1600244009131210012880522516001010160000101600005012800001154002040039400391999632001916001020160000203200004003940039111600211091010160000101001002485111163221111400363110160000104004040040400404004040040
16002440039310000012052251600101016000010160000501280000015400204003940039199963200191600102016000020320000400394003911160021109101016000010000100241162101632299400363110160000104004040040400404004040040
16002455719322000012046251600101016000010160000501280000110400204003940039199963200191600102016000020320000400394003911160021109101016000010003100223111116211918400363010160000104004040040400404004040040
16002440039311000000462516001010160000101600005012800001104002040039400391999632001916001020160000203200004003940039111600211091010160000100001002231110163221016400363110160000104004040040400404004040040
1600244003931000000046251600101016000010160000501280000110400204003940039199963200191600102016000020320000400394003911160021109101016000010000100223111016211122240036155160000104004040040400404004040040
16002440039310000000462516001010160000101600005012800001104002040039400391999632001916001020160000203200004003940039111600211091010160000100001002462211164221017400363012160000104004040040400404004040040
160024400393100000005225160010101600001016000050128000001040020400394003919996320019160010201600002032000040039400391116002110910101600001000010022311121621181840036155160000104004040040400404004040040
160024400393100000005225160010101600001016000050128000001040020400394003919996320019160010201600002032000040039400391116002110910101600001000010024622916422101840036155160000104004040040400404004040040
16002440039310000000512516001010160000101600005012800001104002040039400391999632001916001020160000203200004003940039111600211091010160000100001002231191621191940036155160000104004040040400404004040040