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, 2D)

Test 1: uops

Code:

  usqadd v0.2d, v1.2d
  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)696d6edispatch 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)a8accfd2d5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
100430372406125482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038
100430372406125482510001000100039831330183037303724153289510001000200030373037111001100010730116112630100030383038303830383038
100430372406125482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038
100430372406125482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038
100430372406125482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038
100430372406125482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038
100430372306125482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038
100430372306125482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038
100430372306125482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038
1004303724014425482510001000100039831330183037303724153289510001000200030373037111001100000730116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  usqadd v0.2d, v1.2d
  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)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)9fa0a1a6a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102043003723200002106129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300853003741102011009910010010000100000000071011611296340100001003003830038300383003830038
10204300372320000006129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038
10204300372330000006129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038
102043003723300005406129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038
10204300372330000906129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038
1020430037233000003526129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038
102043003723300006022329548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038
10204300372320000006129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038
10204300372330000606129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038
1020430037233000044706129548251010010010000100100005004277313030018300373003728265328745102632001000020020000300373003711102011009910010010000100000000071011611296340100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)031e1f3a3f4e51inst 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)9fa6a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037233522008229548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010003640216222963010000103003830038300383003830038
1002430037233516006129548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037233498006129548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037232510006129548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
100243003723300010329548651001010100001310298504277313030018030037300372828732876710010201000020200003003730037111002110910101000010003640216222963010000103003830038300383003830038
1002430037233420006129548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372330006129548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037232540006129548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037233345006129548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372325250010429548251001010100001010000504277313030018030037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  usqadd v0.2d, v0.2d
  movi v0.16b, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0318191e3f4e51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)60696d6edispatch stall (70)scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8acc5branch mispredict (cb)cdcfd6e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102043003723300061295472510100100100001001000050042771600300183003730037282717287411010020010008200200163003730037111020110099100100100001000011171716296460100001003003830038300383003830038
102043003723300061295472510100100100001001000050042771600300183003730037282716287411010020010008200200163003730037111020110099100100100001000011171716296450100001003003830038300383003830038
102043003723300061295472510100100100001001000050042771600300183008430084282717287401010020010008200200163003730037111020110099100100100001000011171816296460100001003003830038300383003830038
102043003723200061295472510100100100001001000050042771600300183003730037282717287411010020010008200200163003730037111020110099100100100001000011171716296460100001003003830038300383003830038
102043003723300061295472510100100100001001000050042771600300183003730037282716287411010020010008200200163003730037111020110099100100100001000011171816296450100001003003830038300383003830038
1020430037233000103295472510100100100001001000050042771600300183003730037282717287411010020010008200200163003730037111020110099100100100001000011171716296450100001003003830038300383003830038
1020430037233000103295472510100100100001001000050042771600300183003730037282716287411010020010008200200163003730037111020110099100100100001000011171816296460100001003003830038300383003830038
102043003723300061295472510100100100001001000050042771600300183003730037282866287411010020010008200200163003730037111020110099100100100001000011171816296450100001003003830038300383003830038
102043003723300061295472510100100100001001000050042771600300183003730037282716287411010020010008200200163003730037111020110099100100100001000011171716296450100001003003830038300383003830038
102043003723300061295472510100100100001001000050042771600300183003730037282717287411010020010008200200163003730037111020110099100100100001000011171716296460100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0307090a0b18191e3a3f4e51inst 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)9fa8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372410000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
10024300372330000020061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
10024300372330000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
10024300372330000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
10024300372250000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
10024300372250000000064295472510010101000010100005042771600300183003730037283093287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
10024300372250000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
100243003722500000000754295292510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
100243003722500000012061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038
10024300372250000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000640216222962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  usqadd v0.2d, v8.2d
  movi v1.16b, 0
  usqadd v1.2d, v8.2d
  movi v2.16b, 0
  usqadd v2.2d, v8.2d
  movi v3.16b, 0
  usqadd v3.2d, v8.2d
  movi v4.16b, 0
  usqadd v4.2d, v8.2d
  movi v5.16b, 0
  usqadd v5.2d, v8.2d
  movi v6.16b, 0
  usqadd v6.2d, v8.2d
  movi v7.16b, 0
  usqadd v7.2d, v8.2d
  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)0318191e1f3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)5f60696d6escheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa1a6a8a9acc5branch mispredict (cb)cdcficache miss (d3)d5d6ddinst fetch restart (de)e0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204200901560000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011900160020062001600001002006620066200662006620066
