Apple M1 Microarchitecture Research by Dougall Johnson

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

SADALP (vector, 8H)

Test 1: uops

Code:

  sadalp v0.8h, 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)03191e1f3f4e51inst 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)a0a1a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
100430372200061254825100010001000398313301830373037241532895100010002000303730371110011000000073116112630100030383038303830383038
1004303723008861254825100010001000398313301830373037241532895100010002000303730371110011000000073116112630100030383038303830383038
100430372200061254825100010001000398313301830373037241532895100010002000303730371110011000000073116112630100030383038303830383038
1004303722000103254825100010001000398313301830373037241532895100010002000303730371110011000000073116112630100030383038303830383038
100430372300061254825100010001000398313301830373037241532895100010002000303730371110011000000073116112630100030383038303830383038
100430372200061254825100010001000398313301830373037241532895100010002000303730371110011000000073116112630100030383038303830383038
100430372300061254825100010001000398313301830373037241532895100010002000303730371110011000001073116112630100030383038303830383038
100430372300061254825100010001000398313301830373037241532895100010002000303730371110011000000073116112630100030383038303830383038
100430372209061254825100010001000398313301830373037241532895100010002000303730371110011000000373116112630100030383038303830383038
1004303723012061254825100010001000398313301830373037241532895100010002000303730371110011000001373116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  sadalp v0.8h, 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)03090b181e3a3f4e51inst 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)696d6edispatch 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)9fa0a8a9accfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102043003722400000612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071411723296340100001003003830038300383003830038
102043003722500000612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722500000612954825101001001000010010000500427731330018300373003728265328744101252001000020020000300373003711102011009910010010000100000071011643296340100001003003830038300383003830038
102043003722500000612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071411611296340100001003003830038300383003830038
102043003722500000612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000000710116112963425100001003003830038300383003830038
102043003722400000612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
1020430037225000006129548251010010010000100100005004277313300183003730037282653287441012520010000200200003003730037111020110099100100100001000003714317332963425100001003003830038300383003830038
10204300372250010010329548251010010010000100100005004277313300183003730037282653287451010020010000204200003003730037111020110099100100100001004421271011612296340100001003003830038300383003830038
1020430037225000001032954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000371011711296340100001003003830038300383003830038

1000 unrolls and 10 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)9fa0a6a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037225000000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000104000006402162229668010000103003830038300383008530038
1002430037225000677955281448929485159100631310056151089477428545503027030323303672829431288861090620109802421980303683035571100211091010100001000121952027904563329897210000103036630366304193022830321
100243040922700177927616033102947617910070151004011110437642869240302703040130366283121728900110562011151212230830358303718110021109101010000100010533827954972229882310000103036730368304143040530370
1002430360228110789336161456429548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229701010000103003830038300383003830038
1002430037225000000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
1002430037225000009006129548251001010100071010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
1002430037225000000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
1002430037225000000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
1002430037224000000006129548251001010100001010000504277313030018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038
1002430037225000000006129548251001010100001010000504277313130018300373003728287328767100102010000202000030037300371110021109101010000100000006402162229630010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  sadalp v0.8h, 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)030b18191e1f3a3f4e51inst 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)9fa0a1a6a8acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
102043003722500000061295472510100100100001001000050042771601300183003730037282716287411010020010000200200003003730037111020110099100100100001000007611171801600296450100001003003830038300383003830038
102043003722500000161295472510100100100001001000050042798641300183003730037282717287411010020010008200200163003730037111020110099100100100001000000011171801600296460100001003003830038302293003830038
102043003722500000061295472510100100100001001000050042771601300183003730037282716287401010020010008200200163003730037111020110099100100100001000000011171701600296450100001003003830038300383003830038
1020430037225000000231295472510100100100001001000050042771601300183003730037282717287411010020010008200200163003730037111020110099100100100001000000311171701600296460100001003008630038300383003830038
102043003722500000061295472510100100100001001000050042771601300183003730037282716287411010020010008200200163003730037111020110099100100100001004000011171703700296450100001003003830038300383003830038
10204300852250000005104295472510100100100001001000050042771601300183003730037282716287401010020010008200200163003730037111020110099100100100001000000011171701600296450100001003003830038300383003830038
102043003722500000061295472510100100100001001000050042771601300183003730037282716287411010020010008200200163003730037111020110099100100100001000000011171701600296450100001003003830038300383003830038
102043003722500000061295472510100100100001001000050042771601300183003730037282717287401010020010008200200163003730037111020110099100100100001000000011171801600296460100001003003830038300383003830038
102043003722700000061295472510100100100081001000050042771601300183003730037282717287401010020010008200200163003730037111020110099100100100001000000011171701600296460100001003003830038300383003830038
102043003722400000061295472510100100100001001000050042771601300183003730037282716287411010020010008200203583008530037111020110099100100100001000000011271701600296450100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0308090b18191e1f3f4e51inst 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)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)9fa0a6a8a9acbranch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243031922711177555616448929484152100661110056121060061428662413027030408301792831303428898110602010978262194630321303222110021109101010000102014194700640216222962910000103003830038300383003830038
100243003722400000006129547251001010100001010000504277160030018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038
1002430037225000000072629547251001010100001010000504277160030018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160030018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160030018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038
1002430037225000001206129547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160030018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160130018300373003728286032876710010201000020200003003730037111002110910101000010000000640216222962910000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  sadalp v0.8h, v8.16b
  movi v1.16b, 0
  sadalp v1.8h, v8.16b
  movi v2.16b, 0
  sadalp v2.8h, v8.16b
  movi v3.16b, 0
  sadalp v3.8h, v8.16b
  movi v4.16b, 0
  sadalp v4.8h, v8.16b
  movi v5.16b, 0
  sadalp v5.8h, v8.16b
  movi v6.16b, 0
  sadalp v6.8h, v8.16b
  movi v7.16b, 0
  sadalp v7.8h, 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)03181e3f51inst 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)9fa8acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602042009015000292580116100800161008002850064019602004520065200656128012820080028200160056200652006511160201100991001001600001000391111011901600200621600001002006620066200662006620066
