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 (69)
Showing
with 603 additions and 51 deletions
......@@ -999,7 +999,7 @@ project-version:
- . ./version.sh
# Download existing ghcup metadata
- nix shell --extra-experimental-features nix-command --extra-experimental-features flakes nixpkgs#wget -c wget "https://raw.githubusercontent.com/haskell/ghcup-metadata/develop/ghcup-0.0.7.yaml"
- nix shell --extra-experimental-features nix-command --extra-experimental-features flakes nixpkgs#wget -c wget "https://gitlab.haskell.org/ghc/ghcup-metadata/-/raw/updates/ghcup-0.0.7.yaml"
- .gitlab/generate_job_metadata
......@@ -1048,6 +1048,34 @@ ghcup-metadata-nightly:
rules:
- if: $NIGHTLY
# Update the ghcup metadata with information about this nightly pipeline
ghcup-metadata-nightly-push:
stage: deploy
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-fedora33:$DOCKER_REV"
dependencies: null
tags:
- x86_64-linux
variables:
BUILD_FLAVOUR: default
GIT_SUBMODULE_STRATEGY: "none"
needs:
- job: ghcup-metadata-nightly
artifacts: true
script:
- git clone https://gitlab.haskell.org/ghc/ghcup-metadata.git
- cp metadata_test.yaml ghcup-metadata/ghcup-0.0.7.yaml
- cd ghcup-metadata
- git config user.email "ghc-ci@gitlab-haskell.org"
- git config user.name "GHC GitLab CI"
- git remote add gitlab_origin https://oauth2:$PROJECT_PUSH_TOKEN@gitlab.haskell.org/ghc/ghcup-metadata.git
- git add .
- git commit -m "Update metadata"
- git push gitlab_origin HEAD:updates -o ci.skip
rules:
# Only run the update on scheduled nightly pipelines, ie once a day
- if: $NIGHTLY && $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "master"
ghcup-metadata-release:
# No explicit needs for release pipeline as we assume we need everything and everything will pass.
extends: .ghcup-metadata
......
......@@ -424,7 +424,7 @@ distroVariables Alpine = mconcat
-- T10458, ghcilink002: due to #17869
-- linker_unload_native: due to musl not supporting any means of probing dynlib dependencies
-- (see Note [Object unloading]).
, "BROKEN_TESTS" =: "encoding004 T10458 ghcilink002 linker_unload_native"
, "BROKEN_TESTS" =: "encoding004 T10458 linker_unload_native"
]
distroVariables Centos7 = mconcat [
"HADRIAN_ARGS" =: "--docs=no-sphinx"
......@@ -760,7 +760,7 @@ nightly arch opsys bc =
release :: Arch -> Opsys -> BuildConfig -> NamedJob Job
release arch opsys bc =
let NamedJob n j = job arch opsys (bc { buildFlavour = Release })
in NamedJob { name = "release-" ++ n, jobInfo = addJobRule ReleaseOnly . keepArtifacts "1 year" . ignorePerfFailures . highCompression $ j}
in NamedJob { name = "release-" ++ n, jobInfo = addJobRule ReleaseOnly . keepArtifacts "1 year" . ignorePerfFailures . useHashUnitIds . highCompression $ j}
-- Specific job modification functions
......@@ -785,6 +785,9 @@ ignorePerfFailures = addVariable "IGNORE_PERF_FAILURES" "all"
highCompression :: Job -> Job
highCompression = addVariable "XZ_OPT" "-9"
useHashUnitIds :: Job -> Job
useHashUnitIds = addVariable "HADRIAN_ARGS" "--hash-unit-ids"
-- | Mark the validate job to run in fast-ci mode
fastCI :: JobGroup Job -> JobGroup Job
fastCI = modifyValidateJobs (addJobRule FastCI)
......@@ -900,8 +903,11 @@ job_groups =
, standardBuildsWithConfig AArch64 (Linux Debian10) (splitSectionsBroken vanilla)
, disableValidate (validateBuilds AArch64 (Linux Debian10) llvm)
, standardBuildsWithConfig I386 (Linux Debian9) (splitSectionsBroken vanilla)
, standardBuildsWithConfig Amd64 (Linux Alpine) (splitSectionsBroken static)
, disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine) staticNativeInt))
-- Fully static build, in theory usable on any linux distribution.
, fullyStaticBrokenTests (standardBuildsWithConfig Amd64 (Linux Alpine) (splitSectionsBroken static))
-- Dynamically linked build, suitable for building your own static executables on alpine
, disableValidate (standardBuildsWithConfig Amd64 (Linux Alpine) (splitSectionsBroken vanilla))
, fullyStaticBrokenTests (disableValidate (allowFailureGroup (standardBuildsWithConfig Amd64 (Linux Alpine) staticNativeInt)))
, validateBuilds Amd64 (Linux Debian11) (crossConfig "aarch64-linux-gnu" (Emulator "qemu-aarch64 -L /usr/aarch64-linux-gnu") Nothing)
, validateBuilds Amd64 (Linux Debian11) (crossConfig "javascript-unknown-ghcjs" (Emulator "js-emulator") (Just "emconfigure")
)
......@@ -916,6 +922,10 @@ job_groups =
]
where
-- ghcilink002 broken due to #17869
fullyStaticBrokenTests = modifyJobs (addVariable "BROKEN_TESTS" "ghcilink002 ")
hackage_doc_job = rename (<> "-hackage") . modifyJobs (addVariable "HADRIAN_ARGS" "--haddock-base-url")
tsan_jobs =
......
......@@ -597,7 +597,7 @@
"variables": {
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-int_native-validate+fully_static",
"BROKEN_TESTS": "encoding004 T10458 ghcilink002 linker_unload_native",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "validate+fully_static",
"CONFIGURE_ARGS": "--disable-ld-override ",
"HADRIAN_ARGS": "--docs=no-sphinx",
......@@ -606,6 +606,68 @@
"XZ_OPT": "-9"
}
},
"nightly-x86_64-linux-alpine3_12-validate": {
"after_script": [
".gitlab/ci.sh save_cache",
".gitlab/ci.sh clean",
"cat ci_timings"
],
"allow_failure": false,
"artifacts": {
"expire_in": "8 weeks",
"paths": [
"ghc-x86_64-linux-alpine3_12-validate.tar.xz",
"junit.xml"
],
"reports": {
"junit": "junit.xml"
},
"when": "always"
},
"cache": {
"key": "x86_64-linux-alpine3_12-$CACHE_REV",
"paths": [
"cabal-cache",
"toolchain"
]
},
"dependencies": [],
"image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_12:$DOCKER_REV",
"needs": [
{
"artifacts": false,
"job": "hadrian-ghc-in-ghci"
}
],
"rules": [
{
"if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB != \"yes\") && ($NIGHTLY) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")",
"when": "on_success"
}
],
"script": [
"sudo chown ghc:ghc -R .",
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
".gitlab/ci.sh test_hadrian"
],
"stage": "full-build",
"tags": [
"x86_64-linux"
],
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-validate",
"BROKEN_TESTS": "encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "validate",
"CONFIGURE_ARGS": "--disable-ld-override ",
"HADRIAN_ARGS": "--docs=no-sphinx",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
"TEST_ENV": "x86_64-linux-alpine3_12-validate",
"XZ_OPT": "-9"
}
},
"nightly-x86_64-linux-alpine3_12-validate+fully_static": {
"after_script": [
".gitlab/ci.sh save_cache",
......@@ -659,7 +721,7 @@
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-validate+fully_static",
"BROKEN_TESTS": "encoding004 T10458 ghcilink002 linker_unload_native",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "validate+fully_static",
"CONFIGURE_ARGS": "--disable-ld-override ",
"HADRIAN_ARGS": "--docs=no-sphinx",
......@@ -2222,7 +2284,7 @@
"BIN_DIST_NAME": "ghc-aarch64-darwin-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi ",
"HADRIAN_ARGS": "--docs=no-sphinx",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"LANG": "en_US.UTF-8",
"MACOSX_DEPLOYMENT_TARGET": "11.0",
......@@ -2286,6 +2348,7 @@
"BIN_DIST_NAME": "ghc-aarch64-linux-deb10-release+no_split_sections",
"BUILD_FLAVOUR": "release+no_split_sections",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "aarch64-linux-deb10-release+no_split_sections",
"XZ_OPT": "-9"
......@@ -2346,6 +2409,7 @@
"BIN_DIST_NAME": "ghc-i386-linux-deb9-release+no_split_sections",
"BUILD_FLAVOUR": "release+no_split_sections",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "i386-linux-deb9-release+no_split_sections",
"XZ_OPT": "-9"
......@@ -2406,7 +2470,7 @@
"BIN_DIST_NAME": "ghc-x86_64-darwin-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "--with-intree-gmp --with-system-libffi ",
"HADRIAN_ARGS": "--docs=no-sphinx",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"LANG": "en_US.UTF-8",
"MACOSX_DEPLOYMENT_TARGET": "10.10",
......@@ -2470,10 +2534,10 @@
"variables": {
"BIGNUM_BACKEND": "native",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-int_native-release+fully_static",
"BROKEN_TESTS": "encoding004 T10458 ghcilink002 linker_unload_native",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "release+fully_static",
"CONFIGURE_ARGS": "--disable-ld-override ",
"HADRIAN_ARGS": "--docs=no-sphinx",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
"TEST_ENV": "x86_64-linux-alpine3_12-int_native-release+fully_static",
......@@ -2533,16 +2597,79 @@
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-release+fully_static+no_split_sections",
"BROKEN_TESTS": "encoding004 T10458 ghcilink002 linker_unload_native",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "release+fully_static+no_split_sections",
"CONFIGURE_ARGS": "--disable-ld-override ",
"HADRIAN_ARGS": "--docs=no-sphinx",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
"TEST_ENV": "x86_64-linux-alpine3_12-release+fully_static+no_split_sections",
"XZ_OPT": "-9"
}
},
"release-x86_64-linux-alpine3_12-release+no_split_sections": {
"after_script": [
".gitlab/ci.sh save_cache",
".gitlab/ci.sh clean",
"cat ci_timings"
],
"allow_failure": false,
"artifacts": {
"expire_in": "1 year",
"paths": [
"ghc-x86_64-linux-alpine3_12-release+no_split_sections.tar.xz",
"junit.xml"
],
"reports": {
"junit": "junit.xml"
},
"when": "always"
},
"cache": {
"key": "x86_64-linux-alpine3_12-$CACHE_REV",
"paths": [
"cabal-cache",
"toolchain"
]
},
"dependencies": [],
"image": "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-alpine3_12:$DOCKER_REV",
"needs": [
{
"artifacts": false,
"job": "hadrian-ghc-in-ghci"
}
],
"rules": [
{
"if": "($CI_MERGE_REQUEST_LABELS !~ /.*fast-ci.*/) && ($RELEASE_JOB == \"yes\") && ($NIGHTLY == null) && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\") && (\"true\" == \"true\")",
"when": "on_success"
}
],
"script": [
"sudo chown ghc:ghc -R .",
".gitlab/ci.sh setup",
".gitlab/ci.sh configure",
".gitlab/ci.sh build_hadrian",
".gitlab/ci.sh test_hadrian"
],
"stage": "full-build",
"tags": [
"x86_64-linux"
],
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-release+no_split_sections",
"BROKEN_TESTS": "encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "release+no_split_sections",
"CONFIGURE_ARGS": "--disable-ld-override ",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"INSTALL_CONFIGURE_ARGS": "--disable-ld-override",
"TEST_ENV": "x86_64-linux-alpine3_12-release+no_split_sections",
"XZ_OPT": "-9"
}
},
"release-x86_64-linux-centos7-release+no_split_sections": {
"after_script": [
".gitlab/ci.sh save_cache",
......@@ -2598,7 +2725,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-centos7-release+no_split_sections",
"BUILD_FLAVOUR": "release+no_split_sections",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--docs=no-sphinx",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "x86_64-linux-centos7-release+no_split_sections",
"XZ_OPT": "-9"
......@@ -2659,6 +2786,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "x86_64-linux-deb10-release",
"XZ_OPT": "-9"
......@@ -2719,6 +2847,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-deb10-release+debug_info",
"BUILD_FLAVOUR": "release+debug_info",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "x86_64-linux-deb10-release+debug_info",
"XZ_OPT": "-9"
......@@ -2779,6 +2908,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "x86_64-linux-deb11-release",
"XZ_OPT": "-9"
......@@ -2839,6 +2969,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-deb11-release+boot_nonmoving_gc",
"BUILD_FLAVOUR": "release+boot_nonmoving_gc",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"RUNTEST_ARGS": "--way=nonmoving --way=nonmoving_thr --way=nonmoving_thr_sanity",
"TEST_ENV": "x86_64-linux-deb11-release+boot_nonmoving_gc",
......@@ -2900,6 +3031,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-deb9-release+no_split_sections",
"BUILD_FLAVOUR": "release+no_split_sections",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "x86_64-linux-deb9-release+no_split_sections",
"XZ_OPT": "-9"
......@@ -2960,6 +3092,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"LLC": "/bin/false",
"OPT": "/bin/false",
......@@ -3022,6 +3155,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release+debug_info",
"BUILD_FLAVOUR": "release+debug_info",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"LLC": "/bin/false",
"OPT": "/bin/false",
......@@ -3084,7 +3218,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-fedora33-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--haddock-base-url",
"HADRIAN_ARGS": "--haddock-base-url --hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"LLC": "/bin/false",
"OPT": "/bin/false",
......@@ -3147,7 +3281,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-rocky8-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--docs=no-sphinx",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "x86_64-linux-rocky8-release",
"XZ_OPT": "-9"
......@@ -3208,6 +3342,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-ubuntu18_04-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "x86_64-linux-ubuntu18_04-release",
"XZ_OPT": "-9"
......@@ -3268,6 +3403,7 @@
"BIN_DIST_NAME": "ghc-x86_64-linux-ubuntu20_04-release",
"BUILD_FLAVOUR": "release",
"CONFIGURE_ARGS": "",
"HADRIAN_ARGS": "--hash-unit-ids",
"IGNORE_PERF_FAILURES": "all",
"TEST_ENV": "x86_64-linux-ubuntu20_04-release",
"XZ_OPT": "-9"
......@@ -3325,7 +3461,7 @@
"CABAL_INSTALL_VERSION": "3.8.1.0",
"CONFIGURE_ARGS": "",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--docs=no-sphinx",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"LANG": "en_US.UTF-8",
"MSYSTEM": "CLANG64",
......@@ -3385,7 +3521,7 @@
"CABAL_INSTALL_VERSION": "3.8.1.0",
"CONFIGURE_ARGS": "",
"GHC_VERSION": "9.4.3",
"HADRIAN_ARGS": "--docs=no-sphinx",
"HADRIAN_ARGS": "--hash-unit-ids --docs=no-sphinx",
"IGNORE_PERF_FAILURES": "all",
"LANG": "en_US.UTF-8",
"MSYSTEM": "CLANG64",
......@@ -3570,7 +3706,7 @@
"variables": {
"BIGNUM_BACKEND": "gmp",
"BIN_DIST_NAME": "ghc-x86_64-linux-alpine3_12-validate+fully_static",
"BROKEN_TESTS": "encoding004 T10458 ghcilink002 linker_unload_native",
"BROKEN_TESTS": "ghcilink002 encoding004 T10458 linker_unload_native",
"BUILD_FLAVOUR": "validate+fully_static",
"CONFIGURE_ARGS": "--disable-ld-override ",
"HADRIAN_ARGS": "--docs=no-sphinx",
......
......@@ -30,6 +30,7 @@ def job_triple(job_name):
'release-x86_64-linux-deb9-release': 'x86_64-deb9-linux',
'release-x86_64-linux-centos7-release': 'x86_64-centos7-linux',
'release-x86_64-linux-alpine3_12-release+fully_static': 'x86_64-alpine3_12-linux-static',
'release-x86_64-linux-alpine3_12-release': 'x86_64-alpine3_12-linux',
'release-x86_64-linux-alpine3_12-int_native-release+fully_static': 'x86_64-alpine3_12-linux-static-int_native',
'release-x86_64-darwin-release': 'x86_64-apple-darwin',
'release-i386-linux-deb9-release': 'i386-deb9-linux',
......
......@@ -25,6 +25,7 @@ import tempfile
import re
import pickle
import os
import glob
WORK_DIR = Path('.upload-libs')
......@@ -152,7 +153,10 @@ def prepare_docs(bindist: Path, pkg: Package):
cabal_file = pkg.path / f'{pkg.name}.cabal'
version = get_version(cabal_file)
assert version is not None
docdir = bindist / 'doc' / 'html' / 'libraries' / (pkg.name + "-" + version)
docdir_prefix = bindist / 'doc' / 'html' / 'libraries' / (pkg.name + "-" + version)
docdir = glob.glob(str(docdir_prefix) + "*")[0]
print(docdir)
# Build the documentation tarball from the bindist documentation
stem = f'{pkg.name}-{version}-docs'
......
......@@ -1038,7 +1038,7 @@ Here's what's unusual about it:
solve a goal of type (a ~~ b) even if there is, say (Int ~~ c) in the
context. (Normally, it waits to learn more, just in case the given
influences what happens next.) See Note [Naturally coherent classes]
in GHC.Tc.Solver.Interact.
in GHC.Tc.Solver.Dict
* It always terminates. That is, in the UndecidableInstances checks, we
don't worry if a (~~) constraint is too big, as we know that solving
......@@ -1047,7 +1047,7 @@ Here's what's unusual about it:
On the other hand, this behaves just like any class w.r.t. eager superclass
unpacking in the solver. So a lifted equality given quickly becomes an unlifted
equality given. This is good, because the solver knows all about unlifted
equalities. There is some special-casing in GHC.Tc.Solver.Interact.matchClassInst to
equalities. There is some special-casing in GHC.Tc.Solver.Dict.matchClassInst to
pretend that there is an instance of this class, as we can't write the instance
in Haskell.
......
......@@ -1369,6 +1369,75 @@ primop FloatDecode_IntOp "decodeFloat_Int#" GenPrimOp
First 'Int#' in result is the mantissa; second is the exponent.}
with out_of_line = True
------------------------------------------------------------------------
section "Fused multiply-add operations"
{ #fma#
The fused multiply-add primops 'fmaddFloat#' and 'fmaddDouble#'
implement the operation
\[
\lambda\ x\ y\ z \rightarrow x * y + z
\]
with a single floating-point rounding operation at the end, as opposed to
rounding twice (which can accumulate rounding errors).
These primops can be compiled directly to a single machine instruction on
architectures that support them. Currently, these are:
1. x86 with CPUs that support the FMA3 extended instruction set (which
includes most processors since 2013).
2. PowerPC.
3. AArch64.
This requires users pass the '-mfma' flag to GHC. Otherwise, the primop
is implemented by falling back to the C standard library, which might
perform software emulation (this may yield results that are not IEEE
compliant on some platforms).
The additional operations 'fmsubFloat#'/'fmsubDouble#',
'fnmaddFloat#'/'fnmaddDouble#' and 'fnmsubFloat#'/'fnmsubDouble#' provide
variants on 'fmaddFloat#'/'fmaddDouble#' in which some signs are changed:
\[
\begin{aligned}
\mathrm{fmadd}\ x\ y\ z &= \phantom{+} x * y + z \\[8pt]
\mathrm{fmsub}\ x\ y\ z &= \phantom{+} x * y - z \\[8pt]
\mathrm{fnmadd}\ x\ y\ z &= - x * y + z \\[8pt]
\mathrm{fnmsub}\ x\ y\ z &= - x * y - z
\end{aligned}
\]
}
------------------------------------------------------------------------
primop FloatFMAdd "fmaddFloat#" GenPrimOp
Float# -> Float# -> Float# -> Float#
{Fused multiply-add operation @x*y+z@. See "GHC.Prim#fma".}
primop FloatFMSub "fmsubFloat#" GenPrimOp
Float# -> Float# -> Float# -> Float#
{Fused multiply-subtract operation @x*y-z@. See "GHC.Prim#fma".}
primop FloatFNMAdd "fnmaddFloat#" GenPrimOp
Float# -> Float# -> Float# -> Float#
{Fused negate-multiply-add operation @-x*y+z@. See "GHC.Prim#fma".}
primop FloatFNMSub "fnmsubFloat#" GenPrimOp
Float# -> Float# -> Float# -> Float#
{Fused negate-multiply-subtract operation @-x*y-z@. See "GHC.Prim#fma".}
primop DoubleFMAdd "fmaddDouble#" GenPrimOp
Double# -> Double# -> Double# -> Double#
{Fused multiply-add operation @x*y+z@. See "GHC.Prim#fma".}
primop DoubleFMSub "fmsubDouble#" GenPrimOp
Double# -> Double# -> Double# -> Double#
{Fused multiply-subtract operation @x*y-z@. See "GHC.Prim#fma".}
primop DoubleFNMAdd "fnmaddDouble#" GenPrimOp
Double# -> Double# -> Double# -> Double#
{Fused negate-multiply-add operation @-x*y+z@. See "GHC.Prim#fma".}
primop DoubleFNMSub "fnmsubDouble#" GenPrimOp
Double# -> Double# -> Double# -> Double#
{Fused negate-multiply-subtract operation @-x*y-z@. See "GHC.Prim#fma".}
------------------------------------------------------------------------
section "Arrays"
{Operations on 'Array#'.}
......@@ -2604,6 +2673,12 @@ primop WriteMutVarOp "writeMutVar#" GenPrimOp
has_side_effects = True
code_size = { primOpCodeSizeForeignCall } -- for the write barrier
primop AtomicSwapMutVarOp "atomicSwapMutVar#" GenPrimOp
MutVar# s v -> v -> State# s -> (# State# s, v #)
{Atomically exchange the value of a 'MutVar#'.}
with
has_side_effects = True
-- Note [Why not an unboxed tuple in atomicModifyMutVar2#?]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- Looking at the type of atomicModifyMutVar2#, one might wonder why
......@@ -3401,7 +3476,7 @@ primop FinalizeWeakOp "finalizeWeak#" GenPrimOp
out_of_line = True
primop TouchOp "touch#" GenPrimOp
v -> State# RealWorld -> State# RealWorld
v -> State# s -> State# s
with
code_size = { 0 }
has_side_effects = True
......@@ -3717,7 +3792,7 @@ section "Controlling object lifetime"
-- and "p" is the same as "b" except representation-polymorphic.
-- See Note [Levity and representation polymorphic primops]
primop KeepAliveOp "keepAlive#" GenPrimOp
v -> State# RealWorld -> (State# RealWorld -> p) -> p
v -> State# s -> (State# s -> p) -> p
{ @'keepAlive#' x s k@ keeps the value @x@ alive during the execution
of the computation @k@.
......
{-# LANGUAGE LambdaCase #-}
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
module GHC.Cmm.MachOp
......@@ -26,6 +28,9 @@ module GHC.Cmm.MachOp
-- Atomic read-modify-write
, MemoryOrdering(..)
, AtomicMachOp(..)
-- Fused multiply-add
, FMASign(..), pprFMASign
)
where
......@@ -88,6 +93,10 @@ data MachOp
| MO_F_Mul Width
| MO_F_Quot Width
-- Floating-point fused multiply-add operations
-- | Fused multiply-add, see 'FMASign'.
| MO_FMA FMASign Width
-- Floating point comparison
| MO_F_Eq Width
| MO_F_Ne Width
......@@ -160,7 +169,30 @@ data MachOp
pprMachOp :: MachOp -> SDoc
pprMachOp mo = text (show mo)
-- | Where are the signs in a fused multiply-add instruction?
--
-- @x*y + z@ vs @x*y - z@ vs @-x*y+z@ vs @-x*y-z@.
--
-- Warning: the signs aren't consistent across architectures (X86, PowerPC, AArch64).
-- The user-facing implementation uses the X86 convention, while the relevant
-- backends use their corresponding conventions.
data FMASign
-- | Fused multiply-add @x*y + z@.
= FMAdd
-- | Fused multiply-subtract. On X86: @x*y - z@.
| FMSub
-- | Fused multiply-add. On X86: @-x*y + z@.
| FNMAdd
-- | Fused multiply-subtract. On X86: @-x*y - z@.
| FNMSub
deriving (Eq, Show)
pprFMASign :: IsLine doc => FMASign -> doc
pprFMASign = \case
FMAdd -> text "fmadd"
FMSub -> text "fmsub"
FNMAdd -> text "fnmadd"
FNMSub -> text "fnmsub"
-- -----------------------------------------------------------------------------
-- Some common MachReps
......@@ -398,6 +430,9 @@ machOpResultType platform mop tys =
MO_F_Mul r -> cmmFloat r
MO_F_Quot r -> cmmFloat r
MO_F_Neg r -> cmmFloat r
MO_FMA _ r -> cmmFloat r
MO_F_Eq {} -> comparisonResultRep platform
MO_F_Ne {} -> comparisonResultRep platform
MO_F_Ge {} -> comparisonResultRep platform
......@@ -489,6 +524,9 @@ machOpArgReps platform op =
MO_F_Mul r -> [r,r]
MO_F_Quot r -> [r,r]
MO_F_Neg r -> [r]
MO_FMA _ r -> [r,r,r]
MO_F_Eq r -> [r,r]
MO_F_Ne r -> [r,r]
MO_F_Ge r -> [r,r]
......
......@@ -1009,7 +1009,7 @@ machOps = listToUFM $
( "eq", MO_Eq ),
( "ne", MO_Ne ),
( "mul", MO_Mul ),
( "mulmayoflo", MO_S_MulMayOflo ),
( "mulmayoflo", MO_S_MulMayOflo ),
( "neg", MO_S_Neg ),
( "quot", MO_S_Quot ),
( "rem", MO_S_Rem ),
......@@ -1040,6 +1040,11 @@ machOps = listToUFM $
( "fmul", MO_F_Mul ),
( "fquot", MO_F_Quot ),
( "fmadd" , MO_FMA FMAdd ),
( "fmsub" , MO_FMA FMSub ),
( "fnmadd", MO_FMA FNMAdd ),
( "fnmsub", MO_FMA FNMSub ),
( "feq", MO_F_Eq ),
( "fne", MO_F_Ne ),
( "fge", MO_F_Ge ),
......
......@@ -783,7 +783,7 @@ getRegister' config plat expr
where w' = formatToWidth (cmmTypeFormat (cmmRegType reg))
r' = getRegisterReg plat reg
-- Generic case.
-- Generic binary case.
CmmMachOp op [x, y] -> do
-- alright, so we have an operation, and two expressions. And we want to essentially do
-- ensure we get float regs (TODO(Ben): What?)
......@@ -956,7 +956,44 @@ getRegister' config plat expr
-- TODO
op -> pprPanic "getRegister' (unhandled dyadic CmmMachOp): " $ (pprMachOp op) <+> text "in" <+> (pdoc plat expr)
op -> pprPanic "getRegister' (unhandled dyadic CmmMachOp): " $
(pprMachOp op) <+> text "in" <+> (pdoc plat expr)
-- Generic ternary case.
CmmMachOp op [x, y, z] ->
case op of
-- Floating-point fused multiply-add operations
-- x86 fmadd x * y + z <=> AArch64 fmadd : d = r1 * r2 + r3
-- x86 fmsub x * y - z <=> AArch64 fnmsub: d = r1 * r2 - r3
-- x86 fnmadd - x * y + z <=> AArch64 fmsub : d = - r1 * r2 + r3
-- x86 fnmsub - x * y - z <=> AArch64 fnmadd: d = - r1 * r2 - r3
MO_FMA var w -> case var of
FMAdd -> float3Op w (\d n m a -> unitOL $ FMA FMAdd d n m a)
FMSub -> float3Op w (\d n m a -> unitOL $ FMA FNMSub d n m a)
FNMAdd -> float3Op w (\d n m a -> unitOL $ FMA FMSub d n m a)
FNMSub -> float3Op w (\d n m a -> unitOL $ FMA FNMAdd d n m a)
_ -> pprPanic "getRegister' (unhandled ternary CmmMachOp): " $
(pprMachOp op) <+> text "in" <+> (pdoc plat expr)
where
float3Op w op = do
(reg_fx, format_x, code_fx) <- getFloatReg x
(reg_fy, format_y, code_fy) <- getFloatReg y
(reg_fz, format_z, code_fz) <- getFloatReg z
massertPpr (isFloatFormat format_x && isFloatFormat format_y && isFloatFormat format_z) $
text "float3Op: non-float"
return $
Any (floatFormat w) $ \ dst ->
code_fx `appOL`
code_fy `appOL`
code_fz `appOL`
op (OpReg w dst) (OpReg w reg_fx) (OpReg w reg_fy) (OpReg w reg_fz)
CmmMachOp _op _xs
-> pprPanic "getRegister' (variadic CmmMachOp): " (pdoc plat expr)
......
......@@ -32,9 +32,9 @@ import Data.Maybe (fromMaybe)
import GHC.Stack
-- | TODO: verify this!
stackFrameHeaderSize :: Platform -> Int
stackFrameHeaderSize _ = 64
-- | LR and FP (8 byte each) are the prologue of each stack frame
stackFrameHeaderSize :: Int
stackFrameHeaderSize = 2 * 8
-- | All registers are 8 byte wide.
spillSlotSize :: Int
......@@ -49,14 +49,13 @@ stackAlign = 16
maxSpillSlots :: NCGConfig -> Int
maxSpillSlots config
-- = 0 -- set to zero, to see when allocMoreStack has to fire.
= let platform = ncgPlatform config
in ((ncgSpillPreallocSize config - stackFrameHeaderSize platform)
= ((ncgSpillPreallocSize config - stackFrameHeaderSize)
`div` spillSlotSize) - 1
-- | Convert a spill slot number to a *byte* offset, with no sign.
spillSlotToOffset :: NCGConfig -> Int -> Int
spillSlotToOffset config slot
= stackFrameHeaderSize (ncgPlatform config) + spillSlotSize * slot
spillSlotToOffset _ slot
= stackFrameHeaderSize + spillSlotSize * slot
-- | Get the registers that are being used by this instruction.
-- regUsage doesn't need to do any trickery for jumps and such.
......@@ -143,6 +142,8 @@ regUsageOfInstr platform instr = case instr of
SCVTF dst src -> usage (regOp src, regOp dst)
FCVTZS dst src -> usage (regOp src, regOp dst)
FABS dst src -> usage (regOp src, regOp dst)
FMA _ dst src1 src2 src3 ->
usage (regOp src1 ++ regOp src2 ++ regOp src3, regOp dst)
_ -> panic $ "regUsageOfInstr: " ++ instrCon instr
......@@ -281,6 +282,9 @@ patchRegsOfInstr instr env = case instr of
SCVTF o1 o2 -> SCVTF (patchOp o1) (patchOp o2)
FCVTZS o1 o2 -> FCVTZS (patchOp o1) (patchOp o2)
FABS o1 o2 -> FABS (patchOp o1) (patchOp o2)
FMA s o1 o2 o3 o4 ->
FMA s (patchOp o1) (patchOp o2) (patchOp o3) (patchOp o4)
_ -> panic $ "patchRegsOfInstr: " ++ instrCon instr
where
patchOp :: Operand -> Operand
......@@ -651,6 +655,14 @@ data Instr
-- Float ABSolute value
| FABS Operand Operand
-- | Floating-point fused multiply-add instructions
--
-- - fmadd : d = r1 * r2 + r3
-- - fnmsub: d = r1 * r2 - r3
-- - fmsub : d = - r1 * r2 + r3
-- - fnmadd: d = - r1 * r2 - r3
| FMA FMASign Operand Operand Operand Operand
instrCon :: Instr -> String
instrCon i =
case i of
......@@ -716,6 +728,12 @@ instrCon i =
SCVTF{} -> "SCVTF"
FCVTZS{} -> "FCVTZS"
FABS{} -> "FABS"
FMA variant _ _ _ _ ->
case variant of
FMAdd -> "FMADD"
FMSub -> "FMSUB"
FNMAdd -> "FNMADD"
FNMSub -> "FNMSUB"
data Target
= TBlock BlockId
......
......@@ -546,6 +546,13 @@ pprInstr platform instr = case instr of
SCVTF o1 o2 -> op2 (text "\tscvtf") o1 o2
FCVTZS o1 o2 -> op2 (text "\tfcvtzs") o1 o2
FABS o1 o2 -> op2 (text "\tfabs") o1 o2
FMA variant d r1 r2 r3 ->
let fma = case variant of
FMAdd -> text "\tfmadd"
FMSub -> text "\tfmsub"
FNMAdd -> text "\tfnmadd"
FNMSub -> text "\tfnmsub"
in op4 fma d r1 r2 r3
where op2 op o1 o2 = line $ op <+> pprOp platform o1 <> comma <+> pprOp platform o2
op3 op o1 o2 o3 = line $ op <+> pprOp platform o1 <> comma <+> pprOp platform o2 <> comma <+> pprOp platform o3
op4 op o1 o2 o3 o4 = line $ op <+> pprOp platform o1 <> comma <+> pprOp platform o2 <> comma <+> pprOp platform o3 <> comma <+> pprOp platform o4
......
......@@ -649,6 +649,21 @@ getRegister' _ _ (CmmMachOp mop [x, y]) -- dyadic PrimOps
code <- remainderCode rep sgn tmp x y
return (Any fmt code)
getRegister' _ _ (CmmMachOp mop [x, y, z]) -- ternary PrimOps
= case mop of
-- x86 fmadd x * y + z <> PPC fmadd rt = ra * rc + rb
-- x86 fmsub x * y - z <> PPC fmsub rt = ra * rc - rb
-- x86 fnmadd - x * y + z ~~ PPC fnmsub rt = -(ra * rc - rb)
-- x86 fnmsub - x * y - z ~~ PPC fnmadd rt = -(ra * rc + rb)
MO_FMA variant w ->
case variant of
FMAdd -> fma_code w (FMADD FMAdd) x y z
FMSub -> fma_code w (FMADD FMSub) x y z
FNMAdd -> fma_code w (FMADD FNMAdd) x y z
FNMSub -> fma_code w (FMADD FNMSub) x y z
_ -> panic "PPC.CodeGen.getRegister: no match"
getRegister' _ _ (CmmLit (CmmInt i rep))
| Just imm <- makeImmediate rep True i
......@@ -2358,10 +2373,28 @@ trivialUCode rep instr x = do
let code' dst = code `snocOL` instr dst src
return (Any rep code')
-- | Generate code for a 4-register FMA instruction,
-- e.g. @fmadd rt ra rc rb := rt <- ra * rc + rb@.
fma_code :: Width
-> (Format -> Reg -> Reg -> Reg -> Reg -> Instr)
-> CmmExpr
-> CmmExpr
-> CmmExpr
-> NatM Register
fma_code w instr ra rc rb = do
let rep = floatFormat w
(src1, code1) <- getSomeReg ra
(src2, code2) <- getSomeReg rc
(src3, code3) <- getSomeReg rb
let instrCode rt =
code1 `appOL`
code2 `appOL`
code3 `snocOL` instr rep rt src1 src2 src3
return $ Any rep instrCode
-- There is no "remainder" instruction on the PPC, so we have to do
-- it the hard way.
-- The "sgn" parameter is the signedness for the division instruction
remainderCode :: Width -> Bool -> Reg -> CmmExpr -> CmmExpr
-> NatM (Reg -> InstrBlock)
remainderCode rep sgn reg_q arg_x arg_y = do
......
......@@ -280,6 +280,14 @@ data Instr
| FABS Reg Reg -- abs is the same for single and double
| FNEG Reg Reg -- negate is the same for single and double prec.
-- | Fused multiply-add instructions.
--
-- - FMADD: @rd = (ra * rb) + rd@
-- - FMSUB: @rd = ra * rb - rd@
-- - FNMADD: @rd = -(ra * rb + rd)@
-- - FNMSUB: @rd = -(ra * rb - rd)@
| FMADD FMASign Format Reg Reg Reg Reg
| FCMP Reg Reg
| FCTIWZ Reg Reg -- convert to integer word
......@@ -380,6 +388,7 @@ regUsageOfInstr platform instr
MFCR reg -> usage ([], [reg])
MFLR reg -> usage ([], [reg])
FETCHPC reg -> usage ([], [reg])
FMADD _ _ rt ra rc rb -> usage ([ra, rc, rb], [rt])
_ -> noUsage
where
usage (src, dst) = RU (filter (interesting platform) src)
......@@ -467,6 +476,8 @@ patchRegsOfInstr instr env
FDIV fmt r1 r2 r3 -> FDIV fmt (env r1) (env r2) (env r3)
FABS r1 r2 -> FABS (env r1) (env r2)
FNEG r1 r2 -> FNEG (env r1) (env r2)
FMADD sgn fmt r1 r2 r3 r4
-> FMADD sgn fmt (env r1) (env r2) (env r3) (env r4)
FCMP r1 r2 -> FCMP (env r1) (env r2)
FCTIWZ r1 r2 -> FCTIWZ (env r1) (env r2)
FCTIDZ r1 r2 -> FCTIDZ (env r1) (env r2)
......
......@@ -934,6 +934,9 @@ pprInstr platform instr = case instr of
FNEG reg1 reg2
-> pprUnary (text "fneg") reg1 reg2
FMADD signs fmt dst ra rc rb
-> pprTernaryF (pprFMASign signs) fmt dst ra rc rb
FCMP reg1 reg2
-> line $ hcat [
char '\t',
......@@ -1083,6 +1086,21 @@ pprBinaryF op fmt reg1 reg2 reg3 = line $ hcat [
pprReg reg3
]
pprTernaryF :: IsDoc doc => Line doc -> Format -> Reg -> Reg -> Reg -> Reg -> doc
pprTernaryF op fmt rt ra rc rb = line $ hcat [
char '\t',
op,
pprFFormat fmt,
char '\t',
pprReg rt,
text ", ",
pprReg ra,
text ", ",
pprReg rc,
text ", ",
pprReg rb
]
pprRI :: IsLine doc => Platform -> RI -> doc
pprRI _ (RIReg r) = pprReg r
pprRI platform (RIImm r) = pprImm platform r
......
......@@ -816,7 +816,9 @@ lower_CmmMachOp lbl (MO_SS_Conv w0 w1) xs = lower_MO_SS_Conv lbl w0 w1 xs
lower_CmmMachOp lbl (MO_UU_Conv w0 w1) xs = lower_MO_UU_Conv lbl w0 w1 xs
lower_CmmMachOp lbl (MO_XX_Conv w0 w1) xs = lower_MO_UU_Conv lbl w0 w1 xs
lower_CmmMachOp lbl (MO_FF_Conv w0 w1) xs = lower_MO_FF_Conv lbl w0 w1 xs
lower_CmmMachOp _ _ _ = panic "lower_CmmMachOp: unreachable"
lower_CmmMachOp _ mop _ =
pprPanic "lower_CmmMachOp: unreachable" $
vcat [ text "offending MachOp:" <+> pprMachOp mop ]
-- | Lower a 'CmmLit'. Note that we don't emit 'f32.const' or
-- 'f64.const' for the time being, and instead emit their relative bit
......
......@@ -901,14 +901,10 @@ getRegister' _ is32Bit (CmmMachOp mop [x, y]) = -- dyadic MachOps
MO_U_Lt _ -> condIntReg LU x y
MO_U_Le _ -> condIntReg LEU x y
MO_F_Add w -> trivialFCode_sse2 w ADD x y
MO_F_Sub w -> trivialFCode_sse2 w SUB x y
MO_F_Quot w -> trivialFCode_sse2 w FDIV x y
MO_F_Mul w -> trivialFCode_sse2 w MUL x y
MO_F_Add w -> trivialFCode_sse2 w ADD x y
MO_F_Sub w -> trivialFCode_sse2 w SUB x y
MO_F_Quot w -> trivialFCode_sse2 w FDIV x y
MO_F_Mul w -> trivialFCode_sse2 w MUL x y
MO_Add rep -> add_code rep x y
MO_Sub rep -> sub_code rep x y
......@@ -1113,6 +1109,13 @@ getRegister' _ is32Bit (CmmMachOp mop [x, y]) = -- dyadic MachOps
return (Fixed format result code)
getRegister' _plat _is32Bit (CmmMachOp mop [x, y, z]) = -- ternary MachOps
case mop of
-- Floating point fused multiply-add operations @ ± x*y ± z@
MO_FMA var w -> genFMA3Code w var x y z
_other -> pprPanic "getRegister(x86) - ternary CmmMachOp (1)"
(pprMachOp mop)
getRegister' _ _ (CmmLoad mem pk _)
| isFloatType pk
......@@ -3151,12 +3154,12 @@ genTrivialCode rep instr a b = do
a_code <- getAnyReg a
tmp <- getNewRegNat rep
let
-- We want the value of b to stay alive across the computation of a.
-- But, we want to calculate a straight into the destination register,
-- We want the value of 'b' to stay alive across the computation of 'a'.
-- But, we want to calculate 'a' straight into the destination register,
-- because the instruction only has two operands (dst := dst `op` src).
-- The troublesome case is when the result of b is in the same register
-- as the destination reg. In this case, we have to save b in a
-- new temporary across the computation of a.
-- The troublesome case is when the result of 'b' is in the same register
-- as the destination 'reg'. In this case, we have to save 'b' in a
-- new temporary across the computation of 'a'.
code dst
| dst `regClashesWithOp` b_op =
b_code `appOL`
......@@ -3174,6 +3177,69 @@ reg `regClashesWithOp` OpReg reg2 = reg == reg2
reg `regClashesWithOp` OpAddr amode = any (==reg) (addrModeRegs amode)
_ `regClashesWithOp` _ = False
-- | Generate code for a fused multiply-add operation, of the form @± x * y ± z@,
-- with 3 operands (FMA3 instruction set).
genFMA3Code :: Width
-> FMASign
-> CmmExpr -> CmmExpr -> CmmExpr -> NatM Register
genFMA3Code w signs x y z = do
-- For the FMA instruction, we want to compute x * y + z
--
-- There are three possible instructions we could emit:
--
-- - fmadd213 z y x, result in x, z can be a memory address
-- - fmadd132 x z y, result in y, x can be a memory address
-- - fmadd231 y x z, result in z, y can be a memory address
--
-- This suggests two possible optimisations:
--
-- - OPTIMISATION 1
-- If one argument is an address, use the instruction that allows
-- a memory address in that position.
--
-- - OPTIMISATION 2
-- If one argument is in a fixed register, use the instruction that puts
-- the result in that same register.
--
-- Currently we follow neither of these optimisations,
-- opting to always use fmadd213 for simplicity.
let rep = floatFormat w
(y_reg, y_code) <- getNonClobberedReg y
(z_reg, z_code) <- getNonClobberedReg z
x_code <- getAnyReg x
y_tmp <- getNewRegNat rep
z_tmp <- getNewRegNat rep
let
fma213 = FMA3 rep signs FMA213
code dst
| dst == y_reg
, dst == z_reg
= y_code `appOL`
unitOL (MOV rep (OpReg y_reg) (OpReg y_tmp)) `appOL`
z_code `appOL`
unitOL (MOV rep (OpReg z_reg) (OpReg z_tmp)) `appOL`
x_code dst `snocOL`
fma213 (OpReg z_tmp) y_tmp dst
| dst == y_reg
= y_code `appOL`
unitOL (MOV rep (OpReg y_reg) (OpReg z_tmp)) `appOL`
z_code `appOL`
x_code dst `snocOL`
fma213 (OpReg z_reg) y_tmp dst
| dst == z_reg
= y_code `appOL`
z_code `appOL`
unitOL (MOV rep (OpReg z_reg) (OpReg z_tmp)) `appOL`
x_code dst `snocOL`
fma213 (OpReg z_tmp) y_reg dst
| otherwise
= y_code `appOL`
z_code `appOL`
x_code dst `snocOL`
fma213 (OpReg z_reg) y_reg dst
return (Any rep code)
-----------
trivialUCode :: Format -> (Operand -> Instr)
......
......@@ -12,6 +12,7 @@ module GHC.CmmToAsm.X86.Instr
( Instr(..)
, Operand(..)
, PrefetchVariant(..)
, FMAPermutation(..)
, JumpDest(..)
, getJumpDestBlockId
, canShortcut
......@@ -272,6 +273,10 @@ data Instr
| CVTSI2SS Format Operand Reg -- I32/I64 to F32
| CVTSI2SD Format Operand Reg -- I32/I64 to F64
-- | FMA3 fused multiply-add operations.
| FMA3 Format FMASign FMAPermutation Operand Reg Reg
-- src1 (r/m), src2 (r), dst (r)
-- use ADD, SUB, and SQRT for arithmetic. In both cases, operands
-- are Operand Reg.
......@@ -351,7 +356,7 @@ data Operand
| OpImm Imm -- immediate value
| OpAddr AddrMode -- memory reference
data FMAPermutation = FMA132 | FMA213 | FMA231
-- | Returns which registers are read and written as a (read, written)
-- pair.
......@@ -438,6 +443,8 @@ regUsageOfInstr platform instr
PDEP _ src mask dst -> mkRU (use_R src $ use_R mask []) [dst]
PEXT _ src mask dst -> mkRU (use_R src $ use_R mask []) [dst]
FMA3 _ _ _ src1 src2 dst -> usageFMA src1 src2 dst
-- note: might be a better way to do this
PREFETCH _ _ src -> mkRU (use_R src []) []
LOCK i -> regUsageOfInstr platform i
......@@ -482,6 +489,15 @@ regUsageOfInstr platform instr
usageRMM (OpReg src) (OpAddr ea) (OpReg reg) = mkRU (use_EA ea [src, reg]) [reg]
usageRMM _ _ _ = panic "X86.RegInfo.usageRMM: no match"
-- 3 operand form of FMA instructions.
usageFMA :: Operand -> Reg -> Reg -> RegUsage
usageFMA (OpReg src1) src2 dst
= mkRU [src1, src2, dst] [dst]
usageFMA (OpAddr ea1) src2 dst
= mkRU (use_EA ea1 [src2, dst]) [dst]
usageFMA _ _ _
= panic "X86.RegInfo.usageFMA: no match"
-- 1 operand form; operand Modified
usageM :: Operand -> RegUsage
usageM (OpReg reg) = mkRU [reg] [reg]
......@@ -561,6 +577,8 @@ patchRegsOfInstr instr env
JMP op regs -> JMP (patchOp op) regs
JMP_TBL op ids s lbl -> JMP_TBL (patchOp op) ids s lbl
FMA3 fmt perm var x1 x2 x3 -> patch3 (FMA3 fmt perm var) x1 x2 x3
-- literally only support storing the top x87 stack value st(0)
X87Store fmt dst -> X87Store fmt (lookupAddr dst)
......@@ -612,6 +630,8 @@ patchRegsOfInstr instr env
patch1 insn op = insn $! patchOp op
patch2 :: (Operand -> Operand -> a) -> Operand -> Operand -> a
patch2 insn src dst = (insn $! patchOp src) $! patchOp dst
patch3 :: (Operand -> Reg -> Reg -> a) -> Operand -> Reg -> Reg -> a
patch3 insn src1 src2 dst = ((insn $! patchOp src1) $! env src2) $! env dst
patchOp (OpReg reg) = OpReg $! env reg
patchOp (OpImm imm) = OpImm imm
......
......@@ -838,6 +838,14 @@ pprInstr platform i = case i of
FDIV format op1 op2
-> pprFormatOpOp (text "div") format op1 op2
FMA3 format var perm op1 op2 op3
-> let mnemo = case var of
FMAdd -> text "vfmadd"
FMSub -> text "vfmsub"
FNMAdd -> text "vfnmadd"
FNMSub -> text "vfnmsub"
in pprFormatOpRegReg (mnemo <> pprFMAPermutation perm) format op1 op2 op3
SQRT format op1 op2
-> pprFormatOpReg (text "sqrt") format op1 op2
......@@ -968,6 +976,21 @@ pprInstr platform i = case i of
pprOperand platform format op2
]
pprFormatOpRegReg :: Line doc -> Format -> Operand -> Reg -> Reg -> doc
pprFormatOpRegReg name format op1 op2 op3
= line $ hcat [
pprMnemonic name format,
pprOperand platform format op1,
comma,
pprReg platform format op2,
comma,
pprReg platform format op3
]
pprFMAPermutation :: FMAPermutation -> Line doc
pprFMAPermutation FMA132 = text "132"
pprFMAPermutation FMA213 = text "213"
pprFMAPermutation FMA231 = text "231"
pprOpOp :: Line doc -> Format -> Operand -> Operand -> doc
pprOpOp name format op1 op2
......
......@@ -529,6 +529,11 @@ machOpNeedsCast platform mop args
pprMachOpApp' :: Platform -> MachOp -> [CmmExpr] -> SDoc
pprMachOpApp' platform mop args
= case args of
-- ternary
args@[_,_,_] ->
pprMachOp_for_C platform mop <> parens (pprWithCommas pprArg args)
-- dyadic
[x,y] -> pprArg x <+> pprMachOp_for_C platform mop <+> pprArg y
......@@ -711,13 +716,28 @@ pprMachOp_for_C platform mop = case mop of
MO_U_Quot _ -> char '/'
MO_U_Rem _ -> char '%'
-- & Floating-point operations
-- Floating-point operations
MO_F_Add _ -> char '+'
MO_F_Sub _ -> char '-'
MO_F_Neg _ -> char '-'
MO_F_Mul _ -> char '*'
MO_F_Quot _ -> char '/'
-- Floating-point fused multiply-add operations
MO_FMA FMAdd w ->
case w of
W32 -> text "fmaf"
W64 -> text "fma"
_ ->
pprTrace "offending mop:"
(text "FMAdd")
(panic $ "PprC.pprMachOp_for_C: FMAdd unsupported"
++ "at width " ++ show w)
MO_FMA var _width ->
pprTrace "offending mop:"
(text $ "FMA " ++ show var)
(panic $ "PprC.pprMachOp_for_C: should have been handled earlier!")
-- Signed comparisons
MO_S_Ge _ -> text ">="
MO_S_Le _ -> text "<="
......