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, 16B)

Test 1: uops

Code:

  usqadd v0.16b, v1.16b
  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)031e3f4e51inst 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
1004303723038225482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372406125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372406125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000094216222630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073216222630100030383038303830383038
100430372406125482510001000100039831313018303730372415328951000100020003037303711100110000073216222630100030383038303830383038

Test 2: Latency 1->1

Code:

  usqadd v0.16b, v1.16b
  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)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)9fa8c2c5cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037225061295482510100100100001001000050042773131300903003730037282653287451010020010000200200003003730037111020110099100100100001000007102161129634100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038
1020430037225082295484410100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038
1020430037225061295482510100100100001001000050042773131300183003730037282653287451010020010000200200003003730037111020110099100100100001000007101161129634100001003003830038300383003830038

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)9fa1a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225285612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
100243003722524612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037225455362954825100101010000101000050427731313001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372252552992954825100101010000101000050427731303001830037300372828772876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372253542512954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037225288612954825100191010000101000050427731313001830037300372828732876710010201000022200003003730037111002110910101000010033640216222963010000103003830038300383003830038
1002430037225294612954825100101010000101000050427731313001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372242917262954825100101010000101000050427731313001830037300372828732876710010201000020200003003730037111002110910101000010006640216222963010000103003830038300383003830038
10024300372243815852954825100101010000101000050427731313001830037300372828732884110010201000020200003003730037111002110910101000010000640316222963010000103003830038300383003830038
1002430037225321612954825100101010000101000050427731313001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  usqadd v0.16b, v0.16b
  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)0308090b18191e1f3a3f4e51inst 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)9fa0a1a6a7a8a9acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037232000001200612954725101001001000010010000500427716003001830037300372827172874110100200100082002001630037300371110201100991001001000010000000000111718016002964500100001003003830038300383003830038
102043003723300000000612954725101001001000010010000500427716003001830037300372827162874010100200100082002001630037300371110201100991001001000010000001000111718016002964500100001003003830038300383003830038
1020430037233000000001032954725101001001000010010000500428256803001830037300372827172874110248200100082002001630037300371110201100991001001000010000000000111718016002964500100001003003830038300383003830038
102043003723300000000612954725101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010000000000111717016002964600100001003003830038300383003830038
1020430037233000000006129547251010010010000100100005004277160030018300373003728271628741101002001000820020016300373003711102011009910010010000100000000900111717016002964500100001003003830038300383003830038
102043003723300000000612954725101001001000010010000500427716003001830037300372827162874010100200100082002001630037300371110201100991001001000010000000000111717016002964500100001003003830038300383003830038
10204300372330000000082295472510100100100001001000050042771600300183003730037282717287401010020010008200200163003730037111020110099100100100001000000001350111718016002964600100001003003830038300383003830038
1020430037233000003006312954725101001001000010010000500427716003001830037300372827162874010100200100082002001630037300371110201100991001001000010000000000111718016002964500100001003003830038300383003830038
10204300372330002127600892954725101001001000010010000500427716003001830037300372827162874110100200100082002001630037300371110201100991001001000010000000000111718016002964500100001003003830038300383003830038
102043003723200000000612954725101001001000010010000500427716003001830037300372827172874010100200100082002001630037300371110201100991001001000010000000000111718016002964500100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03080a0b18191e1f3a3f4e51inst 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)9fa0a1a6a7a8acc2cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003723200000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
100243003723200000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006612162229629010000103003830038300383003830038
100243003723300000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
100243003723300000900612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
10024300372330000000041312954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
100243003723300000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
1002430037232000000005362954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
100243003723200000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
1002430037233000000006312954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038
100243003723200000000612954725100101010000101000050427716013001830037300372828632876710010201000020200003003730037111002110910101000010000000006402162229629010000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  usqadd v0.16b, v8.16b
  movi v1.16b, 0
  usqadd v1.16b, v8.16b
  movi v2.16b, 0
  usqadd v2.16b, v8.16b
  movi v3.16b, 0
  usqadd v3.16b, v8.16b
  movi v4.16b, 0
  usqadd v4.16b, v8.16b
  movi v5.16b, 0
  usqadd v5.16b, v8.16b
  movi v6.16b, 0
  usqadd v6.16b, v8.16b
  movi v7.16b, 0
  usqadd v7.16b, v8.16b
  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)0307080a0b0f18191e1f3a3f51inst 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)5f696d6escheduler 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)9fa0a1a6a7a8a9acc2c5branch mispredict (cb)cdcfd5d6dbddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020420088155000000000129258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000023000111101190160002006201600001002006620066200662006620066
