Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghc/ghc
  • bgamari/ghc
  • syd/ghc
  • ggreif/ghc
  • watashi/ghc
  • RolandSenn/ghc
  • mpickering/ghc
  • DavidEichmann/ghc
  • carter/ghc
  • harpocrates/ghc
  • ethercrow/ghc
  • mijicd/ghc
  • adamse/ghc
  • alexbiehl/ghc
  • gridaphobe/ghc
  • trofi/ghc
  • supersven/ghc
  • ppk/ghc
  • ulysses4ever/ghc
  • AndreasK/ghc
  • ghuntley/ghc
  • shayne-fletcher-da/ghc
  • fgaz/ghc
  • yav/ghc
  • osa1/ghc
  • mbbx6spp/ghc
  • JulianLeviston/ghc
  • reactormonk/ghc
  • rae/ghc
  • takenobu-hs/ghc
  • michalt/ghc
  • andrewthad/ghc
  • hsyl20/ghc
  • scottgw/ghc
  • sjakobi/ghc
  • angerman/ghc
  • RyanGlScott/ghc
  • hvr/ghc
  • howtonotwin/ghc
  • chessai/ghc
  • m-renaud/ghc
  • brprice/ghc
  • stevehartdata/ghc
  • sighingnow/ghc
  • kgardas/ghc
  • ckoparkar/ghc
  • alp/ghc
  • smaeul/ghc
  • kakkun61/ghc
  • sykloid/ghc
  • newhoggy/ghc
  • toonn/ghc
  • nineonine/ghc
  • Phyx/ghc
  • ezyang/ghc
  • tweag/ghc
  • langston/ghc
  • ndmitchell/ghc
  • rockbmb/ghc
  • artempyanykh/ghc
  • mniip/ghc
  • mynguyenbmc/ghc
  • alexfmpe/ghc
  • crockeea/ghc
  • nh2/ghc
  • vaibhavsagar/ghc
  • phadej/ghc
  • Haskell-mouse/ghc
  • lolotp/ghc
  • spacekitteh/ghc
  • michaelpj/ghc
  • mgsloan/ghc
  • HPCohen/ghc
  • tmobile/ghc
  • radrow/ghc
  • simonmar/ghc
  • _deepfire/ghc
  • Ericson2314/ghc
  • leitao/ghc
  • fumieval/ghc
  • trac-isovector/ghc
  • cblp/ghc
  • xich/ghc
  • ciil/ghc
  • erthalion/ghc
  • xldenis/ghc
  • autotaker/ghc
  • haskell-wasm/ghc
  • kcsongor/ghc
  • agander/ghc
  • Baranowski/ghc
  • trac-dredozubov/ghc
  • 23Skidoo/ghc
  • iustin/ghc
  • ningning/ghc
  • josefs/ghc
  • kabuhr/ghc
  • gallais/ghc
  • dten/ghc
  • expipiplus1/ghc
  • Pluralia/ghc
  • rohanjr/ghc
  • intricate/ghc
  • kirelagin/ghc
  • Javran/ghc
  • DanielG/ghc
  • trac-mizunashi_mana/ghc
  • pparkkin/ghc
  • bollu/ghc
  • ntc2/ghc
  • jaspervdj/ghc
  • JoshMeredith/ghc
  • wz1000/ghc
  • zkourouma/ghc
  • code5hot/ghc
  • jdprice/ghc
  • tdammers/ghc
  • J-mie6/ghc
  • trac-lantti/ghc
  • ch1bo/ghc
  • cgohla/ghc
  • lucamolteni/ghc
  • acairncross/ghc
  • amerocu/ghc
  • chreekat/ghc
  • txsmith/ghc
  • trupill/ghc
  • typetetris/ghc
  • sergv/ghc
  • fryguybob/ghc
  • erikd/ghc
  • trac-roland/ghc
  • setupminimal/ghc
  • Friede80/ghc
  • SkyWriter/ghc
  • xplorld/ghc
  • abrar/ghc
  • obsidiansystems/ghc
  • Icelandjack/ghc
  • adinapoli/ghc
  • trac-matthewbauer/ghc
  • heatsink/ghc
  • dwijnand/ghc
  • Cmdv/ghc
  • alinab/ghc
  • pepeiborra/ghc
  • fommil/ghc
  • luochen1990/ghc
  • rlupton20/ghc
  • applePrincess/ghc
  • lehins/ghc
  • ronmrdechai/ghc
  • leeadam/ghc
  • harendra/ghc
  • mightymosquito1991/ghc
  • trac-gershomb/ghc
  • lucajulian/ghc
  • Rizary/ghc
  • VictorCMiraldo/ghc
  • jamesbrock/ghc
  • andrewdmeier/ghc
  • luke/ghc
  • pranaysashank/ghc
  • cocreature/ghc
  • hithroc/ghc
  • obreitwi/ghc
  • slrtbtfs/ghc
  • kaol/ghc
  • yairchu/ghc
  • Mathemagician98/ghc
  • trac-taylorfausak/ghc
  • leungbk/ghc
  • MichaWiedenmann/ghc
  • chris-martin/ghc
  • TDecki/ghc
  • adithyaov/ghc
  • trac-gelisam/ghc
  • Lysxia/ghc
  • complyue/ghc
  • bwignall/ghc
  • sternmull/ghc
  • sonika/ghc
  • leif/ghc
  • broadwaylamb/ghc
  • myszon/ghc
  • danbroooks/ghc
  • Mechachleopteryx/ghc
  • zardyh/ghc
  • trac-vdukhovni/ghc
  • OmarKhaledAbdo/ghc
  • arrowd/ghc
  • Bodigrim/ghc
  • matheus23/ghc
  • cardenaso11/ghc
  • trac-Athas/ghc
  • mb720/ghc
  • DylanZA/ghc
  • liff/ghc
  • typedrat/ghc
  • trac-claude/ghc
  • jbm/ghc
  • Gertjan423/ghc
  • PHO/ghc
  • JKTKops/ghc
  • kockahonza/ghc
  • msakai/ghc
  • Sir4ur0n/ghc
  • barambani/ghc
  • vishnu.c/ghc
  • dcoutts/ghc
  • trac-runeks/ghc
  • trac-MaxGabriel/ghc
  • lexi.lambda/ghc
  • strake/ghc
  • spavikevik/ghc
  • JakobBruenker/ghc
  • rmanne/ghc
  • gdziadkiewicz/ghc
  • ani/ghc
  • iliastsi/ghc
  • smunix/ghc
  • judah/ghc
  • blackgnezdo/ghc
  • emilypi/ghc
  • trac-bpfoley/ghc
  • muesli4/ghc
  • trac-gkaracha/ghc
  • Kleidukos/ghc
  • nek0/ghc
  • TristanCacqueray/ghc
  • dwulive/ghc
  • mbakke/ghc
  • arybczak/ghc
  • Yang123321/ghc
  • maksbotan/ghc
  • QuietMisdreavus/ghc
  • trac-olshanskydr/ghc
  • emekoi/ghc
  • samuela/ghc
  • josephcsible/ghc
  • dramforever/ghc
  • lpsmith/ghc
  • DenisFrezzato/ghc
  • michivi/ghc
  • jneira/ghc
  • jeffhappily/ghc
  • Ivan-Yudin/ghc
  • nakaji-dayo/ghc
  • gdevanla/ghc
  • galen/ghc
  • fendor/ghc
  • yaitskov/ghc
  • rcythr/ghc
  • awpr/ghc
  • jeremyschlatter/ghc
  • Aver1y/ghc
  • mitchellvitez/ghc
  • merijn/ghc
  • tomjaguarpaw1/ghc
  • trac-NoidedSuper/ghc
  • erewok/ghc
  • trac-junji.hashimoto/ghc
  • adamwespiser/ghc
  • bjaress/ghc
  • jhrcek/ghc
  • leonschoorl/ghc
  • lukasz-golebiewski/ghc
  • sheaf/ghc
  • last-g/ghc
  • carassius1014/ghc
  • eschwartz/ghc
  • dwincort/ghc
  • felixwiemuth/ghc
  • TimWSpence/ghc
  • marcusmonteirodesouza/ghc
  • WJWH/ghc
  • vtols/ghc
  • theobat/ghc
  • BinderDavid/ghc
  • ckoparkar0/ghc
  • alexander-kjeldaas/ghc
  • dme2/ghc
  • philderbeast/ghc
  • aaronallen8455/ghc
  • rayshih/ghc
  • benkard/ghc
  • mpardalos/ghc
  • saidelman/ghc
  • leiftw/ghc
  • ca333/ghc
  • bwroga/ghc
  • nmichael44/ghc
  • trac-crobbins/ghc
  • felixonmars/ghc
  • adityagupta1089/ghc
  • hgsipiere/ghc
  • treeowl/ghc
  • alexpeits/ghc
  • CraigFe/ghc
  • dnlkrgr/ghc
  • kerckhove_ts/ghc
  • cptwunderlich/ghc
  • eiais/ghc
  • hahohihu/ghc
  • sanchayan/ghc
  • lemmih/ghc
  • sehqlr/ghc
  • trac-dbeacham/ghc
  • luite/ghc
  • trac-f-a/ghc
  • vados/ghc
  • luntain/ghc
  • fatho/ghc
  • alexbiehl-gc/ghc
  • dcbdan/ghc
  • tvh/ghc
  • liam-ly/ghc
  • timbobbarnes/ghc
  • GovanifY/ghc
  • shanth2600/ghc
  • gliboc/ghc
  • duog/ghc
  • moxonsghost/ghc
  • zander/ghc
  • masaeedu/ghc
  • georgefst/ghc
  • guibou/ghc
  • nicuveo/ghc
  • mdebruijne/ghc
  • stjordanis/ghc
  • emiflake/ghc
  • wygulmage/ghc
  • frasertweedale/ghc
  • coot/ghc
  • aratamizuki/ghc
  • tsandstr/ghc
  • mrBliss/ghc
  • Anton-Latukha/ghc
  • tadfisher/ghc
  • vapourismo/ghc
  • Sorokin-Anton/ghc
  • basile-henry/ghc
  • trac-mightybyte/ghc
  • AbsoluteNikola/ghc
  • cobrien99/ghc
  • songzh/ghc
  • blamario/ghc
  • aj4ayushjain/ghc
  • trac-utdemir/ghc
  • tangcl/ghc
  • hdgarrood/ghc
  • maerwald/ghc
  • arjun/ghc
  • ratherforky/ghc
  • haskieLambda/ghc
  • EmilGedda/ghc
  • Bogicevic/ghc
  • eddiejessup/ghc
  • kozross/ghc
  • AlistairB/ghc
  • 3Rafal/ghc
  • christiaanb/ghc
  • trac-bit/ghc
  • matsumonkie/ghc
  • trac-parsonsmatt/ghc
  • chisui/ghc
  • jaro/ghc
  • trac-kmiyazato/ghc
  • davidsd/ghc
  • Tritlo/ghc
  • I-B-3/ghc
  • lykahb/ghc
  • AriFordsham/ghc
  • turion1/ghc
  • berberman/ghc
  • christiantakle/ghc
  • zyklotomic/ghc
  • trac-ocramz/ghc
  • CSEdd/ghc
  • doyougnu/ghc
  • mmhat/ghc
  • why-not-try-calmer/ghc
  • plutotulp/ghc
  • kjekac/ghc
  • Manvi07/ghc
  • teo/ghc
  • cactus/ghc
  • CarrieMY/ghc
  • abel/ghc
  • yihming/ghc
  • tsakki/ghc
  • jessicah/ghc
  • oliverbunting/ghc
  • meld/ghc
  • friedbrice/ghc
  • Joald/ghc
  • abarbu/ghc
  • DigitalBrains1/ghc
  • sterni/ghc
  • alexDarcy/ghc
  • hexchain/ghc
  • minimario/ghc
  • zliu41/ghc
  • tommd/ghc
  • jazcarate/ghc
  • peterbecich/ghc
  • alirezaghey/ghc
  • solomon/ghc
  • mikael.urankar/ghc
  • davjam/ghc
  • int-index/ghc
  • MorrowM/ghc
  • nrnrnr/ghc
  • Sonfamm/ghc-test-only
  • afzt1/ghc
  • nguyenhaibinh-tpc/ghc
  • trac-lierdakil/ghc
  • MichaWiedenmann1/ghc
  • jmorag/ghc
  • Ziharrk/ghc
  • trac-MitchellSalad/ghc
  • juampe/ghc
  • jwaldmann/ghc
  • snowleopard/ghc
  • juhp/ghc
  • normalcoder/ghc
  • ksqsf/ghc
  • trac-jberryman/ghc
  • roberth/ghc
  • 1ntEgr8/ghc
  • epworth/ghc
  • MrAdityaAlok/ghc
  • JunmingZhao42/ghc
  • jappeace/ghc
  • trac-Gabriel439/ghc
  • alt-romes/ghc
  • HugoPeters1024/ghc
  • 10ne1/ghc-fork
  • agentultra/ghc
  • Garfield1002/ghc
  • ChickenProp/ghc
  • clyring/ghc
  • MaxHearnden/ghc
  • jumper149/ghc
  • vem/ghc
  • ketzacoatl/ghc
  • Rosuavio/ghc
  • jackohughes/ghc
  • p4l1ly/ghc
  • konsumlamm/ghc
  • shlevy/ghc
  • torsten.schmits/ghc
  • andremarianiello/ghc
  • amesgen/ghc
  • googleson78/ghc
  • InfiniteVerma/ghc
  • uhbif19/ghc
  • yiyunliu/ghc
  • raehik/ghc
  • mrkun/ghc
  • telser/ghc
  • 1Jajen1/ghc
  • slotThe/ghc
  • WinstonHartnett/ghc
  • mpilgrem/ghc
  • dreamsmasher/ghc
  • schuelermine/ghc
  • trac-Viwor/ghc
  • undergroundquizscene/ghc
  • evertedsphere/ghc
  • coltenwebb/ghc
  • oberblastmeister/ghc
  • agrue/ghc
  • lf-/ghc
  • zacwood9/ghc
  • steshaw/ghc
  • high-cloud/ghc
  • SkamDart/ghc
  • PiDelport/ghc
  • maoif/ghc
  • RossPaterson/ghc
  • CharlesTaylor7/ghc
  • ribosomerocker/ghc
  • trac-ramirez7/ghc
  • daig/ghc
  • NicolasT/ghc
  • FinleyMcIlwaine/ghc
  • lawtonnichols/ghc
  • jmtd/ghc
  • ozkutuk/ghc
  • wildsebastian/ghc
  • nikshalark/ghc
  • lrzlin/ghc
  • tobias/ghc
  • fw/ghc
  • hawkinsw/ghc
  • type-dance/ghc
  • rui314/ghc
  • ocharles/ghc
  • wavewave/ghc
  • TheKK/ghc
  • nomeata/ghc
  • trac-csabahruska/ghc
  • jonathanjameswatson/ghc
  • L-as/ghc
  • Axman6/ghc
  • barracuda156/ghc
  • trac-jship/ghc
  • jake-87/ghc
  • meooow/ghc
  • rebeccat/ghc
  • hamana55/ghc
  • Enigmage/ghc
  • kokobd/ghc
  • agevelt/ghc
  • gshen42/ghc
  • chrismwendt/ghc
  • MangoIV/ghc
  • teto/ghc
  • Sookr1/ghc
  • trac-thomasjm/ghc
  • barci2/ghc-dev
  • trac-m4dc4p/ghc
  • dixonary/ghc
  • breakerzirconia/ghc
  • alexsio27444/ghc
  • glocq/ghc
  • sourabhxyz/ghc
  • ryantrinkle/ghc
  • Jade/ghc
  • scedfaliako/ghc
  • martijnbastiaan/ghc
  • trac-george.colpitts/ghc
  • ammarbinfaisal/ghc
  • mimi.vx/ghc
  • lortabac/ghc
  • trac-zyla/ghc
  • benbellick/ghc
  • aadaa-fgtaa/ghc
  • jvanbruegge/ghc
  • archbung/ghc
  • gilmi/ghc
  • mfonism/ghc
  • alex-mckenna/ghc
  • Ei30metry/ghc
  • DiegoDiverio/ghc
  • jorgecunhamendes/ghc
  • liesnikov/ghc
  • akrmn/ghc
  • trac-simplifierticks/ghc
  • jacco/ghc
  • rhendric/ghc
  • damhiya/ghc
  • ryndubei/ghc
  • DaveBarton/ghc
  • trac-Profpatsch/ghc
  • GZGavinZhao/ghc
  • ncfavier/ghc
  • jameshaydon/ghc
  • ajccosta/ghc
  • dschrempf/ghc
  • cydparser/ghc
  • LinuxUserGD/ghc
  • elodielander/ghc
  • facundominguez/ghc
  • psilospore/ghc
  • lachrimae/ghc
  • dylan-thinnes/ghc-type-errors-plugin
  • hamishmack/ghc
  • Leary/ghc
  • lzszt/ghc
  • lyokha/ghc
  • trac-glaubitz/ghc
  • Rewbert/ghc
  • andreabedini/ghc
  • Jasagredo/ghc
  • sol/ghc
  • OlegAlexander/ghc
  • trac-sthibaul/ghc
  • avdv/ghc
  • Wendaolee/ghc
  • ur4t/ghc
  • daylily/ghc
  • boltzmannrain/ghc
  • mmzk1526/ghc
  • trac-fizzixnerd/ghc
  • soulomoon/ghc
  • rwmjones/ghc
  • j14i/ghc
  • tracsis/ghc
  • gesh/ghc
  • flip101/ghc
  • eldritch-cookie/ghc
  • LemonjamesD/ghc
  • pgujjula/ghc
  • skeuchel/ghc
  • noteed/ghc
  • gulin.serge/ghc
  • Torrekie/ghc
  • jlwoodwa/ghc
  • ayanamists/ghc
  • husong998/ghc
  • trac-edmundnoble/ghc
  • josephf/ghc
  • contrun/ghc
  • baulig/ghc
  • edsko/ghc
  • mzschr/ghc-issue-24732
  • ulidtko/ghc
  • Arsen/ghc
  • trac-sjoerd_visscher/ghc
  • crumbtoo/ghc
  • L0neGamer/ghc
  • DrewFenwick/ghc
  • benz0li/ghc
  • MaciejWas/ghc
  • jordanrule/ghc
  • trac-qqwy/ghc
  • LiamGoodacre/ghc
  • isomorpheme/ghc
  • trac-danidiaz/ghc
  • Kariim/ghc
  • MTaimoorZaeem/ghc
  • hololeap/ghc
  • ticat-fp/ghc
  • meritamen/ghc
  • criskell/ghc
  • trac-kraai/ghc
  • aergus/ghc
  • jdral/ghc
  • SamB/ghc
  • Tristian/ghc
  • ywgrit/ghc
  • KatsuPatrick/ghc
  • OsePedro/ghc
  • mpscholten/ghc
  • fp/ghc
  • zaquest/ghc
  • fangyi-zhou/ghc
  • augyg/ghc
