Apple M1 Microarchitecture Research by Dougall Johnson

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

SQDMULH (by element, 4H)

Test 1: uops

Code:

  sqdmulh v0.4h, v0.4h, v1.h[1]
  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
1004303722126125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372206125392510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372206125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372206125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372206125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372206125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110001073116112630100030383038303830383038

Test 2: Latency 1->2

Code:

  sqdmulh v0.4h, v0.4h, v1.h[1]
  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)033f4e51inst 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
10204300372256129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372256129548251010010010000100100005004277313130018300373003728265328745101002001000020220000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372256129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372246129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372256129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372256129548251010010010000100100005004277313030018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372256129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372256129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372256129548251010010010000100100005004277313130018300373003728265328745101002001000020020000300373003711102011009910010010000100007101161129634100001003003830038300383003830038
10204300372256129548251010010010000100100005004277313130018300373003728265328745101002001000020420000300373003711102011009910010010000100007101161129634100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)03080918191e1f3f4e51inst 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)9fa0a6a7a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037224000000726295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
100243003722500000061295482510010101000010100005042773131301263003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
100243003722500000061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038
100243003722500009061295482510010101000010100005042773131300183003730037282873287671001020100002020000300373003711100211091010100001000000007943322229774110000103041730413304563041730180
1002430415228009810687045159294761971007915100641511192814288169130306304563041928317382891711172201131424226343046030461311002110910101000010230122214306402162229630010000103017830038300383007930038
1002430037225018893661640212947617710088161004013111927642881691303063041630402283013928915113562211317222228430417301791211002110910101000010522002373308163483329882210000103046630491304643041730416
10024304632280191000612954825100611010024101000050427731313041430416303242831714288791120620112222222290305143046510110021109101010000100010225658283741112229982310000103046430468305113056030464
1002430225229119413238805249295482510010101000010100005042773131300183003730037282873028767100102410979202000030037300371110021109101010000100000016640288431132229630010000103007430322301803003830321
1002430414236005103995283342954864100541210016141137471429088313023430179304162832316289171102420108302222626303203037171100211091010100001024012006682162229630010000103003830038300383003830038
100243003722500000061295482510010101000010100005042773130300183003730037282873287671001020100002020000300373003711100211091010100001000000006402162229630010000103003830038300383003830038

Test 3: Latency 1->3

Code:

  sqdmulh v0.4h, v1.4h, v0.h[1]
  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)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)9fa6a8acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
10204300372253612954825101001001000010010000500427867030054300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
102043003722506129548251010010010000100100005004277313300183003730037282653287451010020010000200200003003730037111020110099100100100001000054071011611296340100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100060071011611296340100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
10204300372250612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038
10204300372240612954825101001001000010010000500427731330018300373003728265328745101002001000020020000300373003711102011009910010010000100000071011611296340100001003003830038300383003830038

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)696b6d6edispatch 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)9fa6a8accfd2d5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
100243003722506129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100006400216222963010000103003830038300383003830038
100243003722506129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100006400216222963010000103003830038300383003830038
100243003722506129548251001010100001010000504277313300183300373003728287328767100102010000202000030037300371110021109101010000100006400216222963010000103003830038300383003830038
100243003722406129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300832110021109101010000100006400216222963010000103003830038300383003830038
1002430037225025129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100006400216222963010000103003830038300383003830038
100243003722506129548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100066400216222963010000103003830038300383003830038
100243003722508229548251001010100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100006400216222963010000103003830038300383003830038
100243003722506129548251001810100001010000504277313300180300373003728287328767100102010000202000030037300371110021109101010000100106400216222963010000103003830038300383003830038
100243003722506129548251001010100001010149504277313300180300373003728287328767100102010000202000030037300371110021109101010000100006400216222963010000103003830038300383003830038
10024300372320103295482510010101000010104477642881693045003060330370283163529013112082611793242264230699304181011002110910101000010202507064045216222963010000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  sqdmulh v0.4h, v8.4h, v9.h[1]
  sqdmulh v1.4h, v8.4h, v9.h[1]
  sqdmulh v2.4h, v8.4h, v9.h[1]
  sqdmulh v3.4h, v8.4h, v9.h[1]
  sqdmulh v4.4h, v8.4h, v9.h[1]
  sqdmulh v5.4h, v8.4h, v9.h[1]
  sqdmulh v6.4h, v8.4h, v9.h[1]
  sqdmulh v7.4h, v8.4h, v9.h[1]
  movi v8.16b, 9
  movi v9.16b, 10

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

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

