Apple Microarchitecture Research by Dougall Johnson

M1/A14 P-core (Firestorm): Overview | Base Instructions | SIMD and FP Instructions
M1/A14 E-core (Icestorm):  Overview | Base Instructions | SIMD and FP Instructions

CASAB

Test 1: uops

Code:

  casab w0, w1, [x6]
  nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop ; nop
  mov x0, 0

(no loop instructions)

1000 unrolls and 1 iteration

Retires (minus 70 nops): 4.001

Issues: 3.006

Integer unit issues: 0.000

Load/store unit issues: 3.006

SIMD/FP unit issues: 0.000

retire uop (01)cycle (02)03l1i tlb fill (04)l1d tlb fill (05)mmu table walk instruction (07)mmu table walk data (08)09l2 tlb miss instruction (0a)l2 tlb miss data (0b)0e0f191e1f22243a3f464951schedule uop (52)schedule ldst uop (55)dispatch ldst uop (58)simd uops in schedulers (5a)5f606163696a6d6emap rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map ldst uop (7d)map int uop inputs (7f)map ldst uop inputs (80)8283flush restart other nonspec (84)85inst all (8c)inst int load (95)inst ldst (9b)9dl1d tlb access (a0)l1d tlb miss (a1)l1d cache miss st (a2)l1d cache miss ld (a3)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9acafatomic or exclusive succ (b3)atomic or exclusive fail (b4)bbbcl1d cache miss ld nonspec (bf)l1d cache miss st nonspec (c0)l1d tlb miss nonspec (c1)c2cfd0d1d2l1i cache miss demand (d3)l1i tlb miss demand (d4)d5map dispatch bubble (d6)d9dadbddfetch restart (de)e0eaebec? ldst retires (ed)? int retires (ef)f5f6f7f8fd
740073448725811340026000010060105391341140022389300630063009229095001493146433908344138263006100330091003601834235267321710011000100003003040100820040063009999150100014999106121793735981382241593639444552586033195189651688917841300010013442434437344513443234425
740053437625800210026001010060005634340780022375300630063006229404001493150034025344198253009100330031002601234291272621710011000100003003040100520040073014999152120014945106642793735511365241373600444646696932900194151687617928300010013453934438344273450634460
740053447925800200031000010080105429341250022380300630063009229656001493132433958344357263006100230091001601834210271821710011000100003003042100520020053015999130100015076105643788536881272242943559444256657133304191621659017827300010013433034377345523449934452
740053438025800280026000010050005339340410022260300930093006230785001493130333924343557253006100330031002601234259271421710011000100003003022100820040093010999130120014988106113797635711670241413717444353716733278191621666917867300010013452234336344523443134502
74005344782580026001800001005000535434096002233830093006300922964400149313583391334505825300910033006100260063427027462171001100010000300904210052004007300199913000001516810668279753561969241353647444645696033266187771667117475300010013442234507344083445634379
740053442525800260126001010080105381340850022311300630033003228883001493143233950344958263009100230061002601234276271421710011000100013003041100820040063009999130020015039108112795435301866241353648444651616033156191541655117923300010013440234324344303443234496
740053445925800250027000010060005380341240022430300330063009229664001493126534161344557263006100230061002601234228269021710011000100003009042100520040063009999150120015563106190791035911471241693707444252676633242190661665117426300010013453734421342993438034382
74005343712580030002200001011010529234019002230530063006300323071310149312863399534405725300310033006100160123420626852171001100010000300304210052004007300699910012001507510589179453704870241253630444651686433242196071660317659300010013449734506344733452434462
740053453825900280026000010042005285340690022365300630093006229812001493130634033345107253009100330061000601834317274921710011000100003009000100420060063009999130120015041106833790235621166240773583444847706633178190681642117750300010013448334419344193434434297
740053449925800270026010010080005309341170022240300630033006229165001493136134002345247253006100030061001601234290269121710011000100003006000100420020043009999130120015065106982794636651253242113785444351646233449189491656717807300010013445034427344283440934468

Test 2: throughput

Code:

  casab w0, w1, [x6]
  add x6, x6, 2

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 3.0132