160204200651500029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100861111011901600200621600001002006620066200662006620066
16020420065150002925801161008001610080028500640196020045200652006561280128200800282001600562006520065111602011009910010016000010004931111011907100200621600001002006620066200662006620066
160204200651510029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100001111011901600200621600001002006620066200662006620066
160204200651500029258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100001111011901600200621600001002006620066200662006620066
1602042006515102743625801161008001610080028500640196120045200652006561280128200800282001600562006520065111602011009910010016000010001591111011901600200621600001002006620066200662006620066
160204200651510029258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100091111011901600200621600001002006620066200662006620066
16020420065151004796258011610080016100800285006401961200452006520065612801282008002820016005620065200651116020110099100100160000100031111011901600200621600001002006620066200662006620066
1602042006515100694258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100001111011901600200621600001002006620066200662006620066
160204200651501929258011610080016100800285006401960200452006520065612801282008002820016005620065200651116020110099100100160000100091111011901600200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030407090a1e3a3f51inst 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)9faccfd0d2icache miss (d3)itlb miss (d4)d5d6d9dadbddinst fetch restart (de)e0ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002420054150111101592580010108000010800005064000001200332005220052322800102080000201600002005220048111600211091010160000109100426211382632128292004916160000102004920053200532005320053
160024200521501112011082580010108000010800005064000001200332005220052322800102080000201600002004820052111600211091010160000100100576221282632129302004931160000102005320049200532004920049
160024200481501010243177325800101080000108000050640000012002920048200483228001020800002016000020048200521116002110910101600001075100536222292832223302005131160000102005520055200552004920055
160024200481501212921082580010108000010800005064000001200352005420054322800102080000201600002005420054111600211091010160000100100566211292612231282004916160000102005320053200492005320053
160024200521501111019625800101080000108000050640000012002920048200523228001020800002016000020052200481116002110910101600001045100506221262212121252004531160000102004920049200532004920053
160024200481501211001082580010108000010800005064000001200332005220052322800102080000201600002005220052111600211091010160000100100536221262632121252004916160000102005320053200532004920049
160024200481501010011082580010108000010800005064000001200332005220052322800102080000201600002005220052111600211091010160000109100486111232611215252004931160000102005320053200532005320053
1600242004815011111511082580010108000010800005064000001200332005220052322800102080000201600002004820048111600211091010160000106100513111262211115252004516160000102004920049200532004920049
160024200481501111001322580010108000010800005064000011200292004820048322800102080000201600002004820048111600211091010160000100100513111242211118282004516160000102004920049200492005320049
160024200481501110011022580010108000010800005064000011200292004820048322800102080000201600002004820048111600211091010160000100100453111212211126162004516160000102004920049200492004920049

Test 5: throughput

Count: 16

