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

CASLH

Test 1: uops

Code:

  caslh 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)mmu table walk instruction (07)l2 tlb miss instruction (0a)0e0f1e22243a3f464951schedule 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)l1d 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)a9acafatomic or exclusive succ (b3)atomic or exclusive fail (b4)bbl1d cache miss ld nonspec (bf)l1d cache miss st nonspec (c0)cfd0d1d2l1i cache miss demand (d3)l1i tlb miss demand (d4)d5map dispatch bubble (d6)d9dadbddfetch restart (de)dfe0eaebec? ldst retires (ed)? int retires (ef)f5f6f7f8fd
740093407026514401100300536633883002201930033006300922936414931001336263407072630001002300610006018339832769217100110001000300322100220060013006999101215129106550798035723662372136134444144948333095192541648117317300010013399234117340943410334090
740053412725503500100710533533917002204730063009300622855514930972336373409782730031002300610016018339822704217100110001000300643100320042003006999101014944108270804835501492377635924440194854333009192701650717855300010013405034081341483399634118
7400533991255063001002005324338680022089300330033006229086149309713364234081826300310023006100260123399827212171001100010003003421001200250033006999101015071106740798535771452374235674435114455333081190161662117723300010013411734141341113410634165
74005340112560250010030053163394301219733003300330092294931493100433761339927253006100230031003600634021275721710011000100030034210022004201593003999101215150106820801836073512385535734445185757333011189181655917635300010013410734069340993405334059
740043406225506400100100537633859102211330033006300622965314930911336803414672530061002300310016012340142719217100110001000300663100120062013006999111015194107500802136023472374635624443145059332978189471648417744300010013401934123340623397434215
740053417425604310100200535034104002208230033003300322890414931055337293415872530001000300310026006341102738217100110001000300022100020024003000999100215186106560800635913512386535894453215349333102188941644817574300010013408334117341213396634129
740053403725504200100300536433912002203430093006300322814404930954335973403372530061002300610016000339282733217100110001000300643100220041013006999101215035106210797435643572392035864441155651333042188061624817515300010013420434131340473411134081
740053413925523600100010534733910002209130063009300622862504931053336243408071030061001300610026000340362759217100110001000300623100220041003009999100215097107250806135943442376236764438195354332984189541639917458300010013410033973341353409234186
740053404325523100106700536933953002194530063006300622838014931021336973410672630091002300610026012340072765217100110001000300302100120041043006999101215103106870799535795582378136454438144950333069190341655317373300010013406834065340153407034091
740053423925615500100010532533939002198130063006300622916214931039336823405672430061001300310026012341032733217100110001000300622100120041013000999101215024106490798735761582376335614436135653333046187311648717533300010003415434112340823406334077

Test 2: throughput

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 7.0065

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk data (08)l2 tlb miss data (0b)0f181e1f2022233a3e3f404346494f51schedule 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)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
502087006552400001506542410141270050330121247172254010010100300001010030000505533315441149669857003370065596483600474010020313300002020060000700657411202011009910010000101001000001003006503479136661005920008542034323007399982021235320071310117116990910000131030000201007007570068700667007770066
5020470065525000005080350108070053360121147070254010010100300001010030000505533315462049669857003370065596603600344010020200300002020060000700657311202011009910010000101001000001003008413265139721006320012251022473010099982135248321141310117116991210000131030000201007008670080700697006970069
5020470052525000105076220108767005965116134729325401001010030000101003000050555331494614966985700367006559661360047401002020030000202006000070065731120201100991001000010100100000100300530326713674100492001325600453007699982121256320011310117116990910000101030000201007007670077700667006670066
5020470052525101005083336100127005029116134728325401001010030000101003000050555331400314966985700337006559660360047401002020030000202006000070052731120201100991001000010100100000100300783336613904100822001316202437300679998212605032111131011711698961000010030000201007007570066700697006970066
5020470068524000005061248100070050281131346534254010010100300001010030000505533314767149669857002070053596603600474010020200300002020060000700527011202011009910010000101001000001003006003856136101007020003046034363006999982019030320001310117116991210000101030000201007007570066700667006970053
50204700685250000050573361000700502812084772925402591010030000101003000050553331486514966985700337006559661360047401002020030000202006000070052741120201100991001000010100100000100300450387913369100602000333306383006699982130232380001310117116991210000101030000201007007570066700697005370066
502047006852500000504823110007005037113134671325401001010030000101003000050553331483414966985700337005259648360034401002020030000202006000070068731120201100991001000010100100000100300720376314053100452000304602844300679998212203300001310117116991210000131030000201007008870069700537006970069
5020470068524000005060238100207005035113134808625401001010030000101003000050555331494614966988700337011759664360047401002020030000202006000070068741120201100991001000010100100001100300790326313720100812000407600483007399982125236320001310117116991110000131030000201007007570069700697006670069
502047006852500000504923210007005325113144797125401001010030000101003000050553331400314966988700367006559664360047401002020030000202006000070065731120202100991001000010100100000100300650327114053100632000833603430300599998212534900011310117116990910000101030000201007007570077700667006870066
502047005252500010506923610060700372811216470562540100101003000010100300005055533140031496698570020700655966436004740100202003000020200600007006874112020110099100100001010010000010030058033601383210059200023410040300869998212124832001131011711699101000001030000201007007870066700667006670066

