tkchia / gcc-ia16

Fork of Lambertsen & Jenner (& al.)'s IA-16 (Intel 16-bit x86) port of GNU compilers ― added far pointers & more • use https://github.com/tkchia/build-ia16 to build • Ubuntu binaries at https://launchpad.net/%7Etkchia/+archive/ubuntu/build-ia16/ • DJGPP/MS-DOS binaries at https://gitlab.com/tkchia/build-ia16/-/releases • mirror of https://gitlab.com/tkchia/gcc-ia16
GNU General Public License v2.0
178 stars 13 forks source link

Does the compiler support 8087 hardware floating point instructions? #145

Open rationalism opened 10 months ago

rationalism commented 10 months ago

Am interested in using this, but haven't been able to find documentation. If I run ia16-elf-as --help on my machine, 8087 is listed under supported extensions:

  -march=CPU[,+EXTENSION...]
                          generate code for CPU and EXTENSION, CPU is one of:
                           default, push, pop, generic32, generic64, i386, i486,
                           i586, i686, pentium, pentiumpro, pentiumii,
                           pentiumiii, pentium4, prescott, nocona, core, core2,
                           corei7, iamcu, k6, k6_2, athlon, opteron, k8,
                           amdfam10, bdver1, bdver2, bdver3, bdver4, znver1,
                           znver2, znver3, btver1, btver2
                          EXTENSION is combination of (possibly "no"-prefixed):
                           8087, 287, 387, 687, cmov, fxsr, mmx, sse, sse2,
                           sse3, sse4a, ssse3, sse4.1, sse4.2, sse4, avx, avx2,
                           avx512f, avx512cd, avx512er, avx512pf, avx512dq,
                           avx512bw, avx512vl, vmx, vmfunc, smx, xsave,
                           xsaveopt, xsavec, xsaves, aes, pclmul, fsgsbase,
                           rdrnd, f16c, bmi2, fma, fma4, xop, lwp, movbe, cx16,
                           ept, lzcnt, popcnt, hle, rtm, invpcid, clflush, nop,
                           syscall, rdtscp, 3dnow, 3dnowa, padlock, svme, sse4a,
                           abm, bmi, tbm, adx, rdseed, prfchw, smap, mpx, sha,
                           clflushopt, prefetchwt1, se1, clwb, avx512ifma,
                           avx512vbmi, avx512_4fmaps, avx512_4vnniw,
                           avx512_vpopcntdq, avx512_vbmi2, avx512_vnni,
                           avx512_bitalg, avx_vnni, clzero, mwaitx, ospke,
                           rdpid, ptwrite, ibt, shstk, gfni, vaes, vpclmulqdq,
                           wbnoinvd, pconfig, waitpkg, cldemote, amx_int8,
                           amx_bf16, amx_tile, movdiri, movdir64b, avx512_bf16,
                           avx512_vp2intersect, tdx, enqcmd, serialize, rdpru,
                           mcommit, sev_es, tsxldtrk, kl, widekl, uintr, hreset,
                           avx512_fp16, no87

but I can't find the code for it anywhere in the repo. Thanks!

@tkchia

tkchia commented 10 months ago

Hello @rationalism,

Yes, unfortunately only the assembler knows about 8087 instructions — the compiler does not currently have support for producing 8087 instructions or keeping track of the 8087 register stack. For now, one possible way to produce 8087 instructions would be to use inline assembly.

Thank you!