160204200651550000292580116100800161008002850064019600200452006520065612801282008002820016005620065200651116020110099100100160000100001001111011900160020062001600001002006620066200662006620066
160204200651550000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100001001111011900160020062001600001002006620066200662006620066
160204200651550000292580116100800161008002850064019600200452006520065612801282008002820016005620065200651116020110099100100160000100003001111011900160020062021600001002006620148200662006620066
16020420065155000013642580116100800161028002850064019600200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011900160020062001600001002006620066200662006620066
160204200651560000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011900160020062001600001002006620066200662006620066
160204200651550000292580116100800161008002850064019600200452006520065612801282008002820016005620065200651116020110099100100160000100001001111011900160020062001600001002006620066200662006620066
160204200651550000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011900160020062001600001002006620066200662006620066
160204200651550000292580116100800161008002850064019600200452006520065612801282008002820016005620065200651116020110099100100160000100000001111011900160020062001600001002006620066200662038820066
160204200651550000292580116100800161008002850064019601200452006520065612801282008002820016005620065200651116020110099100100160000100001001111011900160020062001600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030708090a0b18191e1f3a3f51inst 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)9fa8a9acc5cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)dfe0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024200731560000000000235278001010800001080000506400001152003320051200513228001020800002016000020051200511116002110910101600001000001003583192521168320048201160000102005220052200522005220052
16002420051155000000000051278001010800001080000506400002152003220051200513228001020800002016000020060200511116002110910101600001000001003984172521164320048201160000102005220052200522005220052
160024200511560000000000452780010108000010800005064000021520032200512005132280010208000020160000200512005111160021109101016000010101501003731162521146320048201160000102005420052200522005220052
16002420051155100000000045298001010800001080000506400002052003220051200513228001020800002016000020051200511116002110910101600001000001003984182521188320048201160000102005220052200522005220052
160024200511550000000000111278001010800001080000506400001102003220051200513228001020800002016000020052200511116002110910101600001000001003934282521185320048201160000102005220052200522005220052
160024200511560000000000452780010108000010800005064000011520032200512005132280010208000020160000200512005111160021109101016000010000010037114182521189320048201160000102005220052200522005220052
16002420051156100000000045278001010800001080000506400001052004120051200513228001020800002016000020051200511116002110910101600001000001003931162521159320048201160000102005220052200522005220052
16002420051156000000000045278001010800001080000506400001152004120051200513228001020800002016000020051200511116002110910101600001000001003535162521288320048201160000102006120052200522005220052
16002420051155100000000045278001010800001080000506400001102003220051200513228001020800002016000020051200511116002110910101600001000001004131162521146320048201160000102005620052200522005220052
16002420051155000000000045278001010800001080000506400002152003220051200513228001020800002016000020060200601116002110910101600001000001003982243441288320057202160000102006120061200612006120052

Test 5: throughput

Count: 16

Code:

  usqadd v0.2d, v16.2d
  usqadd v1.2d, v16.2d
  usqadd v2.2d, v16.2d
  usqadd v3.2d, v16.2d
  usqadd v4.2d, v16.2d
  usqadd v5.2d, v16.2d
  usqadd v6.2d, v16.2d
  usqadd v7.2d, v16.2d
  usqadd v8.2d, v16.2d
  usqadd v9.2d, v16.2d
  usqadd v10.2d, v16.2d
  usqadd v11.2d, v16.2d
  usqadd v12.2d, v16.2d
  usqadd v13.2d, v16.2d
  usqadd v14.2d, v16.2d
  usqadd v15.2d, v16.2d
  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)03070818191e1f3f51inst 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)9fa0a1a6a8acc2c5branch mispredict (cb)cdcfd2d5d6d9dbddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020440059310000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118041600134003601600001004004040040400404004040040
16020440039310000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118031600334003601600001004004040092401584004040040
16020440039310000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118041600334003601600001004004040040400404004040040
16020440039311000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118041600544003601600001004004040040400404004040040
16020440039310000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118031600434003601600001004004040040400404004040040
160204400393100000001252516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118021600234003601600001004004040040400404004040040
16020440039311000090302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118031600444003601600001004004040040400404004040040
16020440039311000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118041600514003601600001004004040040400404004040040
16020440039310000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118041600224003601600001004004040040400404004040040
16020440039311000000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000000011110118021600314003601600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0308191e1f3f51inst 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)5f60696b6d6edispatch 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)9fa8accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1600244005130000004625160010101600001016000050128000001400200400394003919996032001916001020160000203200004003940039111600211091010160000100010027311111621147400363010160000104004040040400404004040040
16002440039299000046251600101016000010160000501280000114002004003940039199960320019160010201600002032000040039400391116002110910101600001000100223114164117440036155160000104004040040400404004040040
160024400393000000522516001010160000101600005012800000140020040039400391999603200191600102016000020320000400394003911160021109101016000010001002231161621177400363010160000104004040040400404004040040
160024400393000000462516001010160000101600005012800001140020340039400391999603200191600102016000020320000400394003911160021109101016000010201002261171621176400363010160000104004040040400404004040040
160024400393000068412322295251600101016000010160000501280000114002004003940039199960320019160010201600002032000040039400391116002110910101600001000100223217162114740036305160000104004040040400404004040040
160024400393000000947251600101016000010160000501280000114002004003940039199960320019160010201600002032000040039400391116002110910101600001000100223117162114840154155160000104004040040400404004040040
160024400393000000462516001010160000101600005012800001140020040039400391999603200191600102016000020320000400394003911160021109101016000010001002561141621158400363010160000104004040040400404004040040
160024400393000000293251600101016000010160000501280000114002004003940039199960820019160010201600002032000040039400391116002110910101600001000100223214162114740036155160000104004040040400404004040040
16002440039299000046251600101016000010160000501280000114002004003940039199960320019160010201600002032000040039400391116002110910101600001000100223116162116740036155160000104004040040400404004040040
16002440039300000088251600101016000010160000501280000114002004003940039199960320019160010201600002032000040039400391116002110910101600001000100223117162114740036155160000104004040040400404004040040