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, 8H)

Test 1: uops

Code:

  usqadd v0.8h, 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)0308090b18191e1f3f4e51inst 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
100430372400000008225482510001000100039831303018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000006125482510001000100039831303018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372400000006125482510001000100039831303018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000008225482510001000100039831303018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372400000006125482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000006125482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000006125482510001000100039831313018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000006125482510001000100039831303018303730372415328951000100020003037303711100110000000000073116112630100030383038303830383038
100430372300000006125482510001000100039831303018303730372415328951000100020003037303711100110000400102513294116112690100030853038308530743084
100430842410100132888225394910001008100039967013018303730372415729141149116320003083308411100110000200001238273116112630100030853086307430853074

Test 2: Latency 1->1

Code:

  usqadd v0.8h, 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)0308091e3f4e51inst 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)9fa0a1a6a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372330106129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000203000071011611296340100001003003830038300383003830038
102043003723200010329548251010010010000100100005004277313030018300373008428265328745101002001000020020000300373003711102011009910010010000100000203000071011611296340100001003003830038300383003830038
102043003723300061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000005900000071011611296340100001003003830038300383003830038
10204300372320006129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000700000071011621296340100001003003830038300383003830038
102043003723300061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000003106000071011611296340100001003003830038300383003830038
1020430037233000612954825101001001000010010000500427731313001830037300372826532874510100200100002002000030037300371110201100991001001000010000000120000071011611296340100001003003830038300383003830038
102043003723300061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000003003000071011611296340100001003003830038300383003830038
1020430037232000744295482510100100100001001000050042773130300183003730037282653286791010020010008200200163003730037111020110099100100100001000002706011171801600296470100001003003830038300383003830038
10204300372320006129548251010010010000100100005004277313030018300373003728272728740101002001000820020016300373003711102011009910010010000100020002831011171701600296470100001003003830038300383003830038
10204300372330006129548461010010010000100101495004277313030018300373008528287728756101002021000820020358300373003721102011009910010010000100000203200077613211296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03080b18191e1f3f4e51inst 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)9fa0a1a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372330000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006403162229630010000103003830038300383003830038
10024300372320000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
10024300372320000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830078
10024300372330000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
10024300372330000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
10024300372320000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
10024300372330000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
10024300372330000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
10024300372330000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
10024300372330000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  usqadd v0.8h, 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)030818191e1f3a3f4e51inst 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)91inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa0a1a6a8acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372330000006129547251010010010000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009901001001000010000000011174101600296450100001003003830038300383003830038
10204300372330000006129547251010010010000100100005004277160130018300373003728271728741101002001000820020016300373003711102011009901001001000010000000011171801600296460100001003003830038300383003830038
10204300372320000006129547251010010010000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009901001001000010000000011171801600296450100001003003830038300383003830038
102043003723300000067929547251010010010000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009901001001000010000000011171701600296450100001003003830038300383003830038
10204300372330000006129547251010010010000100100005004277160130018300373003728271728740101002001000820020016300373003711102011009901001001000010000000011171801600296460100001003003830038300383003830038
10204300372320000006129547251010010010000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009901001001000010000000011171801600296450100001003003830038300383008530038
10204300372330000006129547251010010010000100100005004277160130018300373003728271728741101002001000820020016300373003711102011009901001001000010000000011171701600296460100001003003830038300383003830038
10204300372330000008929547251010010010000100100005004277160130018300373003728271628740101002001000820020016300373003711102011009901001001000010000000011171801600296450100001003003830038300383003830038
10204300372330000006129547251010010010000100100005004277160130018300373003728271628741101002001000820020016300373003711102011009901001001000010000000011171801600296450100001003003830038300383003830038
102043003723200000053629547251010010010000100100005004277160130018300373003728271628740101002001000820020016300373003711102011009901001001000010000000011171801600296460100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03181e3a3f4e51inst 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)9fa0a1a7a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003723300262295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000000644101610102962910000103003830038300383003830038
100243003723300262295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000000644101610102962910000103003830038300383003830038
1002430037232032622954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000006441016582962910000103003830038300383003830038
1002430037233018262295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000000644101610102962910000103003830038300383003830038
100243003723300262295472510010101000010100005042771601300183003730037282863287671001020100002020000300373003711100211091010100001000055064452510102962910000103003830038300383003830038
100243003723300262295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000009644101610102962910000103003830038300383003830038
100243003723200262295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000000644816852962910000103003830038300383003830038
100243003723300262295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000000644816882962910000103003830038300383003830038
100243003723201226229547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000100003064451610102962910000103003830038300383003830038
10024300372330623032954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000470644101610102962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  usqadd v0.8h, v8.8h
  movi v1.16b, 0
  usqadd v1.8h, v8.8h
  movi v2.16b, 0
  usqadd v2.8h, v8.8h
  movi v3.16b, 0
  usqadd v3.8h, v8.8h
  movi v4.16b, 0
  usqadd v4.8h, v8.8h
  movi v5.16b, 0
  usqadd v5.8h, v8.8h
  movi v6.16b, 0
  usqadd v6.8h, v8.8h
  movi v7.16b, 0
  usqadd v7.8h, 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)03191e1f3f51inst 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)9fa1a6a8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602042006515600029258021010080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011921600200621600001002006620066200662006620066