retire uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)09l2 tlb miss data (0b)0e0f191e1f20222324293a3e3f4043464951schedule uop (52)schedule int uop (53)schedule ldst uop (55)dispatch int uop (56)dispatch ldst uop (58)int uops in schedulers (59)simd uops in schedulers (5a)6067696a6b6d6emap rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map ldst uop (7d)map int uop inputs (7f)map ldst uop inputs (80)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int load (95)inst int alu (97)inst ldst (9b)9d9fl1d tlb access (a0)l1d cache miss st (a2)l1d cache miss ld (a3)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9aaabacafatomic or exclusive succ (b3)atomic or exclusive fail (b4)b6bbbcl1d cache miss ld nonspec (bf)l1d cache miss st nonspec (c0)c2c3branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eaebec? ldst retires (ed)? int retires (ef)f5f6f7f8fd
50208301662260000000341363610048303011845113031334010710101300061010230009505202538231049270200300893010572012540111202053000920205600183011618511202011009910010000101001000001003004556551008020019351063930119999821364518400111131701600301031000166030000201003010730121300993009230092
5020430130226001000035014511000503012129512223240107101013000610102300095052025345110492701803023830094720067401112020530009202056001830105185112020110099100100001010010000010030043154921008520017150068330120999821244729800111131701600300951000166030000201003010630092300923009230099
50204300912251000000339173810002030087264181633401061010130006101023000950520253434104927029030105301027201084011120205300092020560018301321851120201100991001000010100100000100300297065100692000724101443301119998204146010200111131701600300951000166030000201003011230098301143012530111
50204301242251000000343253710003030083203161532401071010130006101023000950520253504104927025030138301157200734011120205300092020560018301121851120201100991001000010100100000100300361948310109200092440469030116999820336297000111131701600301061000166030000201003009230103301053010530097
502043011622500000003420761100060301083762119284010010100300001010030000505132528721149270240301043009732008040100202003000020200600003011718511202011009910010000101001000001003003115680100762000514003671301399998202645011400000131011711301161000006030000201003009230103300993009930099
50204300982250000000344945810007030108387201428401001010030000101003000050515253374104927011030129301253200794010020200300002020060000301361851120201100991001000010100100001100300277281100972001433301466301159998208044211200000131011711300881000066030000201003009830108301003012030104
50204301092260100000344764410002430112548172428401001010030000101003000050513253277104927032030091301083202054010020200300002020060000301191851120201100991001000010100100000100300438690100722001824101064301399998205446611800000131011711301311000066030000201003013330142301453012130116
50204301122260000010338743110006030083264191728401001010030000101003000050513254167114927026030106301063200804010020200300002020060000300981851120201100991001000010100100000100300271437110089200062310264530112999821312387000000131011711301161000066030000201003010230092300933009230093
50204300912250000000342111601000303007719420162840100101003000010100300005051325350210492702503011130109320101401002020030000202006000030109185112020110099100100001010010000110030035816410087200052610326630093999820354357000000131011711300881000066030000201003011030115301073012230104
502043009122600000003415839100060300912342326284010010101300001010030000505132536611049270393301343015932013640100202003000020200600003011418511202011009910010000101001000001003003670691006220008160005330129999820332449000000131011711301091000066030000201003017130126301063009730127

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0120

