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, 4H)

Test 1: uops

Code:

  usqadd v0.4h, v1.4h
  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
100430372406125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
1004303725546125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372406125482510001000100039831313018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372406125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372306125482510001000100039831313018303730372415328951000100020003037303711100110000373116112630100030383038303830383038
100430372406125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038
100430372308225482510001000100039831303018303730372415328951000100020003037303711100110001073116112630100030383038303830383038
100430372406125482510001000100039831313018303730372415328951000100020003037303711100110001073116112630100030383038303830383038
100430372306125482510001000100039831303018303730372415328951000100020003037303711100110000073116112630100030383038303830383038

Test 2: Latency 1->1

Code:

  usqadd v0.4h, v1.4h
  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)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)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)9fa1a8accfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037232012061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
102043003723300061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
102043003723300061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
102043003723300061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
1020430037233000243295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
102043003723300061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
102043003723200061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
102043003723300061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
102043003723200061295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038
102043003723300082295482510100100100001001000050042773130300183003730037282653287451010020010000200200003003730037111020110099100100100001000007102162229634100001003003830038300383003830038

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0037

retire (01)cycle (02)0318191e1f3f4e51inst 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)9fa8accdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
10024300372250000612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250000612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250000612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250000612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372240422806129548251001010100001010000504277313030018300373003728287328767100102010168202033630081300371110021109101010000100300640216222963010000103003830038300383003830038
10024300372250000612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
1002430037225003600612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250000612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
10024300372250000612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038
100243003722530300612954825100101010000101000050427731303001830037300372828732876710010201000020200003003730037111002110910101000010000640216222963010000103003830038300383003830038

Test 3: Latency 1->2

Code:

  usqadd v0.4h, v0.4h
  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)030b181e3a3f4e51inst 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)5e60696d6edispatch 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)9fa8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1020430037233000016929547251010010010000100100005004277160013001830037300372827107287401010020010008200200163003730037111020110099100100100001000001117170160029646100001003003830038300383003830038
102043003723300006129547251010010010000100100005004277160003001830037300372827106287401010020010008200200163003730037111020110099100100100001000001117180160029646100001003003830038300383003830038
102043003723300006129547251010010010000100100005004277160013001830037300372827107287401010020010008200200163003730037111020110099100100100001001001117170160029645100001003003830038300383003830038
102043003723300008429547251010010010000100100005004277160013001830037300372827107287411010020010008200200163003730037111020110099100100100001000001117170160029645100001003003830038300383003830038
1020430037233000053629547251010010010000100100005004277160013001830037300372827106287411010020010008200200163003730037111020110099100100100001000001117180160029646100001003003830038300383003830038
10204300372320000980295472510100100100001001000050042771600130018300373003728271012287331010020010008200200163003730037111020110099100100100001000001117180160029645100001003003830038300383003830038
102043003723300006129547251010010010000100100005004277160013001830037300372827107287411010020010008200200163003730037111020110099100100100001000031117170160029645100001003003830038300383003830038
102043003723200906129547251010010010000100100005004277160013001830037300372827107287411010020010008200200163003730037111020110099100100100001000001117170160029645100001003003830038300383003830038
1020430037232000061295472510100100100001001000050042771600130018300373003728271072874110100200100082002001630037300371110201100991001001000010011001117180160029645100001003003830038300383003830038
102043003723200006129547251010010010000100100005004277160013001830037300372827106287411010020010008200200163003730037111020110099100100100001000001117170160029645100001003003830038300383003830038

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)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)9fa0a1a6a7a8a9acc2cfd5d6ddinst fetch restart (de)e0? int output thing (e9)ec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1002430037232000000061295472510010101000010100005042771600300183003730037282863287671001020100002020000300373003711100211091010100001000005600064041644296290010000103003830038300383003830038
10024300372330000000612954725100101010000101000050427716003001830037300372828632876710010201000020200003003730037111002110910101000010000045012064041643296290010000103003830038300383003830038
100243003724200000006129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000100000200064041644296290010000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160030018300373003728286328767100102010000202000030037300371110021109101010000100000100064031634296290010000103003830038300383003830038
1002430037225000000023229547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000000064041643296290010000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000300064031634296290010000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000100064041643296290010000103003830038300383003830038
100243003722500000006129547251001010100001010000504277160130018300373003728286328767100102010000202000030037300371110021109101010000100000000064031634296290010000103003830038300383003830038
100243003722500000008429547251001010100001010000504277160030054300373003728286328767100102010000202000030037300371110021109101010000100000406464052434296290010000103003830084300863003830038
1002430037225100000061295472510010101000010100005042771600300183003730037282903287671001022100002020000300373003711100211091010100001000003203064041643296290010000103003830038300383003830038

