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

CASB

Test 1: uops

Code:

  casb 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
740073311424990201301101003010599832922002083830033006300622918600149298313286532907728300610023006100160123271426522171001100010001300604210022004001300399910002001624912187084033989283226243923444312616732441170451407515266300010013296032754329513284532781
740053292424530600201001004000605432757102081630063006300622908000149297603270132982725300610023006100260123277926532171001100010000300604010022004001300699910010001601411860084114007063226313991444420675632414163291447715712300010013279333026327633283332872
7400532857246103003011010040005813327230020861300630063006229121200149297693272532745725300610023006100160123300626182171001100010000300604210022004001300699910002001615111824083743999156225183887443819576132395165481433315188300010013270932834328693299932776
740053295924630300401001003000603432697002074630063006300322919500149297163266932841725300610013006100160063273226222171001100010000300304210012004001300699910002001598611802084094015360225193924444313636232428161901407615436300010013298032870330583289132843
740053278824520301401001001000611432813002080730063006300622829800149297473274332873724300610013006100260123281926362171001100010000300600010022004001300699910000001588611691184743983261226673934443513615532544162411443515320300010013272532915327723297732828
740053301724730200401101025000604432850002089130063003300622910410149295873272732768625300610023006100260123278726522171001100010000300604210022004101300699910012001613411920083543929261226253916444322606332489164281435815008300010013293032803329333292132979
740053285824830301301001001010607232721012067630063006300622890400149299673265132804727300610013003100260063286226232171001100010000300304210022002001300699910012001629412101083823974460226343984443812636232378167391421115831300010013288032780328093277232964
740053291924750301301101003000609432695002084130063006300322826300149298653273932798724300610023006100260063267426382171001100010000300604010022004001300699910012001630311887184304015461225193920443519566132376166901456915451300010013286033031328343284932836
740053286224530400501001001000608032706002077330033000300622834500149297993282532783825300310023006100260063282926772171001100010000300604010022004001300699910002001641111908084673941262225014031444519595632449163371421515525300010013284132795327873289832841
740053294124740100301001001000594232811002081930063006300322833500149298433284532916725300610023003100260063285426352171001100010000300604010022002001300399910012001607911913182243926457225613910443713576132457165251431715170300010013295133042328923290633040

