Apple M1 Microarchitecture Research by Dougall Johnson

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

SHA256SU0

Test 1: uops

Code:

  sha256su0 v0.4s, v1.4s
  movi v0.16b, 1
  movi v1.16b, 2

(no loop instructions)

1000 unrolls and 1 iteration

Retires: 1.000

Issues: 1.000

Integer unit issues: 0.000

Load/store unit issues: 0.000

SIMD/FP unit issues: 1.000

retire (01)cycle (02)030b1e3f4e51inst 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
10042037150061937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038
10042037150061937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038
10042037150061937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038
100420371500619372510001000100068984120182037203717883189510001000200020372037111001100001873116111969100020382038203820382038
10042037150061937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038
10042037150061937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038
10042037150061937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038
10042037160082937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038
10042037150061937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038
10042037150061937251000100010006898412018203720371788318951000100020002037203711100110000073116111969100020382038203820382038

Test 2: Latency 1->1

Code:

  sha256su0 v0.4s, v1.4s
  movi v0.16b, 1
  movi v1.16b, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.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)9fa1a8accdcfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020420037150061993725101001001000010010000500707984020018200372003718638318745101002001000020020000200372003711102011009910010010000100000071011611199670100001002003820038200382003820038
1020420037150061993725101001001000010010000500707984020018200372003718638318745101002001000020020000200372003711102011009910010010000100000071011611199670100001002003820038200382003820038
102042003715043261988025101001001000010010000500707984020018200372003718638318745101002001000020020000200372003711102021009910010010000100006071011611199670100001002003820038200382003820038
1020420037150661993725101001001000010010000500707984120018200372003718638318745101002001000020020000200372003711102011009910010010000100000071011611199670100001002003820038200382003820038
1020420037150061993725101001001000010010000500707984020018200372003718638318745101002001000020020000200372003711102011009910010010000100000071011611199670100001002003820038200382003820038
1020420037150061993725101001001000010010000500707984020018200372003718638318745101002001007020020000200372003711102011009910010010000100000071011611199670100001002003820038200382003820038
1020420037150061993725101001001000010010000500707984020018200372003718638318745101002001000020020000200372003711102011009910010010000100000071011622199670100001002003820038200382003820038
1020420037150375210993725101001021000010010000500707984020018200372003718638318745101002001000020020000200372008511102011009910010010000100010071011611199670100001002003820038200382003820038
10204200371501861993725101001001000010010000500707984120018200372003718638318745101002001000020020000200372003711102011009910010010000100000071011611199670100001002003820038200382003820038
1020420037150661993725101001001000010010000500707984120018200372003718638318745101002001000020020000200372003711102011009910010010000100000071011611199670100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.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)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)9fa0a6a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024200371500006199372510010101000010100005070798420018200372003718660318767100102010000202000020037200371110021109101010000100000640216221996910000102003820038200382003820038
10024200371500006199372510010101000010100005070798420018200372003718660318767100102010000202000020037200371110021109101010000100214585640216221996910000102003820038200382003820038
1002420037150027072699372510010101000010100005070798420018200372003718660318767100102010000202000020037200371110021109101010000100000640216221996910000102003820038200382003820038
1002420037150036061993725100101010000101000050707984200182003720037186601118767100102010000202000020037200371110021109101010000100000640216221996910000102003820038200382003820038
1002420037150042906199372510010101000010100005070798420018200372003718660318767100102010000202000020037200371110021109101010000100013640216221996910000102003820038200382003820084
100242003715002408299372510010101000010100005070798420018200842003718660718767100102010000202000020037200371110021109101010000102001003640216221996910000102003820038200382003820038
100242003715002106199372510010101000010100005070798420018200372003718660318767100102010000202000020037200371110021109101010000100000640216221996910000102003820038200382003820038
100242003715003906199372510010101000010100005070798420018200372003718660318767100102010000202000020037200371110021109101010000100010640216221996910000102003820038200382003820038
10024200371500606199372510010101000010100005070798420018200372003718660318767100102010000202000020037200371110021109101010000100000640216221996910000102003820038200382003820038
10024200371500306199372510010101000010100005070798420018200372003718660318767100102010058202000020037200372110021109101010000100009656216221996910000102003820038200382003820038