Test 4: throughput

Count: 8

Code:

  movi v0.16b, 0
  usqadd v0.4h, v8.4h
  movi v1.16b, 0
  usqadd v1.4h, v8.4h
  movi v2.16b, 0
  usqadd v2.4h, v8.4h
  movi v3.16b, 0
  usqadd v3.4h, v8.4h
  movi v4.16b, 0
  usqadd v4.4h, v8.4h
  movi v5.16b, 0
  usqadd v5.4h, v8.4h
  movi v6.16b, 0
  usqadd v6.4h, v8.4h
  movi v7.16b, 0
  usqadd v7.4h, v8.4h
  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)031e3f5051inst 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)9fa8acc5branch mispredict (cb)cdcfd5d6daddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
16020420090155029025801161008001610080028500640196012004520065200656128012820080028200160056200652006511160201100991001001600001000011110121116022200621600001002006620066200662006620066
160204200651551229025801161008001610080028500640196002004520065200656128012820080028200160056200702006511160201100991001001600001001011110121116021200621600001002006620066200662006620066
16020420065155029025801161008001610080028500640196002004520065200656128012820080028200160056200652006511160201100991001001600001000011110121216012200621600001002006620066200662006620066
16020420065156029025801161008001610080028500640196002004520065200656128012820080028200160056200652006511160201100991001001600001000311110120216022201291600001002006620066200662006620066
16020420065155029025801161008001610080028500640196112004520065200656128012820080028200160056200652006511160201100991001001600001000011110121216012200621600001002006620066200662006620066
16020420065156029025801161008001610080029500640196012004520065200656128012820080028200160056200652006511160201100991001001600001000011110121216021200621600001002006620071200662006620066
16020420065156043025801161008001610080028500640196002004520065200656128012820080028200160056200652006511160201100991001001600001000011110121216021200621600001002006620066200662006620066
16020420065156029025801161008001610080028500640196002004520065200656128012820080028200160056200652006511160201100991001001600001000011110121216022200621600001002006620066200662006620066
16020420065155029025801161008001610080028500640196002004520065200656128012820080028200160056200652006511160201100991001001600001000011110121216022200621600001002006620066200662006620066
16020420065155029025801161008001610080028500640196002004520065200656128012820080028200160056200652006511160201100991001001600001000011110120216012200621600001002006620066200662006620066

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0307080b18191e1f3f51inst 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)5f6061696d6e74scheduler 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)9fa0a1a6a8acc2cfd0d2icache miss (d3)d5d6d9dadbddinst fetch restart (de)e0eaec? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024200711550000000802780010108000010800005064000011102003220051200510322800102080000201600002005120051111600211091010160000100000001003313212125211321020061201160000102005220052200522005220052
160024200511550000000452780010108000010800005064000011102003220051200510322800102080000201600002005120051111600211091010160000100000001004313312125211102220048201160000102005220052200522005220052
160024200511550000000452780010108000010800005064000011102003220051200515322800102080000201600002005120051111600211091010160000100000001003313512125211281120048211160000102005220052200522006120061
16002420051155000000045278011510800001080000506400000110200322005120051032280010208000020160000200512005111160021109101016000010000000100431351925411182120048202160000102005220052200522006120052
16002420051156000000066278001010800001080000506400001110200412005120061032280010208000020160000200602005111160021109101016000010000000100331361934422212220048201160000102005220052200522005220052
16002420051155000000045278001010800001080000506400001110200322005120051032280010208000020160000200512005111160021109101016000010000000100431351925211231920048201160000102005220052200522005220052
1600242005115500000006627800101080000108000050640000111020032200512005103228001020800002016000020051200511116002110910101600001000000010043135172621128920048201160000102005320052200522005220052
160024200511550000000176288001010800001080000506400001110200322005120051032280010208000020160000200512005111160021109101016000010000000100431351934211261820048201160000102005320052200522005220052
16002420051161000000045278001010800001080000506400001110200322005120051032280010208000020160000200512005111160021109101016000010000000100431351725211231920048201160000102005220052200522005220052
160024200511550000000452780010108000010800005064092401102004220051200600322800102080000201600002006020051111600211091010160000100000001004313622025221112220048401160000102005220061200522005220061

