m4

1 program Added 2025-10-28T10:38:15Z Model: x-ai/grok-4-fastTemp: 0.4 Evidence Report issue View issues
Aliases: —
Provenance: commit bac22d70f6 · authored 2025-10-28T11:38:15+01:00 · model x-ai/grok-4-fast

Sources mentioning this language

8 sources · pl_id: pl/m4
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q292068

Wikipedia infobox ↗

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsmacro
Designed byBrian Kernighan · Dennis Ritchie
First appeared1977

Extensions claimed by this language

8 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.m4linguistprimary812.2K files
.autohandlerpygmentssecondary2 files
.dhandlerpygmentssecondary1 files
.mclinguistsecondary158.6K files
.mcpygmentssecondary158.6K files
.mhtmlpygmentssecondary177.5K files
.mipygmentssecondary20.8K files
.mpygmentsdisputed52.6M files

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
ad_encode.m4 · 3561 B · ext .m4 · seen 4702× in SWH
via default-rulerule h/linguist/.m4/1
swh:1:cnt:e6c87cf5b0559c2058e1ba0dc1d796438c987047;origin=https://github.com/corretto/corretto-17;anchor=swh:1:rev:ef0f693065eddd5c86b9e0fc52d57eafb0b1dc50;path=/src/hotspot/cpu/aarch64/ad_encode.m4
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
dnl Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved.
dnl DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
dnl
dnl This code is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License version 2 only, as
dnl published by the Free Software Foundation.
dnl
dnl This code is distributed in the hope that it will be useful, but WITHOUT
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dnl FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
dnl version 2 for more details (a copy is included in the LICENSE file that
dnl accompanied this code).
dnl
dnl You should have received a copy of the GNU General Public License version
dnl 2 along with this work; if not, write to the Free Software Foundation,
dnl Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
dnl
dnl Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
dnl or visit www.oracle.com if you need additional information or have any
dnl questions.
dnl
dnl 
dnl Process this file with m4 ad_encode.m4 to generate the load/store
dnl patterns used in aarch64.ad.
dnl
define(choose, `loadStore($1, &MacroAssembler::$3, $2, $4,
               $5, $6, $7, $8, $9);dnl

  %}')dnl
define(access, `
    $3Register $1_reg = as_$3Register($$1$$reg);
    $4choose(C2_MacroAssembler(&cbuf), $1_reg,$2,$mem->opcode(),
        as_Register($mem$$base),$mem$$index,$mem$$scale,$mem$$disp,$5)')dnl
define(load,`
  // This encoding class is generated automatically from ad_encode.m4.
  // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
  enc_class aarch64_enc_$2($1 dst, memory$5 mem) %{dnl
access(dst,$2,$3,$4,$5)')dnl
load(iRegI,ldrsbw,,,1)
load(iRegI,ldrsb,,,1)
load(iRegI,ldrb,,,1)
load(iRegL,ldrb,,,1)
load(iRegI,ldrshw,,,2)
load(iRegI,ldrsh,,,2)
load(iRegI,ldrh,,,2)
load(iRegL,ldrh,,,2)
load(iRegI,ldrw,,,4)
load(iRegL,ldrw,,,4)
load(iRegL,ldrsw,,,4)
load(iRegL,ldr,,,8)
load(vRegF,ldrs,Float,,4)
load(vRegD,ldrd,Float,,8)
define(STORE,`
  // This encoding class is generated automatically from ad_encode.m4.
  // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
  enc_class aarch64_enc_$2($1 src, memory$5 mem) %{dnl
access(src,$2,$3,$4,$5)')dnl
define(STORE0,`
  // This encoding class is generated automatically from ad_encode.m4.
  // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
  enc_class aarch64_enc_$2`'0(memory$4 mem) %{
    C2_MacroAssembler _masm(&cbuf);
    choose(_masm,zr,$2,$mem->opcode(),
        as_$3Register($mem$$base),$mem$$index,$mem$$scale,$mem$$disp,$4)')dnl
STORE(iRegI,strb,,,1)
STORE0(iRegI,strb,,1)
STORE(iRegI,strh,,,2)
STORE0(iRegI,strh,,2)
STORE(iRegI,strw,,,4)
STORE0(iRegI,strw,,4)
STORE(iRegL,str,,
`// we sometimes get asked to store the stack pointer into the
    // current thread -- we cannot do that directly on AArch64
    if (src_reg == r31_sp) {
      C2_MacroAssembler _masm(&cbuf);
      assert(as_Register($mem$$base) == rthread, "unexpected store for sp");
      __ mov(rscratch2, sp);
      src_reg = rscratch2;
    }
    ',8)
STORE0(iRegL,str,,8)
STORE(vRegF,strs,Float,,4)
STORE(vRegD,strd,Float,,8)

  // This encoding class is generated automatically from ad_encode.m4.
  // DO NOT EDIT ANYTHING IN THIS SECTION OF THE FILE
  enc_class aarch64_enc_strb0_ordered(memory4 mem) %{
      C2_MacroAssembler _masm(&cbuf);
      __ membar(Assembler::StoreStore);
      loadStore(_masm, &MacroAssembler::strb, zr, $mem->opcode(),
               as_Register($mem$$base), $mem$$index, $mem$$scale, $mem$$disp, 1);
  %}

Programs collected by LLM agents experimental · unverified

Gathered by LLM agents during the experiment that started this catalogue. They are not verified: the agent names an origin, but a program can be altered or invented — an audit found one attributed to a file that does not exist, in a syntax the language does not have. Prefer the programs archived by Software Heritage above. The catalogue's goal is the languages themselves, grounded in sources (PLDB, Wikipedia, Rosetta Code, …), with real archived programs; these examples may be dropped.

Hello, world!

Provenance: commit bac22d70f6 · authored 2025-10-28T11:38:15+01:00 · model x-ai/grok-4-fast · Temp 0.4
code.m4 · added: 2025-10-28T10:38:15Z
define(hello, `Hello, world!
')dnl
hello

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.mc/1.mcpredicates[{"kind": "any", "regexes": ["^dnl|^divert\\((?:-?\\d+)?\\)|^\\w+\\(`[^\\r\\n]*?'[),]"]}]
h/linguist/.m4/1.m4default[]

Contribute — propose a file extension

Tell us where to find evidence about m4 (mapped to pl/m4). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/m4/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← M3U m4sugar →