Test 3: Latency 1->2

Code:

  sha256su0 v0.4s, v0.4s
  movi v0.16b, 1

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 2.0037

retire (01)cycle (02)031e3a3f4e51inst 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)9facc2c5branch mispredict (cb)cdcfd6e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020420037150006199362510100100100001001000050070792120018200372003718644618741101002001000820020016200372003711102011009910010010000100001117171619979100001002003820038200382003820038
1020420037150006199362510100100100001001000050070792120018200372003718644618741101002001000820020016200372003711102011009910010010000100001117171619978100001002003820038200382003820038
1020420037150006199362510100100100001001000050070792120018200372003718644718740101002001000820020016200372003711102011009910010010000100001117181619978100001002003820038200382003820038
1020420037150006199362510100100100001001000050070792120018200372003718644718741101002001000820020016200372003711102011009910010010000100021117171619978100001002003820038200382003820038
1020420037150006199362510100100100001001000050070792120018200372003718644618741101002001000820020016200372003711102011009910010010000100001117181619979100001002003820038200382003820038
1020420037150006199362510100100100001001000050070792120018200372003718644618740101002001000820020016200372003711102011009910010010000100001117181619979100001002003820038200382003820038
10204200371501506199362510100100100001001000050070792120018200372003718644618740101002001000820020016200372003711102011009910010010000100001117181619978100001002003820038200382003820038
1020420037150006199362510100100100001001000050070792120018200372003718644618740101002001000820020016200372003711102011009910010010000100001117171619978100001002003820038200382003820038
1020420037150006199362510100100100001001000050070792120018200372003718644718740101002001000820020016200372003711102011009910010010000100001117171619979100001002003820038200382003820038
1020420037150006199362510100100100001001000050070792120018200372003718644718741101002001000820020016200372003711102011009910010010000100001117181619979100001002003820038200382003820038

1000 unrolls and 10 iterations

Result (median cycles for code): 2.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)9fa1a8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024200371500103993625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110021109101010000100000640316221996810000102003820038200382003820038
1002420037150061993625100101010000101000050707921120018200372003718659318767100102010000202000020037200371110021109101010000100000640216221996810000102003820038200382003820038
1002420037150061993625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110021109101010000100000640216221996810000102003820038200382003820038
1002420037150061993625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110021109101010000100000640216221996810000102003820038200382003820038
1002420037150061993625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110021109101010000100000640216221996810000102003820038200382003820038
1002420037150061991625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110022109101010000100000640216221996810000102003820038200382003820038
1002420037150061993625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110021109101010000100000640216221996810000102003820038200382003820038
1002420037150061993625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110021109101010000100000640216221996810000102003820038200382003820038
1002420037150061993625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110021109101010000100000640216221996810000102003820038200382003820038
1002420037150061993625100101010000101000050707921020018200372003718659318767100102010000202000020037200371110021109101010000100000640216221996810000102003820038200382003820038

Test 4: throughput