Test 2: throughput

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 3.0080

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk data (08)09l2 tlb miss data (0b)0e0f18191e1f20223a3e3f404346494f51schedule 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 stall dispatch (70)rob full (74)map 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)a4ld 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)l1d tlb miss nonspec (c1)c2c3cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
502093008022520011300364313321803006539181211595122540100101013000010100300005179614034550149270003007730080198950320062401002020030000202006000030080771120201100991001000010100100000100300511543119110281200221620122823023999982620610644116231310117113007710000131330000201003008130081300813008130081
5020430080225111111003618113614123006534168341896722540100101013000010100300005182514034040349270003024430080198970320063401002020030000202006000030080761120201100991001000010100100000100300491743106010321200161370283173025599982524111774116201309117113007710000131330000201003008130081300813008130081
5020430080225220010003651112811123006532182162197882540100101013000010100301535173514034840049269843008030080198970320062401002020030000202006000030080771120201100991001000010100100000100300551741110010274200152390243163029199982624412724116001310117113007710000131330000201003008130081300813008230081
502043008022620221100362513353403006538154172398432540101101013000010100300005176214033511249270013008030081198950320062401002020030000202006000030080771120201100991001000010100100000100300362141104010298200143510282713023299982322311714118201310117113007710000131330000201003008130081300813008230081
502043008022522001000364011391100300650200313298472540101101003000010100300005180414034280249270003008030080198950320062401002020030000202006000030080771120201100991001000010100100000100300481642101010284200140390123073026199982422513674115201310116113007710000131330000201003008130081300813008130081
50204300642252002100036261048244300651417415209914254010110100300001010030000518221403433004927000300803008019895032006240100202003000020200600003008070112020110099100100001010010000010030048194581010324200175340503093023999982225511844316001310116113006110000131330000201003008130081300813008130081
502043008022520001000363593613030065191681819988325401001010330000101003000051798140342112492700030080300801989611232006240100202003000020200600003008076112020110099100100001010010000010030045164177010279200140310222453027599982526110734215001310116113007710001131330000201003008130081300813008130081
502043008022520021000361310301303006529175152795892540103101033000010100300005177214033191249270003008030080198950320062401002020030000202006000030080771120201100991001000010100100000100300432043100010260200173343282753024899982326211804115301310116113007710000131330000201003006530081300813008130081
50204300802252222100036871327120300652917115189502254010110102300001010030000517971403317004927000300803008019897032006240100202003000020200600003008077112020110099100100001010010000010030054164195010283200173310242883024699982522211674416401309117113007710000131330000201003008130081302373008130081
50204300802252202100036101321130300653415819319602254010110104300001010030000517741403357024927000300773008019897032006240100202003000020200600003008075112020110099100100001010010000010030041204190010273200182440283613023899982423510684215101310117113007710000131330000201003008130081300813008130081

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0076

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk data (08)09l2 tlb miss data (0b)0e0f18191e1f2022243a3e3f404346494f51schedule 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)5f6067696a6d6emap stall dispatch (70)rob full (74)map 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)92inst branch cond (94)inst int load (95)inst int alu (97)inst ldst (9b)9d9e9fl1d tlb access (a0)l1d tlb miss (a1)l1d cache miss st (a2)l1d cache miss ld (a3)a4ld 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)l1d tlb miss nonspec (c1)c2c3branch cond mispred nonspec (c5)cdcfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
500283007622522220000344511301023630061191017209731254001010010300001001030000513191402437112492699630076300761989303200584001020020300002002060000300767011200211090101000010010100000010300571634990100982001304603098300879998238611623416400012703173230073100009930000200103007730077300653007730077
500243006422623100100343211260040300612823111498432540010100103000010010300005134014031700114926996300773007619892032005840010200203000020020600003007673112002110901010000100101000000103004515337511008920014232024102300969998247411693316200012702172330073100009930000200103007730077300773007730077
500243007622522020000345113321010300612314172598102540010100143000010010300005134714032110114926996300763007619891092005840010200203000020020600003007674112002110901010000100101000000103005319358411010120014132020113300719998226411773416000012703173230073100009930000200103006530077300773007730077
5002430076225200000003462135710163630061241818179697254001010013300001001030000513011403105110492699630076300761989003200584001020020300002002060000300767411200211090101000010010100000110300311833711101312001922901864301029998226311643416200012703163230073100019930000200103006530077300773007730077
500243007622622021000343511261072830061411315199840254001110010300001001030000513701403171111492699630076300761989103200584001020020300002002060000300777311200211090101000010010100000010300531933751101332002322832095300889998258211753316200012693173230073100019930000200103007830077300773007730078
50024300762262022000034371325301030061251815209685254001110010300001001030000513561403264011492699630076300761989303200594001020020300002002060000300767311200211090101000010010100000010300421633901101102001534106102300959998245911673319200012693173430073100009930000200103007730077300773007730077
500243007622622220000343113311060300612319171499222540010100103000010010300005133614032870104926996300763007619892032005940010200203000020020600003006473112002110901010000100101000010103005416349501013020020131048108300979998241061181018200012702173230073100009930000200103007730077300773007730077
5002430076225222230003462113310303006134131625947525400101001130000100103000051343140311801049269963024530064198930320059400102013730000200206000030076741120021109010100001001010000001030050173586010111200196124436120300669998239311793415200012703172330073100009930000200103007730077300773007730077
5002430076225222210003450926104030061259231710002254001010010300001001030000513521403241010492699630076300761989103200594001020020300002002060000300767311200211090101000010010100000010300512134881101092001523803079300879998227311763316000012703163230073100009930000200103007730078300773007730077
5002430076226200200003504133600203006130221821969725400101001030000100103000051306140326911049269963007830076198920320059400102002030000200206000030076731120021109010100001001010000001030054163311211010320019232034121300889998249611613419400012702173330073100009930000200103007730077300783007730077

Test 3: throughput

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 3.0119