retire uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)l2 tlb miss data (0b)0e0f1e1f20223a3e3f4043464951schedule uop (52)schedule int uop (53)schedule ldst uop (55)dispatch int uop (56)dispatch ldst uop (58)int uops in schedulers (59)simd uops in schedulers (5a)6067696a6d6emap rewind (75)map stall (76)dispatch uop (78)map int uop (7c)map ldst uop (7d)map int uop inputs (7f)map ldst uop inputs (80)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int load (95)inst int alu (97)inst ldst (9b)9d9fl1d tlb access (a0)l1d tlb miss (a1)l1d cache miss st (a2)l1d cache miss ld (a3)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9aaabacafatomic or exclusive succ (b3)atomic or exclusive fail (b4)b6bbbcl1d cache miss ld nonspec (bf)l1d cache miss st nonspec (c0)c2c3branch cond mispred nonspec (c5)cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
5002830193226000003414221170300843052118284001010010300001001030000500632530690049270593011630115320102400102002030000200206000030132185112002110910100001001010000010300300119681010420007339036141300909998215325110200012701162330126100006630000200103011430114301163012530097
500243010822600000341511421812300993372120284001010024300001001030000503092544890049271483011730115320102401222002030000200206000030121176112002110910100001001010000010300330100591013120020185202880302479998214336610400012701172230104100009630000200103012830114301033012630112
50024300992300000033991136130301033562223284001010010300421001030000500632533100049270293010530122320092400102002030000200206000030109185112002110910100001001010000010300270687610091200092510667301389998205545913600012703171130124100006630000200103011830130301243012730116
500243012322600000340974612030080294192628400101001130000100103000050063253488104927030301063011332008540010200203000020020600003012318511200211091010000100101000001030036088691011420011043361056301119998205255712000012702161130102100006630000200103011730115301223010730100
50024301192250000034444291603010631318172840010100103000010010300005006325293710492702030120301073200714001020020300002002060000301061851120021109101000010010100000103002901057410101200145530660300979998203765914000012702172130102100006630000200103098330136301173011630156
5002430117233000003478113913030088315211428400101001030000100103000050063253044104927051300993010632007440010200203000020020600003012618511200211091010000100101000001030090015510410104200075440656302049998214425212801012702163230096100156630000200103010030127301263011430116
500243013422510001342553214430097254222028400101001030000100103000050063253314104927035301163012332011040010200203000020020600003011719211200211091010000100101000001030052013018110079200111560224930095999821403578600012701172130142100006630000200103015130129301263012930414
5002430127226000003419631140300852562219284001010010300001001030000500632536880049270663011330131320096400102002030000200206000030116185112002110910100001001010000010300889183109101062000514503055300999998213226613401012701161130113100006630000200103015830169301403012130117
5002430140226000003420233160301094151420284001010010300001001030000500632530220049270363011530114320088400102002030000200206000030131185112002110910100001001010000010300851114687100672000923101654300559998234436010001012701171130114100009630000200103014230176301403012930116
500243012022600000345634714483008734621192840010100103000010010300515006325372900492703630105301143201134001020020300002002060000301301851120021109101000010010100001103010411172111101292001145004251301239998214988113200012702162130127100009030000200103018230164301373012630112

Test 3: throughput

Code:

  casab w0, w1, [x6]
  mov x7, 8

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 19.0245

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk data (08)09l2 tlb miss data (0b)0e0f18191e1f2223243a3f43464951schedule uop (52)schedule int uop (53)schedule ldst uop (55)dispatch int uop (56)dispatch ldst uop (58)int uops in schedulers (59)simd uops in schedulers (5a)6063696a6b6d6emap rewind (75)map stall (76)dispatch uop (78)797bmap int uop (7c)map ldst uop (7d)map int uop inputs (7f)map ldst uop inputs (80)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int load (95)inst int alu (97)inst ldst (9b)9d9fl1d tlb access (a0)l1d tlb miss (a1)l1d cache miss st (a2)l1d cache miss ld (a3)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)a9aaacafatomic or exclusive succ (b3)atomic or exclusive fail (b4)bbbcl1d cache miss ld nonspec (bf)l1d cache miss st nonspec (c0)l1d tlb miss nonspec (c1)c2branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd1d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eaebec? ldst retires (ed)? int retires (ef)f5f6f7f8fd
40208191421142311011000243861210021914040883430142100300421003004250025987760149188341019008719142113181368301422210214300421021460084190088138021102011009910010000100100000100300622128262437420040600143944439799991143821312311117277751017001899190131363000010101191431190088191432190088191422
402051914211423110100002438312100119007208934301391003003910030039500259898111491870070191421190087131800423013922102133003910213600781900871380211020110099100100001001000001003005819002438420151610143864440399991143681212311117277747017011912340131363000010101190088191424190444191421190088
40205190087143711000100243821210021900726883430310100300421003012650026181271149188328019008719142113181371301422210270300421021460084191405137021102011009910010000100100000100300611828282437920040000143844439599991143701212311117277749071001912520131353000010101190422190088190075191742190088
4020519043614331100000024376131001191406680343014210030042100301265002599001114918700701914211900871318005130142211021430042102146008419008713632110201100991001000010010000010030061192802437920040000143834439499991143701200301117287761017001899190131353000010101190088191420190088191422190088
40205190071143410000040243801210021914063883430310100300421003004250025990021149187007019142019008713180051301423310214300421021460420190087138061102011009910010000100100000100300612228272438520040000143684439699991143691212311117277751145321912202131343000010101190088191422190149191423190072
40205190087143411000100243591210011900725883430139100300841003003950025987530149187007019142119008713180042301392210213302071021360078191419137021102011009910010000100100000100300571928272437220038310143684438299991143641312311117337762227221898940131353000010101191422190787190072191422190072
40205190091146910010100243811310031913880903430139100300391003020750025990530149187007019140319007140180042301393210213302071021360078190074137961102011009910010000100100000100302281828272437920038420143834440099991143531212311117277760017001899191131343000010101190445191514190252191928190072
40205190418143411010000243621210011914096883430142100300421003004250025990760149186992019142019008713180051301422110214300421021460084190087137821102011009910010000100100000100302342028282437620041410143944439299991143591212301117617765017001912510131353000010101190088191421190597191523190088
40205191419142411010000243831201021915611873430142100300421003004250025990700149187007019142119041213180051301421110228300421021460084192103141141102011009910010000100100000100300621928272437220040000210794438999991143701212331117687758017001899230131363000010101191422190088191407190088191422
4020519142014241101000024455120003190072788343013910030039100300395002598852114918699201914211900871318002830139211021330039102136007819008813742110201100991001000010010000110030058192802437820038000143794439299991143561212301117337762227221898930131353000010101190088191407190088191421190072