Count: 8

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)03070b18191e1f3a3f51inst 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)9fa1a8acc2c5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160204800406000000000382580100100800001008000050064000008001980038800385997065999180100200800082001600168003880038111602011009910010016000010000001111011721600800351600001008003980039800398003980039
160204800386000000000382580100100800001008000050064000008001980038800385997065999180100200800082001600168003880038111602011009910010016000010000001111011701600800351600001008003980039800398003980039
160204800385990000000382580146100800001028000050064019518005680038800385997065999180100200800082001600168003880038111602011009910010016000010040001111011701600800351600001008003980039800398003980039
1602048003859900000003825801001008000010080000500640000080019800388003859970355999180100200800082001600168003880038111602011009910010016000010002161101111013412400800351600001008003980039800398003980039
1602048003859900001200382580100100800001008000050064000008001980038800385997065999180100200800082001600168003880038111602011009910010016000010000301111011701600800351600001008003980039802338003980039
160204800385990000000382580100100800001008000050064000008001980038800385997065999180100200800082001600168003880038111602011009910010016000010000001111011701600800351600001008003980039800398003980039
160204800386000000000382580100100800231008000050064000008001980038800385997065999180100200800082001600168003880038111602011009910010016000010000001111011701600800951600001008003980039800398003980039
160204800385990000000382580100100800001008000050064000018001980038800385997065999180100200800082001600168003880038111602011009910010016000010000001111016713201800351600001008003980039800398003980039
160204800386000000000382580100100800001008000050064000008001980038800385997065999180100200800082001600168003880038111602011009910010016000010000001111011701600800351600001008003980039800398003980039
1602048003860000000007032580100100800001008000050064000018001980038800385997066004180100200800082001600168003880038111602011009910010016000010000001111011701600800351600001008003980039800398003980039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)031e3f51inst issue (52)~issue int (53)~issue fp/simd (54)~dispatch int (56)~dispatch fp/simd (57)huge thing int (59)huge thing fp/simd (5b)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)9fa1a8accfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1600248003859975552580010108000010800005064000011108001980038800385998636001880010208000020160000800388003811160021109101016000010000100221321111621169800352013160000108003980039800398003980039
16002480038599055258001010800001080000506400001110800198003880038599863600188001020800002016000080038800381116002110910101600001000310022135151621159800352013160000108003980039800398003980039
16002480038600055258001010800001080000506400001010800198003880038599863600188001020800002016000080038800381116002110910101600001010010022135191621159800352013160000108003980039800398003980039
16002480038599246125800101080000108000050640000110800198003880038599863600188001020800002016000080038800381116002110910101600001000010024165261642259800354026160000108003980039800398003980039
160025800385990612580010108000010800005064000001108001980038800385998636001880010208000020160000800388003811160021109101016000010006100221642101622299800354026160000108003980039800398003980039
160024800385990612580010108000010800005064000000108001980038800385998636001880010208000020160000800388003811160021109101016000010000100241652516412711800354026160000108003980039800398003980039
1600248003859906125800101080000108000050640000011080019800388003859986360018800102080000201600008003880038111600211091010160000100031002262192441159800352013160000108003980039800398003980039
1600248003860006125800101080000108000050640000101080019800388003859986360018800102080000201600008003880038111600211091010160000100001002216619164121010800352026160000108003980039800398003980039
16002480038599061258001010800001080000506400000110800198003880038599863600188001020800002016000080038800381116002110910101600001000610024167261642299800354026160000108003980039800398003980039
16002480038599034625800101080000108000050640000011080019800388003859986360018800102080000201600008003880038111600211091010160000100983100241652916422106800354026160000108003980039800398003980039

Test 5: throughput

Count: 16