1602042006515500029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
1602042006515500029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000031111011901600200621600001002006620066200662006620066
1602042006515609029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
160204200651560002925801161008001610080028500640196020111200652006561280128200800282001600562006520065111602011009910010016000010000001681111011901600201411600001002006620066200662006620066
16020420065155090291078022410080016100801335006427560200452006520065612803372008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
1602042006515500029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
1602042006515600029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
1602042006515500029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011901600200621600001002006620066200662006620066
1602042006515606029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100001001111011901600200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0304080b1e3a3f51inst 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)9fa0a8acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaebec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002420078155100004527800101080000108000050640000115200342005120051322800102080000201600002005320053111600211091010160000100000100401321192542117172004820069160000102005220052200612005220052
1600242005315500000452780010108000010800005064000011102004320051200513228001020800002016000020060200511116002110910101600001001900100411362163442214112005920031160000102006120061200632006320052
1600242005115500000512980010108000010800005064000011102003420053200513228001020800002016000020051200511116002110910101600001000001003713511425211151720050210131160000102006120063200632006320061
160024200511550000045278001010800001080000506400000110200412005120053322800102080000201600002007620141111600211091010160000100000100401351172511217162004821037160000102005220063200542005220052
160024200511560000045278001010800001080000506400000110200412005320062322800102080000201600002005120051111600211091010160000100000100431651132721117112004820029160000102005420054200522005520052
160024200511560000045278001010800001080000506400001110200322005320053322800102080000201600002005120051111600211091010160000100000100401371173411119182005021033160000102005220061200522005220054
160024200531550001804527800101080000108000050640000111020034200602005332280010208000020160000200532005311160021109101016000010020010042167116158221191620057200117160000102005420055200522005220052
160024200601550000087278001010800001080000506400001110200352005120051322800102080000201600002006220053111600211091010160000100000100391371172722118192004821027160000102006120054200542005520063
160024200611550000045278001010800001080000506400000110200322005120051322800102080000201600002005120060111600211091010160000100000100411371162511120192004821036160000102005420054200522005220053
160024200521550000051278001010800001080000506400001110200322005320053322800102080000201600002006020056111600211091010160000100000100381351183411117132004820026160000102005220052200612005420061

Test 5: throughput

Count: 16

Code:

  usqadd v0.8h, v16.8h
  usqadd v1.8h, v16.8h
  usqadd v2.8h, v16.8h
  usqadd v3.8h, v16.8h
  usqadd v4.8h, v16.8h
  usqadd v5.8h, v16.8h
  usqadd v6.8h, v16.8h
  usqadd v7.8h, v16.8h
  usqadd v8.8h, v16.8h
  usqadd v9.8h, v16.8h
  usqadd v10.8h, v16.8h
  usqadd v11.8h, v16.8h
  usqadd v12.8h, v16.8h
  usqadd v13.8h, v16.8h
  usqadd v14.8h, v16.8h
  usqadd v15.8h, 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.2503

retire (01)cycle (02)03070918191e1f3f51inst 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)9fa0a1a7a8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602044005831000000010242516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040
16020440039310000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040
16020440039310000000872516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040
16020440039310000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000311110118116114003601600001004004040040400404004040040
16020440039311000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040
16020440039311000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040
160204400393100000006952516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040
16020440039310000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040
16020440039310000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040
16020440039310000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118116114003601600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0307080b18191e1f3a3f51inst 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)9fa0a1a6a8a9acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0? int output thing (e9)eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1600244003931000000001151251600101016000010160000501280000105400204003940039199963200191600102016000020320000400394003911160021109101016000010000000010022811716211104400360155160000104004040040400404004040040
160024400393100000000146251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010000000010024112241642296400360155160000104004040040400404004040040
1600244003931100000001153251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010000000010024115261642269400360155160000104004040040400404004040040
1600244003931100000001279251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010000006010039841916211664003603010160000104004040040400404004040040
1600244003931000000001522516001010160000101600005012800000154002040039400391999632001916001020160000203200004003940039111600211091010160000100000000100241152916422594003603010160000104004040040400404004040040
1600244003931100000001522516001010160000101600005012800000154002040039400391999632001916001020160000203200004003940039111600211091010160000100000000100261152916422564003603010160000104004040040400404004040040
1600244003931000000000742516001010160000101600005012800001054002040039400391999632001916001020160000203200004003940039111600211091010160000100000000100261152516422964003603010160000104004040040400404004040040
1600244003931000000000462516001010160000101600005012800001154002040039400391999632001916001020160000203200004003940039111600211091010160000100000030100261152416422664003603010160000104004040040400404004040040
1600244003931100000000462516001010160000101600005012800001104002040039400391999632001916001020160000203208464003940039111600211091010160000100000000100261152916422694003603010160000104004040040400404004040040
1600244003931000000000462516001010160000101600005012800001054002040039400391999632001916001020160000203200004003940039111600211091010160000100000000100261152816422664003603010160000104004040040400404004040040