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

CASLB

Test 1: uops

Code:

  caslb 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.009

SIMD/FP unit issues: 0.000

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk instruction (07)mmu table walk data (08)09l2 tlb miss instruction (0a)l2 tlb miss data (0b)0e0f1e1f22243a3f464951schedule uop (52)schedule ldst uop (55)dispatch ldst uop (58)simd uops in schedulers (5a)5f63696a6d6emap 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)c2c3cfd0d1d2l1i cache miss demand (d3)l1i tlb miss demand (d4)d5map dispatch bubble (d6)d9dadbddfetch restart (de)dfe0eaebec? ldst retires (ed)? int retires (ef)f5f6f7f8fd
740093301924812700211101005200589932988102089730093009300922976614929735328123302782930091002300610036012328142631217100110001000030135041005200802530079991001200015879115130843939509692271338394439105247332576168721464715219300010013283232906328703292832936
7400532791246017002100010000005861327580020972301230093009229271114930058328673285882630061004300910036012330032617217100110001000030060401002200400430099991001200016009116261836240059472255838384429174756432506168731494115290300010013277232864327493284633153
7400533126248020002100010000106034327771120823300630063006229258149297163267432962930300610023009100360183282125792171001100010000300904210022004000300999910012000162471181908503400711482261138624439175246332457165841504715407300010013276032892328033280433160
7400533002247017001800010020005893327771120902300930093006229587149295513265032905830300610023009100260123305525872171001100010000300904010022004001300999910010000162091189608269398811582259038834447115162332462162911506815145300010013268232906327933278532856
740053295824602500160001002010568232740012090830063009300622864514929767325953275382830061003301810046018330532610217100110001000030120021003200010130069991000231016072118740841039866532248339274434184950332489163481468215218300010013286832847329183304132852
740053296124601800200001002000566332792012071230063009300622849914929684327103316292730061003300910026012328362623217100110001000030090421002200400430099991001200015922118300836438268462253938684436164647432430166731451215907300010013287032874328343292332794
7400532921245016002000010070005853330441120792300630003006229349149298453288133042826300910023009100360183283925962171001100010000300602210022006001300999910012000163081173608294396314482253839604435145754332582169261481615470300010013300732928329743298032967
7400532713247023002200010000105809326551120811300630063006229291014929522326823284692930061003301210036012328862588217100110001000030060421002200400130099991001200016144118180833039979442253039164433184752432538166511458215768300010013295332790329093297032971
74005330082460210017000100201058653278000207833009300630092292012149297253280132850826300610023006100260123270825992171001100010000300604010032006000300699910012000162551170208397392911552257138364438134648332524172341462415037300010013290032891328043294733010
7400532789247019002201110000005951326501120837300930093009229188149298213283633036829300610023006100260243278025942171001100010000301204210022006000300699910012003279216237119371840439597522255138704436104446332446163421493915468300010013286433000330933305832907

Test 2: throughput

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 7.0062

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk data (08)l2 tlb miss data (0b)0e0f191e1f20223a3e3f404346494f51schedule 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)60696a6d6emap stall dispatch (70)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)c2c3cfd5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
5020870070525110110506245010070047492131347861254010010100300001010030000505543314052149669827003070053596583600354010020200300002020060000700647111202011009901001000010100100000010030044332511297110061200061330263730061999821290403012013101171169909100006630000201007006570063700637006370062
5020470064524110000505322610070047314121047776254010010100300001010030000505553315097049669847003070062596603600474010020200300002020060000700627011202011009901001000010100100000010030039226511342310053200041320244430055999821342373010013101171169909100009630000201007006370068700667005470065
502047005352511100050562381007003820212124701925401001010030000101003000050554331405104966985700337006259649360044401002020030000202006000070065701120201100990100100001010010000001003002632431371410065200041320284630050999821292432410013101171169906100006630000201007006370054700647006370054
5020470062525101000504643210070047362131447468254010010100300001010030000505543314314149669827003470062596583600444010020200300002020060000700527011202011009901001000010100100000010030037227591351710058200051330304730065999820262382411013101171169906100006630000201007006370062700627006670063
5020470062525111000505642210070047363141347468254010010100300001010030000505553314305049669827003470065596483600444010020200300002020060000700617011202011009901001000010100100000010030046233481367110055200021250263430063999820172352410013101171169906100009630000201007006370066700637006370062
5020470065524111000506323910070047424121347891254010010100300001010030000505543314920049669847003770065596613600474010020200300002020060000700627011202011009901001000010100100000010030030133160135051006420010202804730041999820170272411013101171169905100006630000201007006370062700637006270062
502047006252511100050493331112700462451218480972540100101003000010100300005055533146361496697370039701145966136004440100202003000020200600007006570112020110099010010000101001000000100300332243513453100502000933306363007099982031240011013101171169906100009630000201007006670054700537006370063
502047006552411000050533451107004741361048101254010010100300001010030000505553315398149669887002170061596493600444010020200300002020060000700657011202011009901001000010100100000010030040332481404210063200030450284230060999820250362411013101171169906100009630000201007006370062700637006370062
5020470061525101000505032610070047323121047314254010010100300001010030000505543314914149669827003370062596583600444010020200300002020060000700627011202011009901001000010100100000010030031226491356110068200050350304130053999820282373011013101171169906100006630000201007006370063700637006370063
5020470062524111000507043610070047362101247505254010010100300001010030000505543315488149669847003370065596603600444010020200300002020060000700647011202011009901001000010100100000010030041233441380810043200054640244930069999821272313010113101171169906100006630000201007006370062700637006370063

