Apple M1 Microarchitecture Research by Dougall Johnson

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

FSQRT (scalar, H)

Test 1: uops

Code:

  fsqrt h0, h0
  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)0318191e1f3f4e51inst 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)a1a8acc2cfd5d6ddinst fetch restart (de)e0? fp/simd (ee)f5f6f7f8fd
10048132610048061672025100010001000281563801880378037749337895100010001000803780371110011000003073116117676100080388038803880388038
10048037600000103672025100010001000281261801880378037749337895100010001000803780371110011000000073116117676100080388038813380388038
10048037600000346672049100310001000281261801880378037749337895100010001000803780371110011000000073116117676100080388038803880388038
1004803760000061672025100010001000281261801880378037749337895100010001000803780371110011000000073116117726100080388038803880388038
1004803760000061672025100010001000281261801880378037749337895100010001000803780371110011000000073116117676100080388038803880388038
1004803760000061672025100010001000281261801880378037749337895100010001000803780371110011000000073116117676100080388038803880388038
1004803760000061672025100010001000281261801880378037749337895100010001000803780371110011000020073116117676100080388038803880388038
1004803760000061672025100010001000281261801880378037749337895100010001000803780371110011000000073116117676100080388038803880388038
1004803760000061672025100310001000281261801880378037749337895100010001000803780371110011000000073116117676100080388038803880388038
10048037600008861672025100010001000281261801880378037749337895100010001000803780371110011000230073116117676100080388038803880388038

Test 2: Latency 1->2

Code:

  fsqrt h0, h0
  movi v0.16b, 1
  movi v1.16b, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 8.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)9fa0a1a6a7a8a9acc2c5cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020480037600000042013456972025101231001000010010000500286426118015880037800377834337874510100200100002001005680037800371110201100991001001000010000000000071011611796760100001008003880038800388003880038
10204800375990000300616972025101001001000010010000500286426118001880037800377834337874510100200102242001000080037800371110201100991001001000010000000000071011611796760100001008003880224800388003880038
1020480037599000054307266972025101001001000010010152500286426118001880037800377834337874510100200100002001000080037800371110201100991001001000010000000000071011611796760100001008003880038800388003880038
1020480037600000000616972025101001001000010010000500286426118001880037800377834337874510100200100002001000080037800371110201100991001001000010000000000071011611797040100001008003880038800388003880038
10204800375990000210616972025101001241000010010000500286426118001880037800377834337874510100200102182001000080037800371110201100991001001000010000000000071011611798210100001008003880038800388018080038
10204800375990004600616972025101001001000010010000500286426118001880037800377834337874510100200100002001000080037800371110201100991001001000010000004200071011611796760100001008003880038800388003880038
10204800376000000510677869720251010010010000100100005002864261180018800378003778343378745101002001000020010000800378003711102011009910010010000100000000000710116117967614100001008003880038800388003880038
102048003760000005370616972025101001001000010010000500286426118001880037800377834337874510100200100002001000080037800371110201100991001001000010000006000071011611796760100001008003880038800388003880038
102048003760000009301036972025101351001000010010000500286426118001880037800377834337874510100200100002001000080037800371110201100991001001000010000000000071011612796760100001008003880038800388003880038
102048003759900003606169720251010010010000100100005002864261180018801328003778343378745101382001000020010227800378003711102011009910010010000100010000000710116117967623100001008003880038800388003880038

1000 unrolls and 10 iterations

Result (median cycles for code): 8.0037