Test 5: throughput

Count: 16

Code:

  usqadd v0.4h, v16.4h
  usqadd v1.4h, v16.4h
  usqadd v2.4h, v16.4h
  usqadd v3.4h, v16.4h
  usqadd v4.4h, v16.4h
  usqadd v5.4h, v16.4h
  usqadd v6.4h, v16.4h
  usqadd v7.4h, v16.4h
  usqadd v8.4h, v16.4h
  usqadd v9.4h, v16.4h
  usqadd v10.4h, v16.4h
  usqadd v11.4h, v16.4h
  usqadd v12.4h, v16.4h
  usqadd v13.4h, v16.4h
  usqadd v14.4h, v16.4h
  usqadd v15.4h, v16.4h
  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)030b18191e1f3f51inst 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)9fa6a8a9acc5branch mispredict (cb)cdcfd5d6ddinst fetch restart (de)e0? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
1602044003931100000302516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010001031111011821622400361600001004004040040400404004040040
160204400393100006906952516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000031111011821622400361600001004007640040400404004040040
1602044003931000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010001001111011821622400361600001004004040040400404004040040
1602044003931000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011821622400361600001004004040040400404004040040
16020440039310000006952516010810016000810016002050012801320400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011821622400361600001004004040040400404004040040
1602044003931000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039211602011009910010016000010000001111011841634400361600001004004040040400404004040040
1602044003931000000302516010810016011010016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011821622400361600001004004040040400404004040040
16020440039310000003025160108100160008100160020500128013204002040039400391997761999016012020016003220032006440039400391116020110099100100160000100000151111011821622400361600001004004040040400404004040040
1602044003931000000302516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011811622400361600001004004040040400404004040040
1602044003931000000722516010810016000810016002050012801321400204003940039199776199901601202001600322003200644003940039111602011009910010016000010000001111011821621400361600001004004040040400404004040040

1000 unrolls and 10 iterations

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

retire (01)cycle (02)0304070a1e1f3a3f51inst 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)5e5f60696d6edispatch 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)9fa6a8a9accfd0d2icache miss (d3)itlb miss (d4)d5d6d9dadbddinst fetch restart (de)e0? int output thing (e9)eaeb? fp/simd (ee)gpr retires (ef)f5f6f7f8fd
160024400513100011201462516001010160000101600005012800000014002040039400391999632001916001020160000203200004003940039111600211091010160000100300100233110391613112920400360165160000104004040040400404004040040
16002440039310001000582516001010160000101600005012800000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000100233110261638212926400360165160000104004040040400404004040040
1600244003931011100046251600101016000010160000501280000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000010024311124161112727400360165160000104004040040400404004040040
1600244003931110000058251600101016000010160000501280000011400204003940039199963200191600102016000020320000400504003911160021109101016000010000010024311125161112425400360165160000104004040040400404004040040
1600244003931011100186251600101016000010160000501280000211400204003940039199963200191600102016000020320000400544003911160021109101016000010000010024311121161111525400360165160000104004040040400404004040040
1600244003931011190146251600101016000010160000501280000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000010024311129591112819400360165160000104004040040400404004040040
1600244003931110000146251600101016000010160000501280000011400204003940039199963200191600102016000020320000400394003911160021109101016000010000010023311116381112327400360165160000104004040040400404004040040
16002440039310101001582516001010160000101600005012800000114002040039400391999632001916001020160000203200004003940039111600211091010160000100000100256220273132228194003603110160000104004040040400404004040040
16002440039310011001642516001010160000101600005012800000014002040039400391999632001916001020160000203200004003940039111600211091010160000100000100256220263132222294003603110160000104004040040400404004040040
16002440039310001001522516001010160000101600005012800000014002040039400391999632001916001020160000203200004003940039111600211091010160000100100100246220263132224304003603110160000104004040040400404004040040