retire uop (01)cycle (02)0309l2 tlb miss data (0b)0e0f191e1f22233a3f4346494f51schedule 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)606367696a6d6emap stall dispatch (70)map 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)a4ld 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)st memory order violation nonspec (c4)branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd0d1d5map dispatch bubble (d6)ddfetch restart (de)e0e2e7eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
407283012122610100128971100301047015159333513640318936186217569171018838016110492704030119301172959450283895809629147281208386122720719123162301192502110201100991001000010010000010035030483312194642135701001940945999916901212133111166830012647121030119186628830000106123012030123301233012030125
40713301232260000012838110030105678145133113672319836869188576531005830583010492704030116301192918449283785764432157202209976149420868123222301232602110201100991001000010010000010035217503062052621311099974135199991701511213582146672021063800301161800010830000106133012130119302563012730123
4071630124226000001247601003010577151463335236728203363481805803610078408780104927044301163012030114500831158117310871492085461788208681232403010324921102011009910010000100100000100353514801620923213230110644219199991721711213911246642012156631513301151810081030000106043012030107301203049530120
40714301062260100013132200030091701014943378365162043672320457520921836766010492703830240303852928458482725749530487059208166129621013123324301042692110201100991001000010010000010035570463313203842132301011241250999916922212135911266870100681003011417980101030000106143012330118301223012030120
407083010622500000128581100301075001413335536850193364981805698899583409001049270433011930119296244078563572863059712920766612842086612272430119259211020110099100100001001000001003520051291420062212530104634158299991701211213571126718014067212143011517801101030000106143012330123301203012230120
40716301222260000012753210130109610111485325436870199364461985770186184045701049270393010630122304445158248586203067724920927613172049012231630119314211020110099100100001001000001003523203112199532121909800413279999175690121381112663901816250030116187837730000106093011830123301233012030123
407133011922500000124971100301077814138633863687319436526189578009988399490104927040301003012129324449807257355305169382103861584209141236063012726921102011009910010000100100000100354674626131988721186099964096199991693811213451136676009675109301181859210730000106083012730125301233010730107
407143011922500001133642000301056811156633853657418636647188573579528351270104927040301153011929854483812657839308771002094960915209401229943012222521102011009910010000100100000100349954806203322135801001541739999917674110135711266840229707161530113172618830000106093010430122301243012530120
407173012022600000129191100301065001590347236323199361931935759710288324120104927023301183010330434562792257800315871872108761632207071242963012031021102021009910010000100100000100350644629121999021164010269413539999167672121390213663112614664151330118185910030000106053012230120301233012230120
407213011922600110130931001301055811153931913643819536517199576621003836510010492702630114301203039443480625757029617211208226150020954122796301032152110201100991001000010010000010035407512913201322128709827413789999176401121367112660501416370030116183018030000106113012030120301203011930125

1000 unrolls and 10 iterations

Result (median cycles for code): 3.0113

retire uop (01)cycle (02)03l2 tlb miss instruction (0a)0e0f18191e1f22243f4346494f51schedule 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 stall dispatch (70)map 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)a4ld 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)st memory order violation nonspec (c4)cfd1d5map dispatch bubble (d6)ddfetch restart (de)e0e2e7eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
405423011322600100215722003008628894335143966521395812161128100790443114927045030101301131849485462846094719155321601648302165512919830113235211002110910100001010000110379293417212796421862019142497539999113587212110363111320630141530108191749030000105283010230118301023011430118
4054130113225011002136820030260408100535883957520394822061096100791514114927045030125301131782486663436095017854521604647042168912925230101245211002110910100001010000010377823400278032202301917549825999911353100010786304014619131530124189739630000105283012030126301273011430102
405413012622610000214690003008608898835563962120393672361022100791409114927033030101301131830493762546100220054321617647072160212952830113242211002110910100001010000010379483400278992191901920449741999911363701210786297914625141330098188949630000105273011430122301143010230114
405403011322500000213572003009537892736213947620394192161042105790223114927021030125301011818490962526116920755121606646382155412994230101245211002110910100001010000010379213408279262183901911649808999911364221210966306013597131430098192750030000105303012730111301143010230129
405433011322501100215832003011001001033366939426223961523610611057927030149270210301133011317794778633160917214537215916478821617129510301132422110021109101000010100000103792734198279562191201921049674999911362021011016336914612151530109192040030000105253010230102301263011830102
4054130125226111002152120030095370105236303947721395482261072113792033114927033030101301131839491663116116018350821687646592159712966630110244211002110910100001010000010377823408278082189901918649876999911361821210986299715597161530109190929630000105283011430114301143011430114
4054130113225000002162500030095070105535993939921393932161023109792311114927030030113301011770498261726114218049421668647282161012957630113242211002110910100001010000010380093402279292184711912849638999911356001210846300513625121530108192106630000105283011430114301143011430114
40541301132260110021376200300984879713649393912039423206102410679014801492702103012630126168848986381609971955202161264773216761292043011324321100211091010000101000001037836341502784321909019266500199999113593002109763141315642151330097186809030000105263011430120301143011430102
40542301012250000021514200300980789533558396062239346206113110379174401492703303011330101181549806274610752105142163764689215561299183010122821100211091010000101000001037965341682795821880019156496749999113664210109763001115597141430108190330630000105283010230113301023011830120
405393011922600000214292003009527895635713947320393982261051100796082114927046030113301281861486762796107521151021644646352158512949830110300211002110910100001010000110379633416112786821908019217498759999113520212106962741014641121330097188736630000105263011430111301023011830114