1000 unrolls and 10 iterations

Result (median cycles for code): 19.0074

retire uop (01)cycle (02)03mmu table walk data (08)09l2 tlb miss data (0b)0e0f1e1f2223243a3f43464951schedule uop (52)schedule int uop (53)schedule ldst uop (55)dispatch int uop (56)dispatch ldst uop (58)int uops in schedulers (59)simd uops in schedulers (5a)6063696a6b6d6emap rewind (75)map stall (76)dispatch uop (78)797bmap int uop (7c)map ldst uop (7d)map int uop inputs (7f)map ldst uop inputs (80)8283flush restart other nonspec (84)85inst all (8c)inst branch (8d)inst branch taken (90)inst branch cond (94)inst int load (95)inst int alu (97)inst ldst (9b)9d9fl1d tlb access (a0)l1d cache miss st (a2)l1d cache miss ld (a3)ld unit uop (a6)st unit uop (a7)l1d cache writeback (a8)acafatomic or exclusive succ (b3)atomic or exclusive fail (b4)bbbcl1d cache miss ld nonspec (bf)l1d cache miss st nonspec (c0)c2branch mispred nonspec (cb)cfd1d5map dispatch bubble (d6)ddfetch restart (de)e0e7eaebec? ldst retires (ed)? int retires (ef)f5f6f7f8fd
4002819140814240001024369010011903962063430468103003910300395026169040149188330019068519075217181374300492010033300391003360330192284135721100211091010000101000001030039271524404200270143514438899991143471120065177473363218987016603000010011191400190066191409190238191409
4002519140814241000024356100001900592663430049103003910300395026168910149186994019140819145810181376300492010033300391003360078191397135721100211091010000101000001030039271324358200270143504438199991143420120067677393183318987000603000010011191407190075191589190066191407
400251900741434001002435611000191393066343004910300391030039502600861014918717301914401914311018136730049201003330123100336007819158113572110021109101000010100000103003901524352200270143534438599991143700120067277453183218987909603000010011191409190075191409190075191409
4002519149414240100024641110001900592873430049103003910300395025987760149186997019012119007810180042300492010061300391003360078190074136521100211091010000101000001030039281524360200260143524438099991143491120065177403184318987016603000010011190066191476190078191409190066
4002519007414340000024357100011900592063430049103003910300395025989071149186994019010919008010180043300492010033300391003360078190065136521100211091010000101000001030039281524357200270143474438099991143420020065177413183319120906603000010011190066191398190066191581190078
400251900741434000002435500000191383066343004910301231030039502600759014918832801902311901311018004230133201003330039100336007819007713584110021109101000010100000103012528024364200270143514438899991143650020065177483184318987916603000010011191398190066191583190071191559
4002519139914240000024356010001902340883430049103003910300395026169450149188328019140819148010181376300492010061300391003360078191399135721100211091010000101000001030039271624367200270143634438999991143440120065177452183319121206003000010011190066191400190066191411191424
40025190065146600000243671100019005906634300491030039103003950259891901981883550190120190077101807063004921100613003910033604141901491367211002110910100001010000010300392714243642002761143504438499991143491120065177343183318987916603000010011191409190075191407190066191409
4002519140614230000024355100111900592603430049103003910300395025989101149186985019144419007510181376300492010033300391003360078191407135721100211091010000101000001030039271524362200270143504438999991143481104065177454183319120216613000010011191412190075190588191409190075
400251900651434000002434710101191391267343004910300391030039502616933114918832801914621900781018003330049101003330039100336016819140613572110021109101000010100000103003901524355200260143534438499991143421100065177473183318987916603000010011191399190075191400190075191408