1000 unrolls and 10 iterations

Result (median cycles for code): 7.0061

retire uop (01)cycle (02)03mmu table walk data (08)l2 tlb miss data (0b)0e0f181e1f202223243a3e3f404346494f51schedule 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)5f60696a6d6emap stall dispatch (70)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)c2c3cfd2d5map dispatch bubble (d6)ddfetch restart (de)e0? int output thing (e9)eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
5002870070524000005078336000007004634148134748525400101001030000100103000050105331486800496698170034700615965736004340010200203000020020600007006170112002110901010000100101000000103002400741356810069200072440325130070999820362382401128701171169905100006630000200107006770062700537062570054
5002470061547000005066229100007004937141411474662540010100103021010010300005010433147280149669817003670061596573600464001020020300002002060000700647011200211090101000010010100000010300410306713713100882001310034663008499982040241090127001171169905100009030000200107006570065700627006570065
500247006152500000506003801000700372914111347314254001010010300001001030000501043314871014966984700337006159657360034400102002030000200206000070064701120021109010100001001010000001030045025531336110078200141370285330071999820512732600127001171269905100006930000200107006270062700537006570062
5002470064525000005065236010047004634141319476752540010100103000010010300005010433148520149669817003370061596561360046400102002030000200206000070061701120021109010100001001010000001030056032451371310104200101570405830097999821452442400127001171169905100009930000200107005370065700627005370065
5002470064525000005065324010036700462914111147485254001010010300001001030000501053315586004966981700347006159656360043400102002030000200206000070052701120021109010100001001010000001030031025451367010085200023350286230109999820362442400127001171169905100006630000200107006270062700627006270062
500247006152500000506532501000700462414176470692540010100103000010010300005010433140040149669817003670061596563600434001020020300002002060000700617011200211090101000010010100000010300321226521338810075200032350166130070999820332282400127001171169905100006630000200107006370053701047006370062
500247006152500100507022501000700462314151347788254001010010300001001030000501043315216014966981700247006459657360046400102002030000200206000070066701120021109010100001001010000001030034024491398010099200040400344730093999821462372400127001171169905100006630000200107006370062700627006270054
500247006152500000508425000100700462214111247756254001010010300001001030000501043315067014966981700337006159647360034400102002030000200206000070061701120021109010100001001010000101030036030591362410085200012470285430091999821382363001127001171169905100006630000200107006270062700627006270062
500247006152500000507625101080700463514111247468254001010010300001001030000501043315445014966984700337006159657360046400102002030000200206000070061701120021109010100001001010000001030051026571384510093200071430285430094999821432453000127001172169896100006630000200107005370062700627006270062
5002470052524001005066231010007004629141011473132540010100103000010010300005010433139210149669847003370061596601360044400102002030000200206000070052701120021109010100001001010000001030020024521353910067200033320244630062999820362322401127001171169905100006630000200107006270062700627006270062