1000 unrolls and 10 iterations

Result (median cycles for code): 7.0061

retire uop (01)cycle (02)03l1d tlb fill (05)mmu table walk data (08)l2 tlb miss data (0b)0e0f1e1f20222324293a3e3f404346494f51schedule 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)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)c2c3branch cond mispred nonspec (c5)branch mispred nonspec (cb)cfd0d5map dispatch bubble (d6)dbddfetch restart (de)e0? int output thing (e9)eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
5002870065524000005058228000004700503831115469292540010100103000010010300005010333149591496698870033700655966136004740010200203000020020600007006574112002110901010000100101000001030053032501370310064200052580363830067999821322463200000127003170236989610000101030000200107007070066700667006670066
500247006552500000509722810000070050312121447070254001010010300001001030153501033314538149669857003370065596643600474001020020300002002060000700657311200211090101000010010100000103004603268138551006420015151042463007599982124235320000012703217022699091000010030000200107006670066700667006670113
500247006755700000506523610000070050312111347017254001010010301051001030000501033314833149669857003370065596603600504001020020300002002060000700657411200211090101000010010100000103006103274136761007320004051064530081999821252393200000127002170226990910000101030000200107006870066700667006670066
5002470065525000005070250100002870052303131447337254001010010300001001030000501033314898149669857003370065596613600474001020020300002002060000700677311200211090101000010010100000103003903268138761007920002239028343008499982125244320000012700217022699091000010030000200107006670069700667006670066
5002470065524000005060337100000700503331213473372540010100103000010010300005010333154141496698570033700655964836004740010200203017420020600007006573112002110901010000100101000001030065032601373810074200066500423630082999821292463200000127002170326990910000101030000200107006670077700667006670066
500247006552400200506524300000070050443121547158254001010010300001001030000501033314542149669857003370052596613600474001020020300002002060000700657411200211090101000010010100000103006003292136971008120003262066630066999821392803200000127002170226990910000101030000200107009070066700667006670066
5002470065525000005064245100000700504331515467582540010100103000010010300005010333148291496698570033700655966136004740010200203000020020600007006873112002110901010000100101000001030037033721397210069200032440484430098999821272423200400127002170226990910000101030000200107006770066700667006670066
5002470065524000005046341100000700504331313478302540010100103000010010300005010333155851496698570033700655966436004740010200203000020020600007006574112002110901010000100101000001030059032651375710084200041520464130085999821302453200000127002170226990910000101030000200107006670066700667006670066
5002470065525000005073244100000700503631916474082540010100103000010010300005010333153471496698570033700655966136004740010200203000020020600007006574112002110901010000100101000001030020123274138551003820002200061300389998212424900040012700217022699091000001030000200107006970066700667006670066
500247006552500000510200000003270050163141547530254001010010300001001030000501033315347149669887003670065596623600474001020020300002002060000700657411200211090101000010010100000103005903262137401008220014576003630065999821302463200000127002170226990910000101030000200107006870078700667006670066

Test 3: throughput

Code:

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

(fused SUBS/B.cc loop)

100 unrolls and 100 iterations

Result (median cycles for code): 7.0104