Code:

  sadalp v0.8h, v16.16b
  sadalp v1.8h, v16.16b
  sadalp v2.8h, v16.16b
  sadalp v3.8h, v16.16b
  sadalp v4.8h, v16.16b
  sadalp v5.8h, v16.16b
  sadalp v6.8h, v16.16b
  sadalp v7.8h, v16.16b
  sadalp v8.8h, v16.16b
  sadalp v9.8h, v16.16b
  sadalp v10.8h, v16.16b
  sadalp v11.8h, v16.16b
  sadalp v12.8h, v16.16b
  sadalp v13.8h, v16.16b
  sadalp v14.8h, v16.16b
  sadalp v15.8h, 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)03080b18191e1f373f51inst 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)696d6edispatch 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)cdcfd5d6dbddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204400593000000901770525160108100160009100160020500128013240030400394004019977619990160120200160032200320064400394003911160201100991001001600001000000000111101181160004003601600001004005040040400504004040041
160205400392990000000312516010910016001710016002050013201294002040048400391997761999016012020016003220032006440049400391116020110099100100160000100000001560111101180160004003601600001004004140049400404005040050
160204400393000000000392516010810016001710016002050024390834002040039400491997761999016012020016003220032006440049400391116020110099100100160000100000001410111101180160004004601600001004004940040400404004140050
1602044004830000000003125160118100160008100160020500128013240030400484004819977619991160120200160032200320064400394004811160201100991001001600001000000060111101180161004003601600001004004140041400494004940040
160204400493000000001315251601091001600081001600205002237497400304003940040199776199901601202001600322003200644003940040111602011009910010016000010000000240111101180160004004601600001004004040041400414004140040
160204400482990000001392516010810016001710016002050012801324002140040400401997761999016012020016003220032006440049400391116020110099100100160000100000001350111101180160004004501600001004004040040400414005040040
160204400482990000000402516010810016001710016002050013201294002040049400391997761999116012020016003220032006440048400481116020110099100100160000100000001650111101180160004003701600001004004140041400504004940040
160204400402990000000302516010810016001710016002050023991594002940048400481997762000016012020016003220032006440048400391116020110099100100160000100000001470111101180160004004601600001004004140040400414004940040
160204400392990000000402516011810016001710016002050012801324003040039400491997761999116012020016003220032006440040400491116020110099100100160000100000001110111101180160004003601600001004004040041400414004040040
1602044004030000000013125160117100160008100160020500239915940021400484004819977619991160120200160032200320064400494003911160201100991001001600001000000030111101180160004003601600001004004140050400404004140040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)031e1f373f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)5f6061696d6edispatch stall (70)72scheduler rewind (75)scheduler stall (76)~dispatch op (78)~map op int (7c)~map op fp/simd (7e)~map lookup int (7f)~map lookup fp/simd (81)8283pipeline redirect (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst b.cc (94)inst integer (97)inst neon or fp (9a)9fa8branch mispredict (cb)cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024400583000004643160010101600001016000050128000011104002940048400391999603200191600102016010720320000400484003911160021109101016000010001002313212316211222240036155160000104004940040400494004040049
16002440039300001462516002710160017101600005012800000110400204003940048199960320019160010201600002032000040039400391116002110910101600001000100231351211621182140036155160000104004040040400404004940040
160024400393000004625160010101600001016000050128000001104002040039400481999603200281600102016000020320000400484003911160021109101016000010001002313512116211222240036155160000104004040049400404004040049
16002440039300144880462516001010160000101600005012800001110400204003940039199960320019160010201600002032000040039400481116002110910101600001000100231351211621192140045155160000104004040040400404004940040
16002440039300001746251600101016000010160000502398999111040020400394004819996032002816001020160000203200004003940048111600211091010160000100010023135191621121740045155160000104004140049400404004040040
1600244004830000175525160010101600001016000050128000011104002040039400391999603200191600102016000020320000400484003911160021109101016000010001002313512116211212240036155160000104004040040400494004040040
16002440039300001746251600271016000010160000501280000111040020400484003919996032001916001020160000203200004004840039111600211091010160000100010023134191621120940048155160000104004040040400404004040040
16002440039300000462516002710160000101600005023989991110400294003940039199960320028160010201600002032000040052400391116002110910101600001000100221341616211211040036155160000104004040040400404004040049
16002440039299000462516001010160000101600005012800001110400204004840039199960320029160010201600002032000040039400391116002110910101600001000100231341916211202140036155160000104004940049400404004040040
1600244005230090174625160010101600001016000050128000011104002040039400391999603200191600102016000020320000400394003911160021109101016000010001002313412016211202240036155160000104004940041400404004040040