retire (01)cycle (02)03080b1e1f3f51inst 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)9fa0a1a6a8a9acbranch mispredict (cb)cfd5d6ddinst fetch restart (de)e0? int output thing (e9)? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
802042005715000004125801001258000010080000500640000120020200392003999733999780100200800002001600002003920039118020110099100100800001000000000511021611200360800001002004020040200402004020040
8020420039150000041258010010080000100800005006400001201492003920039997339997801002008000020016000020039200391180201100991001008000010000038000511011611200360800001002004020040200402004020040
80204200391500015904125801001008000010080000500640000020020200392003999733999780100200800002001600002003920039118020110099100100800001000000000511011611200360800001002004020040200402004020040
802042003915000004125801001008000010080000500640000120020200392003999733999780100200800002001600002003920039118020110099100100800001000004301200511011611200360800001002004020040200402004020040
802042003915000004125801001008000010080000500640000020020200392003999733999780100200800002001604102009220039118020110099100100800001000000000511011611200360800001002004020040200402004020040
802042003915100004125801001008000010080000500640000120020200392003999733999780100200800002001600002003920039118020110099100100800001000000000511011611200360800001002004020040201992004020040
802042003915000004125801001008000010080000500640000020020200392003999733999780100200800002001600002003920039118020110099100100800001000000000511011611200369800001002004020040200402004020040
802042003915100004125801001008000010080000500640000020020200392003999733999780100200800002001600002003920039118020110099100100800001000000000511011612200360800001002004020247200402004020040
8020420039150000062258010010080000100800005006400001200202003920039997339997801002008000020016000020039200391180201100991001008000010000049000511011611200360800001002004020040200402004020040
802042003915000004125801001008000010080000500640000020020200392003999733999780100200800002001600002003920039118020110099100100800001000004901740511011611200360800001002004020040200402004020040

1000 unrolls and 10 iterations

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

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)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
80024200501500402580010108000010800005064000012002020039200399996310019800102080000201600002003920039118002110910108000010005020216112003680000102004020040200402004020040
800242003915004025800101080000108000050640000120020200392003999963100198001020800002016000020039200391180021109101080000100185020116112003680000102004020040200402004020040
800242003915004025800101080000108000050640000120020200392003999963100198001020800002016000020039200391180021109101080000100155020116112003680000102004020040200402004020040
800242003915004025800101080000108000050640000120020200392003999963100198001020800002016000020039200391180021109101080000100185020116112003680000102004020040200402004020040
800242003915004025800101080000108000050640000120020200392003999963100198001020800002016000020039200391180021109101080000100785020116112003680000102004020040200402004020040
8002420039150040258001010800001080000506400001200202003920039999631001980010208000020160000200392003911800211091010800001001805020116112003680000102004020040200402004020040
8002420039151042025800101080000108000050640000120020200392003999963100198001020800002016000020039200391180021109101080000100155020116112003680000102004020040200402004020040
8002420039150040258001010800001080000506400001200202003920039999631001980010208000020160000200392003911800211091010800001001145020116112003680000102004020040200402004020040
80024200391500402580010108000010800005064000012002020039200399996310019800102080000201600002003920039118002110910108000010005020116112003680000102004020040200402004020040
80024200391506402580010108000010800005064000012002020039200399996310019800102080000201600002003920039118002110910108000010005020116112003680000102004020040200402004020040