Test 3: throughput

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 7.0108

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk data (08)l2 tlb miss data (0b)0e0f1e1f22243a3f4346494f51schedule 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 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)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)c2st memory order violation nonspec (c4)branch cond mispred nonspec (c5)branch mispred nonspec (cb)cdcfd0d1d5map dispatch bubble (d6)ddfetch restart (de)e0e2e7eaebec? ldst retires (ed)? int retires (ef)f5f6f7f8fd
41821701125250000014187141007008907873561140142885401422813891088052021175282811496702207008670133597212682232601108637965130074163112117642121242568701147011321102011009910010000100100000100425331934261105028719215100290634806499991903320000315011521443102530462124700293470299030000116437011370102701067011470113
4176370117525111001484914100700890887187106394231042543723401108618166317214420149670240700707010361281196223553113930844512507421521225354155524928270104700942110201100991001000010010000010041631028151122528623211100099674886599991847420200303110221980062133982929700183384006030000116417009570108700957010570108
417267010452500000137912002070089090848710489441434074456340011225718871720620014967026070082700947626119142229511414987611240241536122277415952416867011170107211020110099100100001001000001004271517342611101282632142202102875108899991809114023229881132125411824339910700273531099030000116497010570106701187009570105
4174170094525000001509901007009200674901034743318390433593051144772004172671901496702307007870106551312479229691107788780125624137412429341545245424701047010321102011009910010000100100001100418130280107572851921548001012651600999919201212003054116214611222947272633700093559299030000116557011570103701087012670130
4178170119525111111434913101870097610107942104784397039443086372110765195017290591149670280700847010154011175123969110345873512080419601170604167824623470113701132110201100991001000010010000110043353203632114932896121482001036750807999918629121231305601421092020031892624700203400190030000116527011370117701197010470105
41771701125251110014978200070090178717510519433563624225740311172020181734966114967024070072701045584121072261411148784291292641571121266417102400787011570104211020110099100100001001000001004334002815111852725721276009729485089999187770100032971232125405032102124700083414066030000116617009570109701057011070107
4170770107525000001423720015700891707338107674448847242287371111313166017512521149670320700927011267661210323175112978858712214409881235644228324404470123701132110201100991001000010010000010042979193626104602903021744119619495769999186611210323027115212630220318500700483346190030000116937010170128701107011070123
417557011552511000144732101970089086734810763430053614376342511257916881782284114967024070089701044586120372327610652489201252441052122961412352439307010170116211020110099100100001001000001004292819029115692878621728039686504689999187771410323264004209061262735212326700163409299030000116187013070131701057011570113
41755701135251100015114140023700990006886105194352138142864399106649184517094140149670240700727010461321197223204114708872012337401561216414065024186670104701042110201100991001000010010000010042061001710974276662151300895349030999916618012003116114214931124343600700423425109030000116837010470105700957010670105
4174370104525000001423421018700880107718311254436483274434742811322020971709766014967014070069700946218113532293611305883091194140964122400414182319427010770107211020110099100100001001000001004165302814122252721421228009853493749999185610120031301052072311030353301700213461066030000116187009570105701057010570105

1000 unrolls and 10 iterations

Result (median cycles for code): 7.0113

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk data (08)09l2 tlb miss data (0b)0e0f18191e1f2223243a3f4346494f51schedule 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)6063696a6d6emap 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)92inst 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)a9acafatomic or exclusive succ (b3)atomic or exclusive fail (b4)bbbcl1d cache miss ld nonspec (bf)l1d cache miss st nonspec (c0)c2st memory order violation nonspec (c4)cfd1d5map dispatch bubble (d6)ddfetch restart (de)e0e2e7eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
41692701145250010000021888200007009809102429126235128843512454112780719515190380149670367008970113939133901574012730338658144807134817448042690947009470095211002110901010000101000001050898036218919411502329600170166436399991160072000256222034152744872932700324138301030000116777009570114701147009570114
4168570118525000000002186500000700980892442126575157040512744412777020015165650149670347009170110880133341558012772041555144930134583447942690947009470114211002110901010000101000001050526042091654062323290001706564054999911596220002569220311630445429307002641542131030000116727011870115700957011470114
4167970112525000000002180300000700794101023461256051506435157545127576213151284101496701470087701168911347115622127608424526448841343794489626875870094701172110021109010100001010000010509404422189574115923250101734763993999911568220002559221661936454720227001940403131030000116717011570114701147011770095
416867009452500000000219260000070079011112491126115153245512914712787122515157650149670337008770111932134111559312746846154944947134127448782681767011370116211002110901010000101000001050636042269188405442327800167356402599991158762120258122163143245673123700194078001030000116657011770119701117011570117
4168970094525000000002175820000700984092403125925132844514944012719222015121961149670337006670094946134301562812777040968144930134490448912689567011070114211002110901010000101000011050826002188814106723270101761263901999911561321002530221841519455122337002041392131030000116727011470114701177011770117
41686701185250101000122182178100070879389244912601515924451532401275222281514052014967031700937011893413387156871271934207614484213406744759269118701167011421100211090101000010100000105083104208925405092321210168546359199991154512120255022192142144262233700324041413030000116747011970114701127011470095
4168670113525000001002137500000701010101024061256351509455159144127558225151528301496703370066701139431349015685127624429682449041344124488926896270094700942110021109010100001010000010506890009132407732344514285456431899991158750122252021943113244322833700234053513030000116677011470114700957011270117
416927011952500000000215230000070095310924101262651329415143641127257220151393201496703370068700949181339415664127323486741449481342384480926915470113700942110021109010100001010000010507710422189084110723262001710464092999911574221002518218801529449121327003241412131030000116767011470114701147011770120
416877011752511000000221061400007010161702420126185140943514644012756723015149530149670217009670125977133231568712769050971044916134502449112689687011770120211002110901010000101000001050896002189604094323258001745164179999911539821002515221871420466520267002240173131330000116667011570112701157011170095
41687701115250000000022000000007010338824511260051351405131950127345231151820601496703870087700949821340115611127593516655447961344664490826830870113700942110021109010100001010000010508070422191824119223256001727663884999911570120202537218851431450033377000640580131330000116667011170114701147011370111