Code:

  sha256su0 v0.4s, v16.4s
  sha256su0 v1.4s, v16.4s
  sha256su0 v2.4s, v16.4s
  sha256su0 v3.4s, v16.4s
  sha256su0 v4.4s, v16.4s
  sha256su0 v5.4s, v16.4s
  sha256su0 v6.4s, v16.4s
  sha256su0 v7.4s, v16.4s
  sha256su0 v8.4s, v16.4s
  sha256su0 v9.4s, v16.4s
  sha256su0 v10.4s, v16.4s
  sha256su0 v11.4s, v16.4s
  sha256su0 v12.4s, v16.4s
  sha256su0 v13.4s, v16.4s
  sha256su0 v14.4s, v16.4s
  sha256su0 v15.4s, v16.4s
  movi v16.16b, 17

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)03080b18191e1f3f51inst 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)cdcfd2d5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602041600391199000000382516010010016000010016000050012800000160019160038160038139971613999216010020016000820032001616003816003811160201100991001001600001000000011110117001600160035160000100160039160039160039160039160039
16020416003811980000003825160100100160000100160000500128000011600191600381600381399716139992160100200160008200320016160038160038111602011009910010016000010000081011110117001600160035160000100160039160039160039160039160039
1602041600381199000000382516010010016000010016000050012800000160019160038160038139971613999216010020016000820032001616003816003811160201100991001001600001000025011110117001600160035160000100160039160039160039160039160039
1602041600381199000600102412516012310016002310016007750012801950160056160038160038139971614009016010020016000820032001616003816003811160201100991001001600001000003011110117001600160035160000100160039160039160039160039160039
160204160038119900006003825160100100160000100160000500128000001600191600381600381399716139992160100200160008200320016160038160038111602011009910010016000010000001511110117001600160035160000100160039160039160039160039160039
1602041600381198000000382516010010016000010016000050012800000160019160038160038139971613999216010020016000820032001616003816003811160201100991001001600001000000011110117001600160035160000100160039160039160039160039160039
1602041600381198000000382516010010016000010016000050012800000160019160038160038139971613999216010020016000820032001616003816003811160201100991001001600001000000011110117001600160035160000100160039160039160039160039160039
1602041600381199000000382516010010016000010016000050012800000160019160038160086139971613999216010020016000820032001616003816003811160201100991001001600001000001011110117001600160035160000100160039160039160039160039160039
16020416003811980000008982516010010016000010016000050012800000160019160038160038139971613999216010020016000820032001616003816003811160201100991001001600001000000011110117001600160035160000100160039160039160039160039160039
1602041600381199000000382516010010016000010016000050012800000160019160038160038139971613999216010020016000820032001616003816003811160201100991001001600001000000011110117001600160035160000100160039160039160039160039160039

1000 unrolls and 10 iterations

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

retire (01)cycle (02)030818191e1f3f51inst 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)5f6061696b6d6edispatch 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)9fa0a1a6a8a9acc5branch mispredict (cb)cdcfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16002416003911980109541766125160079101600001016000050128000001016001901600381600381399860314001816018522160000203200801600381600381116002110910101600001002000000010053112121642123160071302616000010160039160039160039160039160039
160024160038119900060612516001010160000101600005012800001101600190160038160038139986031400561600102016000020320088160038160038111600211091010160000100000000001002464141642123160033301416000010160039160039160039160039160039
160024160038119900000612516001010160000101600005012800001151600190160038160038139986031400181600102016000020320000160038160038111600211091010160000100000000001002234131621133160033151316000010160039160039160039160039160039
160024160038119800000552516001010160000101600005012800001151600190160038160038139986031400181600102016000020320000160038160038111600211091010160000100000000001002235131641132160033151316000010160039160039160039160039160039
1600241600381199000004352516001010160000101600005012800001151600190160038160038139986031400181600102016000020320000160038160038111600211091010160000100000000001002235131641233160033152616000010160039160039160039160039160039
160024160038119900000552516001010160000101600005012800001151600190160038160038139986031400181600102016000020320000160038160038111600211091010160000100000000001002284141621143160033151316000010160039160039160039160039160039
1600241600381199000007202516001010160000101600005012800001101600190160038160038139986031400181600102016000020320000160038160038111600211091010160000100000000001002284131621132160033151316000010160039160039160039160039160039
160024160038119900000552516001010160000101600005012800001151600190160038160038139986031400181600102016000020320000160038160038111600211091010160000100000000001002284131621132160033151316000010160039160039160039160039160039
1600241600381199000007202516001010160000101600005012800001151600190160038160038139986031400181600102016000020320000160038160038111600211091010160000100000000001002284131621124160033151316000010160039160039160039160039160039
160024160038119900000556216010210160000101600005012800001151600190160038160038139986031400181600102016000020320000160038160038111600211091010160000100000000001002284131621132160033151316000010160039160039160039160039160039