retire uop (01)cycle (02)03mmu table walk instruction (07)mmu table walk data (08)l2 tlb miss instruction (0a)0e0f1e1f22233a3f4346494f51schedule 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 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)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
418327011552500000149352000701012677230105344378242743653344113397207616799421104967033700877011347501204524131110760768912318411851210444155224541870108701082110201100991001000010010000110042371036191123227125213120097364784299991763714023130115212281933300425257001633182131030000116437011470095701117009570109
41729701115250001015033210187009628773331237444361384426033991114671911170555411049670337007270112583012001213701132508273122334228212472541900249630701097010821102011009910010000100100001100428480019113652823421330009370497879999179772102903125212201725304021700263396201030000116667011370108701117011170109
4188170111525000001559520018700920046776104334380327542367395112427203017162981124967027700857011254171271122904110283883112132425451237294153025113670117701082110201100991001000010010000010042320042181084027951213960098894865199991897421229691162143018273449343870019350318030000116037011270117701117011570109
41755701135250000014105200147009335063931034044413310437863951130561836173278411049670147008970113704312051237041110128901128604094312313841437234972700947009521102011009910010000100100000100425680361910932276172112400980248537999918642002311411420915110232093229700033389013030000116487011270095701147011570111
4172670094525000011422420022700802077805110364402543544074378109100210416987391104967014700847011862831224622700111539885711911419971221094242524544870110701122110201100991001000010010000010040653000112732815321574029946487819999184272123102113214621027347342347002634012131030000116657011270095701147011170114
41713701145250000014276200177009620972371067343109367428204151130632050174021411049670317006870094597111973222761115568093115124237412562842767247464701117010721102011009910010000100100000100416890023111242893120622009671511439999185090002994025212251142536762528700233496013030000116077011870095701127009570095
4175470109525000001469420019700961076728997642723372423543761100121990172609211049670147008970113582211882235391127078240120554162512248741068245922701107011621102011009910010000100100000100426570422211577290152144000964250590999917908212307711221229003734133534700283517201330000116377011870111701097009570112
417067010754301000149592001700791507211104934335039642780403113407181816940731104967026700837009460511231725125112718853512566403481232674211624128470117701032110201100991001000010010000010041884028131119728351214180094214941299991902321229171132259004236442370023342329930000116737010870105701057009570118
4171070111526001001439420017008910877471043544501370433954021116321944174552711049670147007870106582111964236721096438685123504115312024340057243954701077010621102011009910010000100100000100406550016113332714921612001004551403999918045012307211421474010313195293470023354100630000116597009570105701117010770110
417977010452510100144450001700891777083102554496139143250340108292203617082301104967024700767010658771206123809111491901612220426781240623998224722470106701042110201100991001000010010000010041461034151190828003211100094264885499991814320230721132154208223273292770009350206630000116497009570095700957009570105

1000 unrolls and 10 iterations

Result (median cycles for code): 7.0113

retire uop (01)cycle (02)03mmu table walk data (08)090e0f18191e1f2223243a3f4346494f51schedule 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)e0e2e7? int output thing (e9)eaeb? ldst retires (ed)? int retires (ef)f5f6f7f8fd
416917011452500010022275200007007940823411256051651405158643127837200151781101496703870070701188851350615410127885450575449421345054493026906470094701182110021109010100001010000010506500422191644039423310001653563938999911582701202511220050224486223370036413240101030000116737009570095700957009570095
41687701185250000002157701000700964101023651253351511405152840127384205151468301496701470070701109911345815549128062479615449031342234489826842270118701182110021109010100001010000010507030360916440834233140017126640339999115788002025082197914284437333170032402430131030000116797011470114701157011470114
4168170113525000000217132000070098008235912543516404151519421278322431516225014967031700707009491313434154701279094525984496213453844957268560704567011221100211090101000010100000105080803621914740668233081016828641229999115938212024992206015274410212970025413220131030000116777011570120701117012070176
4169370113525000000216162000070099491024121258351522415156641127642216151839601496703970086701199491333015428128037439628450101346434495926938270094701142110021109010100001010000010508760422191544087923296001721064238999911585221202531219701931447425337001741403001030000116797011470120701117012070111
416847011352500010021709210007009329824001263251611415160946127848222151617601496701470095701199901332615604127659490645448961347154498026886070112701182110021109010100001010000010510410422191384108123316001767264287999911596820002562221371225424931317000041390001030000116767009670095701197012070115
416797011352500000022055200007007938025231257751343445156749127367203151397101496703670070701139661333915681127491478641448261345624487226937670118701182110021109010100001010000010509060422688894107723310001736064153999911573200202514219150274402243370029401750131030000116737011470095701147011770117
416857011652500000021534200007010400102416125465158040514674412779720115153200149670397006870095940133761558812790146166544971134544449412690407011170118211002110901010000101000001050893042228930409652323200170596376699991156102120253122190031461332207002941402001330000116737011570095701207009570113
41685701115250000002213620000701024107237012590515474351541461277072401516747014967014700857009490913420156681277234467084490713433744944268812701197012021100211090101000010100000105080704221914940809232780016956641859999115920212025592189103144382133700024039200030000116667011970120701147011470118
41687701135250000002216920000701020100253112641516514051295431274292001520097014967031700857009494513349158121272465457244479513448444878268836701117011421100211090101000010100000105085504221893840872232001016988636469999115984012025312206202443873030700034140400030000116747011570095701197011470118
41680701105250000002241920000700954100244512578512894151444501271692111512385014967014700687011399913351155211276614737454490313467944963268746701197011821100211090101000010100001105076100091804075323278001736264048999911579001202523218251230446821307002141220001030000116777012070095701147011970118