16020420065156000000000071258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000000150111101190160002006201600001002006620066200662006620066
1602042006515500000000002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000001000111101190160002006201600001002006620066200662006620066
160204200651560000000000292580116100800161008002850064019602004520065200654012801282008002820016005620065200651116020110099100100160000100000040840111101190160002006201600001002006620066200662006620066
16020420065155000000000029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100000018090111101190160002006201600001002006620066200662006620066
1602042006515500000000002925801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010000001000111101190160002006201600001002006620066200662006620066
1602042006515500000000002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000000000111101190160002006201600001002006620066200662006620066
1602042006515500000000002925801161008001710080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000001000111101190160002006201600001002006620066200662006620066
1602042006515600000000002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000000000111101190160002006201600001002006620066200662006620066
1602042006515500000000002925801161008012310080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010000001030111101190160002006201600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0318191e3f51inst 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)9fa0a6a8a9acc5cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0? int output thing (e9)eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1600242007215500087258001010800001080000506400001102002720046200463228001020800002016000020046200461116002110910101600001000000010032341142021153200430150160000102004720047200472004720266
1600242004615500045258001010800001080000506400001002003120050200503228001020800002016000020050200501116002110910101600001000001201003284192021153200430150160000102004720047200472004720222
160024200461550004525800101080000108000050640000115200272004620046322800102080000201600002004620046111600211091010160000100000601002684152021135200430150160000102004720047200472004720436
16002420046165000452580010108000010800005064000011520027200462004632280010208000020160000200462004611160021109101016000010200014101002684132021155200430150160000102004720047200472004720213
1600242005015600051258001010800001080000506400000152003120050200503228001020800002016000020050200501116002110910101600001000000010031115232442235200470300160000102005120051200512005120172
1600242004615500045258001010800001080000506400000152003120050200503228001020800002016000020050200501116002110910101600001000003010031115232442249200470300160000102005120051200512005120172
1600242004615500045258001010800001080000506400001152002720046200463228001020800002016000020046200461116002110910101600001000048101002884132221195200430150160000102004720047200472013820371
1600242005015511051258001010800001080000506400000152003120050200503228001020800002016021020050200501116002110910101600001002000010035115252042235200470300160000102005120051200512005120169
160024200501550005125800101080000108000050640000015200312005220050322800102080000201600002005020050111600211091010160000100000126010030115232442253200470300160000102005120051200512005120172
1600242005015500051258001010800001080000506400000152003120050200463228001020800002016000020117200501116002110910101600001000104501003585292442253200470300160000102005120051200512005120174

Test 5: throughput

Count: 16

Code:

  usqadd v0.16b, v16.16b
  usqadd v1.16b, v16.16b
  usqadd v2.16b, v16.16b
  usqadd v3.16b, v16.16b
  usqadd v4.16b, v16.16b
  usqadd v5.16b, v16.16b
  usqadd v6.16b, v16.16b
  usqadd v7.16b, v16.16b
  usqadd v8.16b, v16.16b
  usqadd v9.16b, v16.16b
  usqadd v10.16b, v16.16b
  usqadd v11.16b, v16.16b
  usqadd v12.16b, v16.16b
  usqadd v13.16b, v16.16b
  usqadd v14.16b, v16.16b
  usqadd v15.16b, v16.16b
  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)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)9fa8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204400583100006025160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
160204400393100003025160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
160204400393210003025160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
160204400393110003025160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
160204400393100003025160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
1602044003931000024325160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
160204400393100003025160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
160204400393100005825160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
16020440039311000179625160108100160008100160020500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040
160204400393110003025160108100160008100160116500128013204002004003940039199776199901601202001600322003200644003940039111602011009910010016000010000011110118016004003601600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030718191e3f51inst 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)9fa8accdcfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002440050311000046251600101016000010160000501280000115400204003940039199963200191600102016000020320000400994003911160021109101016000010000100228216162117540036206160000104004040040400404004040040
16002440039311000046251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010030100228316162115740036206160000104004040040400404004040040
16002440039321000046251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010000100228416162115640036206160000104004040040400404004040040
16002440039310000046251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010000100228417162116740036206160000104004040040400404004040040
1600244003931100007425160010101600001016000050128000011540020400394003919996320019160010201600002032000040039400391116002110910101600001013010022841616211564003620725160000104004040040400404004040040
160024400393100000394251600101016000010160000501280000115400204010140039199963200191600102016000020320000400394003911160021109101016000010000100228415162125640036416160000104004040040400404004040040
16002440039311000046251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010000100228415162116640036206160000104004040040400404004040040
16002440189310000046251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010000100228415162116540036206160000104004040040400404004040040
160024400393110000462516001010160000101600005012800001154002040039400391999632001916001020160000203200004003940039111600211091010160000100001002211415162115540036206160000104004040040400404004040040
16002440039311000046251600101016000010160000501280000115400204003940039199963200191600102016000020320000400394003911160021109101016000010000100228416162117840036206160000104004040040400404004040040