640 results
Show changes
Commits on Source (33)
Showing
with 249 additions and 470 deletions
......@@ -153,6 +153,7 @@ data BuildConfig
, threadSanitiser :: Bool
, noSplitSections :: Bool
, validateNonmovingGc :: Bool
, textWithSIMDUTF :: Bool
}
-- Extra arguments to pass to ./configure due to the BuildConfig
......@@ -174,7 +175,8 @@ mkJobFlavour BuildConfig{..} = Flavour buildFlavour opts
[FullyStatic | fullyStatic] ++
[ThreadSanitiser | threadSanitiser] ++
[NoSplitSections | noSplitSections, buildFlavour == Release ] ++
[BootNonmovingGc | validateNonmovingGc ]
[BootNonmovingGc | validateNonmovingGc ] ++
[TextWithSIMDUTF | textWithSIMDUTF]
data Flavour = Flavour BaseFlavour [FlavourTrans]
......@@ -185,6 +187,7 @@ data FlavourTrans =
| ThreadSanitiser
| NoSplitSections
| BootNonmovingGc
| TextWithSIMDUTF
data BaseFlavour = Release | Validate | SlowValidate deriving Eq
......@@ -211,6 +214,7 @@ vanilla = BuildConfig
, threadSanitiser = False
, noSplitSections = False
, validateNonmovingGc = False
, textWithSIMDUTF = False
}
splitSectionsBroken :: BuildConfig -> BuildConfig
......@@ -344,6 +348,7 @@ flavourString (Flavour base trans) = base_string base ++ concatMap (("+" ++) . f
flavour_string ThreadSanitiser = "thread_sanitizer_cmm"
flavour_string NoSplitSections = "no_split_sections"
flavour_string BootNonmovingGc = "boot_nonmoving_gc"
flavour_string TextWithSIMDUTF = "text_simdutf"
-- The path to the docker image (just for linux builders)
dockerImage :: Arch -> Opsys -> Maybe String
......@@ -1057,6 +1062,7 @@ job_groups =
{
fullyStatic = True
, buildFlavour = Release -- TODO: This needs to be validate but wasm backend doesn't pass yet
, textWithSIMDUTF = True
}
......@@ -1082,10 +1088,10 @@ platform_mapping = Map.map go combined_result
, "x86_64-linux-fedora33-release"
, "x86_64-linux-deb11-cross_aarch64-linux-gnu-validate"
, "x86_64-windows-validate"
, "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static"
, "nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf"
, "nightly-x86_64-linux-deb11-validate"
, "nightly-x86_64-linux-deb12-validate"
, "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static"
, "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf"
, "x86_64-linux-deb12-validate+thread_sanitizer_cmm"
, "nightly-aarch64-linux-deb10-validate"
, "nightly-x86_64-linux-alpine3_12-validate"
......
......@@ -951,7 +951,7 @@
"XZ_OPT": "-9"
}
},
"nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static": {
"nightly-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf": {
"after_script": [
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
......@@ -962,7 +962,7 @@
"artifacts": {
"expire_in": "8 weeks",
"paths": [
"ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static.tar.xz",
"ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz",
"junit.xml",
"unexpected-test-output.tar.gz"
],
......@@ -1005,17 +1005,17 @@
],
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+fully_static+text_simdutf",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf",
"XZ_OPT": "-9"
}
},
"nightly-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static": {
"nightly-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf": {
"after_script": [
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
......@@ -1026,7 +1026,7 @@
"artifacts": {
"expire_in": "8 weeks",
"paths": [
"ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static.tar.xz",
"ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz",
"junit.xml",
"unexpected-test-output.tar.gz"
],
......@@ -1069,17 +1069,17 @@
],
"variables": {
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+fully_static+text_simdutf",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf",
"XZ_OPT": "-9"
}
},
"nightly-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static": {
"nightly-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf": {
"after_script": [
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
......@@ -1090,7 +1090,7 @@
"artifacts": {
"expire_in": "8 weeks",
"paths": [
"ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static.tar.xz",
"ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz",
"junit.xml",
"unexpected-test-output.tar.gz"
],
......@@ -1133,13 +1133,13 @@
],
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+fully_static+text_simdutf",
"CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf",
"XZ_OPT": "-9"
}
},
......@@ -4465,7 +4465,7 @@
"TEST_ENV": "x86_64-linux-alpine3_12-validate+fully_static"
}
},
"x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static": {
"x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf": {
"after_script": [
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
......@@ -4476,7 +4476,7 @@
"artifacts": {
"expire_in": "2 weeks",
"paths": [
"ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static.tar.xz",
"ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz",
"junit.xml",
"unexpected-test-output.tar.gz"
],
......@@ -4519,16 +4519,16 @@
],
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+fully_static+text_simdutf",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static"
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-cross_wasm32-wasi-release+fully_static+text_simdutf"
}
},
"x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static": {
"x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf": {
"after_script": [
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
......@@ -4539,7 +4539,7 @@
"artifacts": {
"expire_in": "2 weeks",
"paths": [
"ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static.tar.xz",
"ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz",
"junit.xml",
"unexpected-test-output.tar.gz"
],
......@@ -4583,16 +4583,16 @@
],
"variables": {
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+fully_static+text_simdutf",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static"
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-int_native-cross_wasm32-wasi-release+fully_static+text_simdutf"
}
},
"x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static": {
"x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf": {
"after_script": [
".gitlab/ci.sh save_cache",
".gitlab/ci.sh save_test_output",
......@@ -4603,7 +4603,7 @@
"artifacts": {
"expire_in": "2 weeks",
"paths": [
"ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static.tar.xz",
"ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf.tar.xz",
"junit.xml",
"unexpected-test-output.tar.gz"
],
......@@ -4647,13 +4647,13 @@
],
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static",
"BUILD_FLAVOUR": "release+fully_static",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf",
"BUILD_FLAVOUR": "release+fully_static+text_simdutf",
"CONFIGURE_ARGS": "--enable-unregisterised --with-intree-gmp --with-system-libffi --enable-strict-ghc-toolchain-check",
"CROSS_TARGET": "wasm32-wasi",
"HADRIAN_ARGS": "--docs=none",
"RUNTEST_ARGS": "",
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static"
"TEST_ENV": "x86_64-linux-alpine3_18-wasm-unreg-cross_wasm32-wasi-release+fully_static+text_simdutf"
}
},
"x86_64-linux-deb10-int_native-validate": {
......
......@@ -60,6 +60,7 @@
/libraries/base/ @hvr
/libraries/ghci/ @simonmar
/libraries/template-haskell/ @rae
/testsuite/tests/interface-stability/ @core-libraries
[Internal utilities and libraries]
/utils/iserv-proxy/ @angerman @simonmar
......
......@@ -1659,11 +1659,7 @@ pprDynamicLinkerAsmLabel !platform dllInfo ppLbl =
GotSymbolPtr -> ppLbl <> text "@GOTPCREL"
GotSymbolOffset -> ppLbl
| platformArch platform == ArchAArch64 -> ppLbl
| otherwise ->
case dllInfo of
CodeStub -> char 'L' <> ppLbl <> text "$stub"
SymbolPtr -> char 'L' <> ppLbl <> text "$non_lazy_ptr"
_ -> panic "pprDynamicLinkerAsmLabel"
| otherwise -> panic "pprDynamicLinkerAsmLabel"
OSAIX ->
case dllInfo of
......
......@@ -92,7 +92,7 @@ cmmMachOpFoldM _ op [CmmLit (CmmInt x rep)]
MO_SF_Round _frm to -> CmmLit (CmmFloat (fromInteger x) to)
MO_SS_Conv from to -> CmmLit (CmmInt (narrowS from x) to)
MO_UU_Conv from to -> CmmLit (CmmInt (narrowU from x) to)
MO_XX_Conv from to -> CmmLit (CmmInt (narrowS from x) to)
MO_XX_Conv from to -> CmmLit (CmmInt (narrowU from x) to)
_ -> panic $ "cmmMachOpFoldM: unknown unary op: " ++ show op
......
......@@ -1757,6 +1757,137 @@ genCCall target dest_regs arg_regs bid = do
truncateReg W64 w lo
, Nothing)
| otherwise -> unsupported (MO_U_Mul2 w)
PrimTarget (MO_Clz w)
| w == W64 || w == W32
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst_reg = getRegisterReg platform (CmmLocal dst)
return (
code_x `snocOL`
CLZ (OpReg w dst_reg) (OpReg w reg_a)
, Nothing)
| w == W16
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst' = getRegisterReg platform (CmmLocal dst)
r n = OpReg W32 n
imm n = OpImm (ImmInt n)
{- dst = clz(x << 16 | 0x0000_8000) -}
return (
code_x `appOL` toOL
[ LSL (r dst') (r reg_a) (imm 16)
, ORR (r dst') (r dst') (imm 0x00008000)
, CLZ (r dst') (r dst')
]
, Nothing)
| w == W8
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst' = getRegisterReg platform (CmmLocal dst)
r n = OpReg W32 n
imm n = OpImm (ImmInt n)
{- dst = clz(x << 24 | 0x0080_0000) -}
return (
code_x `appOL` toOL
[ LSL (r dst') (r reg_a) (imm 24)
, ORR (r dst') (r dst') (imm 0x00800000)
, CLZ (r dst') (r dst')
]
, Nothing)
| otherwise -> unsupported (MO_Clz w)
PrimTarget (MO_Ctz w)
| w == W64 || w == W32
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst_reg = getRegisterReg platform (CmmLocal dst)
return (
code_x `snocOL`
RBIT (OpReg w dst_reg) (OpReg w reg_a) `snocOL`
CLZ (OpReg w dst_reg) (OpReg w dst_reg)
, Nothing)
| w == W16
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst' = getRegisterReg platform (CmmLocal dst)
r n = OpReg W32 n
imm n = OpImm (ImmInt n)
{- dst = clz(reverseBits(x) | 0x0000_8000) -}
return (
code_x `appOL` toOL
[ RBIT (r dst') (r reg_a)
, ORR (r dst') (r dst') (imm 0x00008000)
, CLZ (r dst') (r dst')
]
, Nothing)
| w == W8
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst' = getRegisterReg platform (CmmLocal dst)
r n = OpReg W32 n
imm n = OpImm (ImmInt n)
{- dst = clz(reverseBits(x) | 0x0080_0000) -}
return (
code_x `appOL` toOL
[ RBIT (r dst') (r reg_a)
, ORR (r dst') (r dst') (imm 0x00800000)
, CLZ (r dst') (r dst')
]
, Nothing)
| otherwise -> unsupported (MO_Ctz w)
PrimTarget (MO_BRev w)
| w == W64 || w == W32
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst_reg = getRegisterReg platform (CmmLocal dst)
return (
code_x `snocOL`
RBIT (OpReg w dst_reg) (OpReg w reg_a)
, Nothing)
| w == W16
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst' = getRegisterReg platform (CmmLocal dst)
r n = OpReg W32 n
imm n = OpImm (ImmInt n)
{- dst = reverseBits32(x << 16) -}
return (
code_x `appOL` toOL
[ LSL (r dst') (r reg_a) (imm 16)
, RBIT (r dst') (r dst')
]
, Nothing)
| w == W8
, [src] <- arg_regs
, [dst] <- dest_regs
-> do
(reg_a, _format_x, code_x) <- getSomeReg src
let dst' = getRegisterReg platform (CmmLocal dst)
r n = OpReg W32 n
imm n = OpImm (ImmInt n)
{- dst = reverseBits32(x << 24) -}
return (
code_x `appOL` toOL
[ LSL (r dst') (r reg_a) (imm 24)
, RBIT (r dst') (r dst')
]
, Nothing)
| otherwise -> unsupported (MO_BRev w)
-- or a possibly side-effecting machine operation
......@@ -1883,10 +2014,7 @@ genCCall target dest_regs arg_regs bid = do
MO_PopCnt w -> mkCCall (popCntLabel w)
MO_Pdep w -> mkCCall (pdepLabel w)
MO_Pext w -> mkCCall (pextLabel w)
MO_Clz w -> mkCCall (clzLabel w)
MO_Ctz w -> mkCCall (ctzLabel w)
MO_BSwap w -> mkCCall (bSwapLabel w)
MO_BRev w -> mkCCall (bRevLabel w)
-- -- Atomic read-modify-write.
MO_AtomicRead w ord
......
......@@ -100,6 +100,8 @@ regUsageOfInstr platform instr = case instr of
UXTB dst src -> usage (regOp src, regOp dst)
SXTH dst src -> usage (regOp src, regOp dst)
UXTH dst src -> usage (regOp src, regOp dst)
CLZ dst src -> usage (regOp src, regOp dst)
RBIT dst src -> usage (regOp src, regOp dst)
-- 3. Logical and Move Instructions ------------------------------------------
AND dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst)
ASR dst src1 src2 -> usage (regOp src1 ++ regOp src2, regOp dst)
......@@ -140,7 +142,8 @@ regUsageOfInstr platform instr = case instr of
FMA _ dst src1 src2 src3 ->
usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst)
_ -> panic $ "regUsageOfInstr: " ++ instrCon instr
LOCATION{} -> panic $ "regUsageOfInstr: " ++ instrCon instr
NEWBLOCK{} -> panic $ "regUsageOfInstr: " ++ instrCon instr
where
-- filtering the usage is necessary, otherwise the register
......@@ -234,6 +237,8 @@ patchRegsOfInstr instr env = case instr of
UXTB o1 o2 -> UXTB (patchOp o1) (patchOp o2)
SXTH o1 o2 -> SXTH (patchOp o1) (patchOp o2)
UXTH o1 o2 -> UXTH (patchOp o1) (patchOp o2)
CLZ o1 o2 -> CLZ (patchOp o1) (patchOp o2)
RBIT o1 o2 -> RBIT (patchOp o1) (patchOp o2)
-- 3. Logical and Move Instructions ----------------------------------------
AND o1 o2 o3 -> AND (patchOp o1) (patchOp o2) (patchOp o3)
......@@ -276,7 +281,8 @@ patchRegsOfInstr instr env = case instr of
FMA s o1 o2 o3 o4 ->
FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4)
_ -> panic $ "patchRegsOfInstr: " ++ instrCon instr
NEWBLOCK{} -> panic $ "patchRegsOfInstr: " ++ instrCon instr
LOCATION{} -> panic $ "patchRegsOfInstr: " ++ instrCon instr
where
patchOp :: Operand -> Operand
patchOp (OpReg w r) = OpReg w (env r)
......@@ -591,6 +597,8 @@ data Instr
-- Signed/Unsigned bitfield extract
| SBFX Operand Operand Operand Operand -- rd = rn[i,j]
| UBFX Operand Operand Operand Operand -- rd = rn[i,j]
| CLZ Operand Operand -- rd = countLeadingZeros(rn)
| RBIT Operand Operand -- rd = reverseBits(rn)
-- 3. Logical and Move Instructions ----------------------------------------
| AND Operand Operand Operand -- rd = rn & op2
......@@ -676,6 +684,8 @@ instrCon i =
UBFM{} -> "UBFM"
SBFX{} -> "SBFX"
UBFX{} -> "UBFX"
CLZ{} -> "CLZ"
RBIT{} -> "RBIT"
AND{} -> "AND"
ASR{} -> "ASR"
EOR{} -> "EOR"
......
......@@ -396,6 +396,8 @@ pprInstr platform instr = case instr of
-- 2. Bit Manipulation Instructions ------------------------------------------
SBFM o1 o2 o3 o4 -> op4 (text "\tsbfm") o1 o2 o3 o4
UBFM o1 o2 o3 o4 -> op4 (text "\tubfm") o1 o2 o3 o4
CLZ o1 o2 -> op2 (text "\tclz") o1 o2
RBIT o1 o2 -> op2 (text "\trbit") o1 o2
-- signed and unsigned bitfield extract
SBFX o1 o2 o3 o4 -> op4 (text "\tsbfx") o1 o2 o3 o4
UBFX o1 o2 o3 o4 -> op4 (text "\tubfx") o1 o2 o3 o4
......
......@@ -303,25 +303,15 @@ howToAccessLabel config arch OSDarwin DataReference lbl
| otherwise
= AccessDirectly
howToAccessLabel config arch OSDarwin JumpReference lbl
howToAccessLabel config _ OSDarwin JumpReference lbl
-- dyld code stubs don't work for tailcalls because the
-- stack alignment is only right for regular calls.
-- Therefore, we have to go via a symbol pointer:
| arch == ArchX86 || arch == ArchX86_64 || arch == ArchAArch64
, ncgLabelDynamic config lbl
| ncgLabelDynamic config lbl
= AccessViaSymbolPtr
howToAccessLabel config arch OSDarwin _kind lbl
-- Code stubs are the usual method of choice for imported code;
-- not needed on x86_64 because Apple's new linker, ld64, generates
-- them automatically, neither on Aarch64 (arm64).
| arch /= ArchX86_64
, arch /= ArchAArch64
, ncgLabelDynamic config lbl
= AccessViaStub
| otherwise
howToAccessLabel _ _ OSDarwin _ _
= AccessDirectly
----------------------------------------------------------------------------
......@@ -534,16 +524,6 @@ gotLabel
-- However, for PIC on x86, we need a small helper function.
pprGotDeclaration :: NCGConfig -> HDoc
pprGotDeclaration config = case (arch,os) of
(ArchX86, OSDarwin)
| ncgPIC config
-> lines_ [
text ".section __TEXT,__textcoal_nt,coalesced,no_toc",
text ".weak_definition ___i686.get_pc_thunk.ax",
text ".private_extern ___i686.get_pc_thunk.ax",
text "___i686.get_pc_thunk.ax:",
text "\tmovl (%esp), %eax",
text "\tret" ]
(_, OSDarwin) -> empty
-- Emit XCOFF TOC section
......@@ -597,59 +577,6 @@ pprGotDeclaration config = case (arch,os) of
pprImportedSymbol :: NCGConfig -> CLabel -> HDoc
pprImportedSymbol config importedLbl = case (arch,os) of
(ArchX86, OSDarwin)
| Just (CodeStub, lbl) <- dynamicLinkerLabelInfo importedLbl
-> if not pic
then
lines_ [
text ".symbol_stub",
text "L" <> ppr_lbl lbl <> text "$stub:",
text "\t.indirect_symbol" <+> ppr_lbl lbl,
text "\tjmp *L" <> ppr_lbl lbl
<> text "$lazy_ptr",
text "L" <> ppr_lbl lbl
<> text "$stub_binder:",
text "\tpushl $L" <> ppr_lbl lbl
<> text "$lazy_ptr",
text "\tjmp dyld_stub_binding_helper"
]
else
lines_ [
text ".section __TEXT,__picsymbolstub2,"
<> text "symbol_stubs,pure_instructions,25",
text "L" <> ppr_lbl lbl <> text "$stub:",
text "\t.indirect_symbol" <+> ppr_lbl lbl,
text "\tcall ___i686.get_pc_thunk.ax",
text "1:",
text "\tmovl L" <> ppr_lbl lbl
<> text "$lazy_ptr-1b(%eax),%edx",
text "\tjmp *%edx",
text "L" <> ppr_lbl lbl
<> text "$stub_binder:",
text "\tlea L" <> ppr_lbl lbl
<> text "$lazy_ptr-1b(%eax),%eax",
text "\tpushl %eax",
text "\tjmp dyld_stub_binding_helper"
]
$$ lines_ [
text ".section __DATA, __la_sym_ptr"
<> (if pic then int 2 else int 3)
<> text ",lazy_symbol_pointers",
text "L" <> ppr_lbl lbl <> text "$lazy_ptr:",
text "\t.indirect_symbol" <+> ppr_lbl lbl,
text "\t.long L" <> ppr_lbl lbl
<> text "$stub_binder"]
| Just (SymbolPtr, lbl) <- dynamicLinkerLabelInfo importedLbl
-> lines_ [
text ".non_lazy_symbol_pointer",
char 'L' <> ppr_lbl lbl <> text "$non_lazy_ptr:",
text "\t.indirect_symbol" <+> ppr_lbl lbl,
text "\t.long\t0"]
| otherwise
-> empty
(ArchAArch64, OSDarwin)
-> empty
......@@ -734,7 +661,6 @@ pprImportedSymbol config importedLbl = case (arch,os) of
ppr_lbl = pprAsmLabel platform
arch = platformArch platform
os = platformOS platform
pic = ncgPIC config
--------------------------------------------------------------------------------
-- Generate code to calculate the address that should be put in the
......@@ -840,11 +766,11 @@ initializePicBase_ppc _ _ _ _
-- (See PprMach.hs)
initializePicBase_x86
:: Arch -> OS -> Reg
:: OS -> Reg
-> [NatCmmDecl (Alignment, RawCmmStatics) X86.Instr]
-> NatM [NatCmmDecl (Alignment, RawCmmStatics) X86.Instr]
initializePicBase_x86 ArchX86 os picReg
initializePicBase_x86 os picReg
(CmmProc info lab live (ListGraph blocks) : statics)
| osElfTarget os
= return (CmmProc info lab live (ListGraph blocks') : statics)
......@@ -862,12 +788,12 @@ initializePicBase_x86 ArchX86 os picReg
fetchGOT (BasicBlock bID insns) =
BasicBlock bID (X86.FETCHGOT picReg : insns)
initializePicBase_x86 ArchX86 OSDarwin picReg
initializePicBase_x86 OSDarwin picReg
(CmmProc info lab live (ListGraph (entry:blocks)) : statics)
= return (CmmProc info lab live (ListGraph (block':blocks)) : statics)
where BasicBlock bID insns = entry
block' = BasicBlock bID (X86.FETCHPC picReg : insns)
initializePicBase_x86 _ _ _ _
initializePicBase_x86 _ _ _
= panic "initializePicBase_x86: not needed"
......@@ -94,12 +94,6 @@ is32BitPlatform = do
platform <- getPlatform
return $ target32Bit platform
expect32BitPlatform :: SDoc -> NatM ()
expect32BitPlatform doc = do
is32Bit <- is32BitPlatform
when (not is32Bit) $
pprPanic "Expecting 32-bit platform" doc
sse2Enabled :: NatM Bool
sse2Enabled = do
config <- getConfig
......@@ -124,7 +118,7 @@ cmmTopCodeGen (CmmProc info lab live graph) = do
os = platformOS platform
case picBaseMb of
Just picBase -> initializePicBase_x86 ArchX86 os picBase tops
Just picBase -> initializePicBase_x86 os picBase tops
Nothing -> return tops
cmmTopCodeGen (CmmData sec dat) =
......@@ -2475,35 +2469,10 @@ genSimplePrim bid MO_F64_Acosh [dst] [src] = genLibCCall bid
genSimplePrim bid MO_F64_Atanh [dst] [src] = genLibCCall bid (fsLit "atanh") [dst] [src]
genSimplePrim bid MO_SuspendThread [tok] [rs,i] = genRTSCCall bid (fsLit "suspendThread") [tok] [rs,i]
genSimplePrim bid MO_ResumeThread [rs] [tok] = genRTSCCall bid (fsLit "resumeThread") [rs] [tok]
genSimplePrim _ MO_I64_ToI [dst] [src] = genInt64ToInt dst src
genSimplePrim _ MO_I64_FromI [dst] [src] = genIntToInt64 dst src
genSimplePrim _ MO_W64_ToW [dst] [src] = genWord64ToWord dst src
genSimplePrim _ MO_W64_FromW [dst] [src] = genWordToWord64 dst src
genSimplePrim _ MO_x64_Neg [dst] [src] = genNeg64 dst src
genSimplePrim _ MO_x64_Add [dst] [x,y] = genAdd64 dst x y
genSimplePrim _ MO_x64_Sub [dst] [x,y] = genSub64 dst x y
genSimplePrim bid MO_x64_Mul [dst] [x,y] = genPrimCCall bid (fsLit "hs_mul64") [dst] [x,y]
genSimplePrim bid MO_I64_Quot [dst] [x,y] = genPrimCCall bid (fsLit "hs_quotInt64") [dst] [x,y]
genSimplePrim bid MO_I64_Rem [dst] [x,y] = genPrimCCall bid (fsLit "hs_remInt64") [dst] [x,y]
genSimplePrim bid MO_W64_Quot [dst] [x,y] = genPrimCCall bid (fsLit "hs_quotWord64") [dst] [x,y]
genSimplePrim bid MO_W64_Rem [dst] [x,y] = genPrimCCall bid (fsLit "hs_remWord64") [dst] [x,y]
genSimplePrim _ MO_x64_And [dst] [x,y] = genAnd64 dst x y
genSimplePrim _ MO_x64_Or [dst] [x,y] = genOr64 dst x y
genSimplePrim _ MO_x64_Xor [dst] [x,y] = genXor64 dst x y
genSimplePrim _ MO_x64_Not [dst] [src] = genNot64 dst src
genSimplePrim bid MO_x64_Shl [dst] [x,n] = genPrimCCall bid (fsLit "hs_uncheckedShiftL64") [dst] [x,n]
genSimplePrim bid MO_I64_Shr [dst] [x,n] = genPrimCCall bid (fsLit "hs_uncheckedIShiftRA64") [dst] [x,n]
genSimplePrim bid MO_W64_Shr [dst] [x,n] = genPrimCCall bid (fsLit "hs_uncheckedShiftRL64") [dst] [x,n]
genSimplePrim _ MO_x64_Eq [dst] [x,y] = genEq64 dst x y
genSimplePrim _ MO_x64_Ne [dst] [x,y] = genNe64 dst x y
genSimplePrim _ MO_I64_Ge [dst] [x,y] = genGeInt64 dst x y
genSimplePrim _ MO_I64_Gt [dst] [x,y] = genGtInt64 dst x y
genSimplePrim _ MO_I64_Le [dst] [x,y] = genLeInt64 dst x y
genSimplePrim _ MO_I64_Lt [dst] [x,y] = genLtInt64 dst x y
genSimplePrim _ MO_W64_Ge [dst] [x,y] = genGeWord64 dst x y
genSimplePrim _ MO_W64_Gt [dst] [x,y] = genGtWord64 dst x y
genSimplePrim _ MO_W64_Le [dst] [x,y] = genLeWord64 dst x y
genSimplePrim _ MO_W64_Lt [dst] [x,y] = genLtWord64 dst x y
genSimplePrim _ op dst args = do
platform <- ncgPlatform <$> getConfig
pprPanic "genSimplePrim: unhandled primop" (ppr (pprCallishMachOp op, dst, fmap (pdoc platform) args))
......@@ -4462,231 +4431,3 @@ genQuotRem width signed res_q res_r m_arg_x_high arg_x_low arg_y = do
toOL [instr format y_reg,
MOV format (OpReg rax) (OpReg reg_q),
MOV format (OpReg rdx) (OpReg reg_r)]
----------------------------------------------------------------------------
-- The following functions implement certain 64-bit MachOps inline for 32-bit
-- architectures. On 64-bit architectures, those MachOps aren't supported and
-- calling these functions for a 64-bit target platform is considered an error
-- (hence the use of `expect32BitPlatform`).
--
-- On 64-bit platforms, generic MachOps should be used instead of these 64-bit
-- specific ones (e.g. use MO_Add instead of MO_x64_Add). This MachOp selection
-- is done by StgToCmm.
genInt64ToInt :: LocalReg -> CmmExpr -> NatM InstrBlock
genInt64ToInt dst src = do
expect32BitPlatform (text "genInt64ToInt")
RegCode64 code _src_hi src_lo <- iselExpr64 src
let dst_r = getLocalRegReg dst
pure $ code `snocOL` MOV II32 (OpReg src_lo) (OpReg dst_r)
genWord64ToWord :: LocalReg -> CmmExpr -> NatM InstrBlock
genWord64ToWord dst src = do
expect32BitPlatform (text "genWord64ToWord")
RegCode64 code _src_hi src_lo <- iselExpr64 src
let dst_r = getLocalRegReg dst
pure $ code `snocOL` MOV II32 (OpReg src_lo) (OpReg dst_r)
genIntToInt64 :: LocalReg -> CmmExpr -> NatM InstrBlock
genIntToInt64 dst src = do
expect32BitPlatform (text "genIntToInt64")
let Reg64 dst_hi dst_lo = localReg64 dst
src_code <- getAnyReg src
pure $ src_code rax `appOL` toOL
[ CLTD II32 -- sign extend EAX in EDX:EAX
, MOV II32 (OpReg rax) (OpReg dst_lo)
, MOV II32 (OpReg rdx) (OpReg dst_hi)
]
genWordToWord64 :: LocalReg -> CmmExpr -> NatM InstrBlock
genWordToWord64 dst src = do
expect32BitPlatform (text "genWordToWord64")
let Reg64 dst_hi dst_lo = localReg64 dst
src_code <- getAnyReg src
pure $ src_code dst_lo
`snocOL` XOR II32 (OpReg dst_hi) (OpReg dst_hi)
genNeg64 :: LocalReg -> CmmExpr -> NatM InstrBlock
genNeg64 dst src = do
expect32BitPlatform (text "genNeg64")
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 code src_hi src_lo <- iselExpr64 src
pure $ code `appOL` toOL
[ MOV II32 (OpReg src_lo) (OpReg dst_lo)
, MOV II32 (OpReg src_hi) (OpReg dst_hi)
, NEGI II32 (OpReg dst_lo)
, ADC II32 (OpImm (ImmInt 0)) (OpReg dst_hi)
, NEGI II32 (OpReg dst_hi)
]
genAdd64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genAdd64 dst x y = do
expect32BitPlatform (text "genAdd64")
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 x_code x_hi x_lo <- iselExpr64 x
RegCode64 y_code y_hi y_lo <- iselExpr64 y
pure $ x_code `appOL` y_code `appOL` toOL
[ MOV II32 (OpReg x_lo) (OpReg dst_lo)
, MOV II32 (OpReg x_hi) (OpReg dst_hi)
, ADD II32 (OpReg y_lo) (OpReg dst_lo)
, ADC II32 (OpReg y_hi) (OpReg dst_hi)
]
genSub64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genSub64 dst x y = do
expect32BitPlatform (text "genSub64")
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 x_code x_hi x_lo <- iselExpr64 x
RegCode64 y_code y_hi y_lo <- iselExpr64 y
pure $ x_code `appOL` y_code `appOL` toOL
[ MOV II32 (OpReg x_lo) (OpReg dst_lo)
, MOV II32 (OpReg x_hi) (OpReg dst_hi)
, SUB II32 (OpReg y_lo) (OpReg dst_lo)
, SBB II32 (OpReg y_hi) (OpReg dst_hi)
]
genAnd64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genAnd64 dst x y = do
expect32BitPlatform (text "genAnd64")
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 x_code x_hi x_lo <- iselExpr64 x
RegCode64 y_code y_hi y_lo <- iselExpr64 y
pure $ x_code `appOL` y_code `appOL` toOL
[ MOV II32 (OpReg x_lo) (OpReg dst_lo)
, MOV II32 (OpReg x_hi) (OpReg dst_hi)
, AND II32 (OpReg y_lo) (OpReg dst_lo)
, AND II32 (OpReg y_hi) (OpReg dst_hi)
]
genOr64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genOr64 dst x y = do
expect32BitPlatform (text "genOr64")
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 x_code x_hi x_lo <- iselExpr64 x
RegCode64 y_code y_hi y_lo <- iselExpr64 y
pure $ x_code `appOL` y_code `appOL` toOL
[ MOV II32 (OpReg x_lo) (OpReg dst_lo)
, MOV II32 (OpReg x_hi) (OpReg dst_hi)
, OR II32 (OpReg y_lo) (OpReg dst_lo)
, OR II32 (OpReg y_hi) (OpReg dst_hi)
]
genXor64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genXor64 dst x y = do
expect32BitPlatform (text "genXor64")
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 x_code x_hi x_lo <- iselExpr64 x
RegCode64 y_code y_hi y_lo <- iselExpr64 y
pure $ x_code `appOL` y_code `appOL` toOL
[ MOV II32 (OpReg x_lo) (OpReg dst_lo)
, MOV II32 (OpReg x_hi) (OpReg dst_hi)
, XOR II32 (OpReg y_lo) (OpReg dst_lo)
, XOR II32 (OpReg y_hi) (OpReg dst_hi)
]
genNot64 :: LocalReg -> CmmExpr -> NatM InstrBlock
genNot64 dst src = do
expect32BitPlatform (text "genNot64")
let Reg64 dst_hi dst_lo = localReg64 dst
RegCode64 src_code src_hi src_lo <- iselExpr64 src
pure $ src_code `appOL` toOL
[ MOV II32 (OpReg src_lo) (OpReg dst_lo)
, MOV II32 (OpReg src_hi) (OpReg dst_hi)
, NOT II32 (OpReg dst_lo)
, NOT II32 (OpReg dst_hi)
]
genEq64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genEq64 dst x y = do
expect32BitPlatform (text "genEq64")
let dst_r = getLocalRegReg dst
RegCode64 x_code x_hi x_lo <- iselExpr64 x
RegCode64 y_code y_hi y_lo <- iselExpr64 y
Reg64 tmp_hi tmp_lo <- getNewReg64
pure $ x_code `appOL` y_code `appOL` toOL
[ MOV II32 (OpReg x_lo) (OpReg tmp_lo)
, MOV II32 (OpReg x_hi) (OpReg tmp_hi)
, XOR II32 (OpReg y_lo) (OpReg tmp_lo)
, XOR II32 (OpReg y_hi) (OpReg tmp_hi)
, OR II32 (OpReg tmp_lo) (OpReg tmp_hi)
, SETCC EQQ (OpReg dst_r)
, MOVZxL II8 (OpReg dst_r) (OpReg dst_r)
]
genNe64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genNe64 dst x y = do
expect32BitPlatform (text "genNe64")
let dst_r = getLocalRegReg dst
RegCode64 x_code x_hi x_lo <- iselExpr64 x
RegCode64 y_code y_hi y_lo <- iselExpr64 y
Reg64 tmp_hi tmp_lo <- getNewReg64
pure $ x_code `appOL` y_code `appOL` toOL
[ MOV II32 (OpReg x_lo) (OpReg tmp_lo)
, MOV II32 (OpReg x_hi) (OpReg tmp_hi)
, XOR II32 (OpReg y_lo) (OpReg tmp_lo)
, XOR II32 (OpReg y_hi) (OpReg tmp_hi)
, OR II32 (OpReg tmp_lo) (OpReg tmp_hi)
, SETCC NE (OpReg dst_r)
, MOVZxL II8 (OpReg dst_r) (OpReg dst_r)
]
genGtWord64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genGtWord64 dst x y = do
expect32BitPlatform (text "genGtWord64")
genPred64 LU dst y x
genLtWord64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genLtWord64 dst x y = do
expect32BitPlatform (text "genLtWord64")
genPred64 LU dst x y
genGeWord64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genGeWord64 dst x y = do
expect32BitPlatform (text "genGeWord64")
genPred64 GEU dst x y
genLeWord64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genLeWord64 dst x y = do
expect32BitPlatform (text "genLeWord64")
genPred64 GEU dst y x
genGtInt64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genGtInt64 dst x y = do
expect32BitPlatform (text "genGtInt64")
genPred64 LTT dst y x
genLtInt64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genLtInt64 dst x y = do
expect32BitPlatform (text "genLtInt64")
genPred64 LTT dst x y
genGeInt64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genGeInt64 dst x y = do
expect32BitPlatform (text "genGeInt64")
genPred64 GE dst x y
genLeInt64 :: LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genLeInt64 dst x y = do
expect32BitPlatform (text "genLeInt64")
genPred64 GE dst y x
genPred64 :: Cond -> LocalReg -> CmmExpr -> CmmExpr -> NatM InstrBlock
genPred64 cond dst x y = do
-- we can only rely on CF/SF/OF flags!
-- Not on ZF, which doesn't take into account the lower parts.
massert (cond `elem` [LU,GEU,LTT,GE])
let dst_r = getLocalRegReg dst
RegCode64 x_code x_hi x_lo <- iselExpr64 x
RegCode64 y_code y_hi y_lo <- iselExpr64 y
-- Basically we perform a subtraction with borrow.
-- As we don't need to result, we can use CMP instead of SUB for the low part
-- (it sets the borrow flag just like SUB does)
pure $ x_code `appOL` y_code `appOL` toOL
[ MOV II32 (OpReg x_hi) (OpReg dst_r)
, CMP II32 (OpReg y_lo) (OpReg x_lo)
, SBB II32 (OpReg y_hi) (OpReg dst_r)
, SETCC cond (OpReg dst_r)
, MOVZxL II8 (OpReg dst_r) (OpReg dst_r)
]
......@@ -198,10 +198,13 @@ data Instr
-- Moves.
| MOV Format Operand Operand
-- ^ N.B. when used with the 'II64' 'Format', the source
-- ^ N.B. Due to AT&T assembler quirks, when used with 'II64'
-- 'Format' immediate source and memory target operand, the source
-- operand is interpreted to be a 32-bit sign-extended value.
-- True 64-bit operands need to be moved with @MOVABS@, which we
-- currently don't use.
-- True 64-bit operands need to be either first moved to a register or moved
-- with @MOVABS@; we currently do not use this instruction in GHC.
-- See https://stackoverflow.com/questions/52434073/whats-the-difference-between-the-x86-64-att-instructions-movq-and-movabsq.
| MOVD Format Operand Operand -- ^ MOVD/MOVQ SSE2 instructions
-- (bitcast between a general purpose
-- register and a float register).
......@@ -883,7 +886,6 @@ needs_probe_call :: Platform -> Int -> Bool
needs_probe_call platform amount
= case platformOS platform of
OSMinGW32 -> case platformArch platform of
ArchX86 -> amount > (4 * 1024)
ArchX86_64 -> amount > (4 * 1024)
_ -> False
_ -> False
......@@ -913,15 +915,6 @@ mkStackAllocInstr platform amount
-- function dropping the stack more than a page.
-- See Note [Windows stack layout]
case platformArch platform of
ArchX86 | needs_probe_call platform amount ->
[ MOV II32 (OpImm (ImmInt amount)) (OpReg eax)
, CALL (Left $ strImmLit (fsLit "___chkstk_ms")) [eax]
, SUB II32 (OpReg eax) (OpReg esp)
]
| otherwise ->
[ SUB II32 (OpImm (ImmInt amount)) (OpReg esp)
, TEST II32 (OpReg esp) (OpReg esp)
]
ArchX86_64 | needs_probe_call platform amount ->
[ MOV II64 (OpImm (ImmInt amount)) (OpReg rax)
, CALL (Left $ strImmLit (fsLit "___chkstk_ms")) [rax]
......
......@@ -24,15 +24,10 @@ initCmmConfig dflags = CmmConfig
, cmmDoCmmSwitchPlans = not (backendHasNativeSwitch (backend dflags))
, cmmSplitProcPoints = not (backendSupportsUnsplitProcPoints (backend dflags))
|| not (platformTablesNextToCode platform)
|| usingInconsistentPicReg
, cmmAllowMul2 = (ncg && x86ish) || llvm
, cmmOptConstDivision = not llvm
}
where platform = targetPlatform dflags
usingInconsistentPicReg =
case (platformArch platform, platformOS platform, positionIndependent dflags)
of (ArchX86, OSDarwin, pic) -> pic
_ -> False
-- Copied from StgToCmm
(ncg, llvm) = case backendPrimitiveImplementation (backend dflags) of
GenericPrimitives -> (False, False)
......
......@@ -53,9 +53,12 @@ initStgToCmmConfig dflags mod = StgToCmmConfig
, stgToCmmExtDynRefs = gopt Opt_ExternalDynamicRefs dflags
, stgToCmmDoBoundsCheck = gopt Opt_DoBoundsChecking dflags
, stgToCmmDoTagCheck = gopt Opt_DoTagInferenceChecks dflags
-- backend flags
, stgToCmmAllowBigArith = not ncg || platformArch platform == ArchWasm32 || platformArch platform == ArchX86
, stgToCmmAllowBigQuot = not ncg || platformArch platform == ArchWasm32
-- backend flags:
-- LLVM, C, and some 32-bit NCG backends can also handle some 64-bit primops
, stgToCmmAllowArith64 = w64 || not ncg || platformArch platform == ArchWasm32 || platformArch platform == ArchX86
, stgToCmmAllowQuot64 = w64 || not ncg || platformArch platform == ArchWasm32
, stgToCmmAllowQuotRemInstr = ncg && (x86ish || ppc)
, stgToCmmAllowQuotRem2 = (ncg && (x86ish || ppc)) || llvm
, stgToCmmAllowExtendedAddSubInstrs = (ncg && (x86ish || ppc)) || llvm
......@@ -90,6 +93,7 @@ initStgToCmmConfig dflags mod = StgToCmmConfig
} where profile = targetProfile dflags
platform = profilePlatform profile
bk_end = backend dflags
w64 = platformWordSize platform == PW8
b_blob = if not ncg then Nothing else binBlobThreshold dflags
(ncg, llvm) = case backendPrimitiveImplementation bk_end of
GenericPrimitives -> (False, False)
......
......@@ -60,10 +60,6 @@ module GHC.Driver.DynFlags (
versionedAppDir, versionedFilePath,
extraGccViaCFlags, globalPackageDatabasePath,
-- * Linker/compiler information
LinkerInfo(..),
CompilerInfo(..),
-- * Include specifications
IncludeSpecs(..), addGlobalInclude, addQuoteInclude, flattenIncludes,
addImplicitQuoteInclude,
......@@ -758,31 +754,6 @@ data ParMakeCount
-- | Use the specific semaphore @<sem>@ to control parallelism (@-jsem <sem>@ flag).
| ParMakeSemaphore FilePath
-- -----------------------------------------------------------------------------
-- Linker/compiler information
-- LinkerInfo contains any extra options needed by the system linker.
data LinkerInfo
= GnuLD [Option]
| Mold [Option]
| GnuGold [Option]
| LlvmLLD [Option]
| DarwinLD [Option]
| SolarisLD [Option]
| AixLD [Option]
| UnknownLD
deriving Eq
-- CompilerInfo tells us which C compiler we're using
data CompilerInfo
= GCC
| Clang
| AppleClang
| AppleClang51
| Emscripten
| UnknownCC
deriving Eq
-- | The 'GhcMode' tells us whether we're doing multi-module
-- compilation (controlled via the "GHC" API) or one-shot
-- (single-module) compilation. This makes a difference primarily to
......
......@@ -215,8 +215,6 @@ module GHC.Driver.Session (
isFmaEnabled,
-- * Linker/compiler information
LinkerInfo(..),
CompilerInfo(..),
useXLinkerRPath,
-- * Include specifications
......
......@@ -34,25 +34,29 @@
module GHC.JS.Ident
( Ident(..)
, global
, name
) where
import Prelude
import GHC.Prelude
import GHC.Data.FastString
import GHC.Types.Unique
import GHC.Utils.Outputable
--------------------------------------------------------------------------------
-- Identifiers
--------------------------------------------------------------------------------
-- We use FastString for identifiers in JS backend
-- | A newtype wrapper around 'FastString' for JS identifiers.
newtype Ident = TxtI { identFS :: FastString }
deriving stock (Show, Eq)
deriving newtype (Uniquable)
deriving newtype (Uniquable, Outputable)
-- | A not-so-smart constructor for @Ident@s, used to indicate that this name is
-- expected to be top-level
global :: FastString -> Ident
global = TxtI
-- | To give a thing a name is to have power over it. This smart constructor
-- serves two purposes: first, it isolates the JS backend from the rest of GHC.
-- The backend should not explicitly use types provided by GHC but instead
-- should wrap them such as we do here. Second it creates a symbol in the JS
-- backend, but it does not yet give that symbols meaning. Giving the symbol
-- meaning only occurs once it is used with a combinator from @GHC.JS.Make@.
name :: FastString -> Ident
name = TxtI
......@@ -92,7 +92,7 @@ newIdent = do env <- get
return $ mk_ident tag id
mk_ident :: FastString -> Unique -> Ident
mk_ident t i = global (mconcat [t, "_", mkFastString (show i)])
mk_ident t i = name (mconcat [t, "_", mkFastString (show i)])
-- | Set the tag for @Ident@s for all remaining computations.
tag_names :: FastString -> JSM ()
......
......@@ -28,6 +28,10 @@
-- is written in. Nothing fancy, its just a straightforward deeply embedded
-- DSL.
--
-- In general, one should not use these constructors explicitly in the JS
-- backend. Instead, prefer using the combinators in GHC.JS.Make, if those
-- are suitable then prefer using the patterns exported from this module
-----------------------------------------------------------------------------
module GHC.JS.JStg.Syntax
( -- * Deeply embedded JS datatypes
......@@ -63,7 +67,8 @@ module GHC.JS.JStg.Syntax
-- * Utility
, SaneDouble(..)
, pattern Func
, var
, global
, local
) where
import GHC.Prelude
......@@ -233,7 +238,6 @@ pattern LOr x y = InfixExpr LOrOp x y
pattern LAnd :: JStgExpr -> JStgExpr -> JStgExpr
pattern LAnd x y = InfixExpr LAndOp x y
-- | pattern synonym to create integer values
pattern Int :: Integer -> JStgExpr
pattern Int x = ValExpr (JInt x)
......@@ -328,6 +332,10 @@ data AOp
instance NFData AOp
-- | construct a JS variable reference
var :: FastString -> JStgExpr
var = Var . global
-- | construct a JS reference, intended to refer to a global name
global :: FastString -> JStgExpr
global = Var . name
-- | construct a JS reference, intended to refer to a local name
local :: FastString -> JStgExpr
local = Var . name
......@@ -107,11 +107,10 @@ module GHC.JS.Make
, off8, off16, off32, off64
, mask8, mask16
, signExtend8, signExtend16
, typeof
, typeOf
, returnStack, assignAllEqual, assignAll, assignAllReverseOrder
, declAssignAll
, nullStat, (.^)
, trace
-- ** Hash combinators
, jhEmpty
, jhSingle
......@@ -182,8 +181,8 @@ instance ToJExpr () where
toJExpr _ = ValExpr $ JList []
instance ToJExpr Bool where
toJExpr True = var "true"
toJExpr False = var "false"
toJExpr True = global "true"
toJExpr False = global "false"
instance ToJExpr JVal where
toJExpr = ValExpr
......@@ -376,7 +375,7 @@ jTryCatchFinally :: (Ident -> JStgStat) -> (Ident -> JStgStat) -> (Ident -> JStg
jTryCatchFinally c f f2 = do i <- newIdent
return $ TryStat (c i) i (f i) (f2 i)
-- | Convert a ShortText to a Javascript String
-- | Convert a FastString to a Javascript String
jString :: FastString -> JStgExpr
jString = toJExpr
......@@ -447,8 +446,8 @@ infixl 8 .||., .&&.
infixl 9 .<<., .>>., .>>>.
-- | Given a 'JStgExpr', return the its type.
typeof :: JStgExpr -> JStgExpr
typeof = UOpExpr TypeofOp
typeOf :: JStgExpr -> JStgExpr
typeOf = UOpExpr TypeofOp
-- | JS if-expression
--
......@@ -494,15 +493,15 @@ if10 e = IfExpr e one_ zero_
if01 :: JStgExpr -> JStgExpr
if01 e = IfExpr e zero_ one_
-- | an expression application, see related 'appS'
-- | an application expression, see related 'appS'
--
-- > app f xs ==> f(xs)
app :: FastString -> [JStgExpr] -> JStgExpr
app f xs = ApplExpr (var f) xs
app f xs = ApplExpr (global f) xs
-- | A statement application, see the expression form 'app'
appS :: FastString -> [JStgExpr] -> JStgStat
appS f xs = ApplStat (var f) xs
appS f xs = ApplStat (global f) xs
-- | Return a 'JStgExpr'
returnS :: JStgExpr -> JStgStat
......@@ -577,7 +576,7 @@ signExtend16 x = (BAnd x (Int 0x7FFF)) `Sub` (BAnd x (Int 0x8000))
--
-- > obj .^ prop ==> obj.prop
(.^) :: JStgExpr -> FastString -> JStgExpr
obj .^ prop = SelExpr obj (global prop)
obj .^ prop = SelExpr obj (name prop)
infixl 8 .^
-- | Assign a variable to an expression
......@@ -614,9 +613,6 @@ assignAllReverseOrder xs ys = mconcat (reverse (zipWith (|=) xs ys))
declAssignAll :: [Ident] -> [JStgExpr] -> JStgStat
declAssignAll xs ys = mconcat (zipWith (||=) xs ys)
trace :: ToJExpr a => a -> JStgStat
trace ex = appS "h$log" [toJExpr ex]
--------------------------------------------------------------------------------
-- Literals
......@@ -627,7 +623,7 @@ trace ex = appS "h$log" [toJExpr ex]
-- | The JS literal 'null'
null_ :: JStgExpr
null_ = var "null"
null_ = global "null"
-- | The JS literal 0
zero_ :: JStgExpr
......@@ -647,7 +643,7 @@ three_ = Int 3
-- | The JS literal 'undefined'
undefined_ :: JStgExpr
undefined_ = var "undefined"
undefined_ = global "undefined"
-- | The JS literal 'true'
true_ :: JStgExpr
......@@ -658,7 +654,7 @@ false_ :: JStgExpr
false_ = ValExpr (JBool False)
returnStack :: JStgStat
returnStack = ReturnStat (ApplExpr (var "h$rs") [])
returnStack = ReturnStat (ApplExpr (global "h$rs") [])
--------------------------------------------------------------------------------
......@@ -669,7 +665,7 @@ returnStack = ReturnStat (ApplExpr (var "h$rs") [])
-- is the sole math introduction function.
math :: JStgExpr
math = var "Math"
math = global "Math"
math_ :: FastString -> [JStgExpr] -> JStgExpr
math_ op args = ApplExpr (math .^ op) args
......
......@@ -341,7 +341,7 @@ instance NFData AOp
-- | construct a JS variable reference
var :: FastString -> JExpr
var = Var . global
var = Var . name
-- | The JS literal 'true'
true_ :: JExpr
......