retire (01)cycle (02)03080b18191e1f3a3f4e51inst 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)9fa0a6a8a9acc2c5cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024800376000000420061697202510010101000010100005028642610800188003780037783653787671001020100002010000800378003711100211091010100001000000006402162279676010000108003880038800388003880038
100248003760000002700061697202510010101000010100005028642611800188003780037783653787671001020100002010000800378003711100211091010100001000000006402162279676010000108003880038800388003880038
100248003759900001500616972025100101010000101000050286426108001880037800377836537876710010201000020100008003780037111002110910101000010000002091051603480362110000108092281224809268094380925
1002480935606001919280217600115586945437310067161005411107226528699990806488018080886787058879379107372411083241101880940809812011002110910101000010201258930006402165480252610000108103380981809838102780936
1002481014610112724290420241150636972025810066131000010102285028642610800188003780037783653787671001020100002010000800378003711100211091010100001000000006402163279676110000108003880038800388003880038
1002480037648000048001219697202510010101000010100005028642610800538008480037783836787671008820100002010051800378003711100211091010100001000000006402162279676010000108003880038800388003880038
1002480277601110030003604697202510010101000310100005028642610800188003780037783653787671001020100002010000800378003711100211091010100001000000006402162279676010000108003880038800388003880038
10024800375990000120061697202510010101000010100005028642611800188003780037783653787671001020100002010000800378003711100211091010100001000000006402162279676010000108003880038800388003880038
10024800376000004270061697202510010101000010100005028642610800188003780037783653787671001020100002010000800378003711100211091010100001000000006402162279676010000108003880038800388003880038
1002480037599000000061697202510010101000310100005028642610800188003780037783653787671001020100002010000800378003711100211091010100001000000006402162279676010000108003880038800388003880038

Test 3: throughput

Count: 8

Code:

  fsqrt h0, h8
  fsqrt h1, h8
  fsqrt h2, h8
  fsqrt h3, h8
  fsqrt h4, h8
  fsqrt h5, h8
  fsqrt h6, h8
  fsqrt h7, h8
  movi v8.16b, 9

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

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)696b6d6edispatch 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)9fa1a6a8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
8020416004311980006179937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000000011151171160015998180000100160044160044160044160044160044
802041600431198006846179937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000000011151170160015998180000100160044160044160044160044160044
8020416004311990006179937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000000011151170160015998180000100160044160044160044160044160044
8020416004311990006179937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000010311151170160015998180000100160044160044160044160044160044
80204160043119950072679937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000000311151170170015998180000100160044160044160044160044160044
80204160043119800246179937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000000011151170160015998180000100160044160044160044160044160044
80204160043119800072679937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000000011151170160015998180000100160044160044160044160044160044
8020416004311990006179937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000000011151170160015998180000100160044160044160044160044160044
802041600431199000726799372580100100800001008000050056779841600240160043160043149895061499978010020080008200800081600431600431180201100991001008000010000001511151170160015998180000100160044160044160044160044160044
8020416004311993006179937258010010080000100800005005677984160024016004316004314989506149997801002008000820080008160043160043118020110099100100800001000000011151170160015998180000100160044160044160044160044160044

1000 unrolls and 10 iterations

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

retire (01)cycle (02)03081e1f3f4e51inst 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)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)9fa6a8acc5cdcfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0ea? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
8002416004311990006179937258001010800001080000505677984016007701600431600901499100315002380010208007620800001600431600431180021109101080000100000050200004160002415996908000010160044160044160044160044160044
8002416004311980007267993725800101080000108000050567798401600240160043160043149910031500238001020800002080000160043160043118002110910108000010012200050200004160004415996908000010160044160044160044160044160044
800241600431199000617993725800101080000108000050567798401600240160043160043149910031500238001020800002080000160043160043118002110910108000010015200050200004160004315996908000010160044160044160044160083160044
80024160043119900072679937258001010800001080000505677984016002431600431600431499100315002380010208000020800001600431600431180021109101080000100000050200004160004215996908000010160044160044160044160044160044
8002416004311990006179937258001010800001080000505677984016002401600431600431499100315002380010208000020800001600431600431180021109101080000100000050200002160004215996908000010160044160044160044160044160044
800241600431199124337272679937258001010800001080000505677984016002401600431600431499100315004680010208000020800001600431600431180021109101080000100000050200002161004315996908000010160044160044160044160044160044
8002416004311990006179937258001010800001080000505677984016002401600431600431499100315002380010208000020800001600431600431180021109101080000100000050200002160004215996908000010160044160044160044160044160044
8002416004311990006179937258001010800111080000505677984016002401600431600431499100315002380010208000020800001600431600431180021109101080000100000050200004160004315996908000010160044160097160044160044160044
800241600431199000617993725800101080000108000050567798401600240160043160043149910031500238001020800002080000160043160043118002110910108000010014800050200004160002415996908000010160044160044160044160044160044
8002416004311990006179937258001010800001080000505677984016002401600431600431499100315002380010208000020800001600431600431180021109101080000100000050200304160004415996908000010160044160044160044160044160044