Allow configuration of the 'Intel Syntax' per-compiler. Configure same for clang and icc

dev/git-series/gccdum
Matt Godbolt 8 years ago
parent 5d707a5b4e
commit 400e553116

@ -223,7 +223,8 @@ function configuredCompilers() {
name: props.get("gcc-explorer", base + ".name", name),
alias: props.get("gcc-explorer", base + ".alias"),
versionFlag: props.get("gcc-explorer", base + ".versionFlag"),
is6g: !!props.get("gcc-explorer", base + ".is6g", false)
is6g: !!props.get("gcc-explorer", base + ".is6g", false),
intelAsm: props.get("gcc-explorer", base + ".intelAsm", "")
});
}));
}
@ -237,7 +238,10 @@ function getCompilerInfo(compilerInfo) {
var versionFlag = compilerInfo.versionFlag || '--version';
child_process.exec(compiler + ' ' + versionFlag, function (err, output) {
if (err) return resolve(null);
var version = output.split('\n')[0];
compilerInfo.version = output.split('\n')[0];
if (compilerInfo.intelAsm) {
return resolve(compilerInfo);
}
child_process.exec(compiler + ' --target-help', function (err, output) {
var options = {};
if (!err) {
@ -248,8 +252,9 @@ function getCompilerInfo(compilerInfo) {
options[match[0]] = true;
});
}
compilerInfo.version = version;
compilerInfo.supportedOpts = options;
if (options['-masm']) {
compilerInfo.intelAsm="-masm=intel";
}
resolve(compilerInfo);
});
});

@ -15,12 +15,16 @@ compiler.g482.exe=/usr/bin/g++-4.8
compiler.g482.name=x86 gcc 4.8.2
compiler.clang350.exe=/usr/bin/clang++-3.5
compiler.clang350.name=x86 clang 3.5.0
compiler.clang350.intelAsm=-masm=intel
compiler.clang351.exe=/opt/clang+llvm-3.5.1-x86_64-linux-gnu/bin/clang++
compiler.clang351.name=x86 clang 3.5.1
compiler.clang351.intelAsm=-masm=intel
compiler.clang36x.exe=/usr/bin/clang++-3.6
compiler.clang36x.name=x86 clang 3.6 (rc2)
compiler.clang36x.intelAsm=-masm=intel
compiler.clang37x.exe=/usr/bin/clang++-3.7
compiler.clang37x.name=x86 clang 3.7 (experimental)
compiler.clang37x.intelAsm=-masm=intel
###############################
# GCC for ppc

@ -40,19 +40,24 @@ compiler.g490c2.name=x86 gcc 4.9.0 (w/concepts)
compiler.icc1301.exe=/opt/intel/bin/icc
compiler.icc1301.alias=/opt/intel/bin/icc
compiler.icc1301.name=x86 icc 13.0.1
compiler.icc1301.intelAsm=-masm=intel
# Clang for x86
compiler.clang30.exe=/usr/bin/clang++
compiler.clang30.alias=/usr/bin/clang++
compiler.clang30.name=x86 clang 3.0
compiler.clang30.intelAsm=-mllvm --x86-asm-syntax=intel
compiler.clang32.exe=/opt/clang-3.2/bin/clang++
compiler.clang32.alias=/opt/clang-3.2/bin/clang++
compiler.clang32.name=x86 clang 3.2
compiler.clang32.intelAsm=-mllvm --x86-asm-syntax=intel
compiler.clang33.exe=/opt/clang-3.3/bin/clang++
compiler.clang33.alias=/opt/clang-3.3/bin/clang++
compiler.clang33.name=x86 clang 3.3
compiler.clang33.intelAsm=-mllvm --x86-asm-syntax=intel
compiler.clang341.exe=/opt/clang+llvm-3.4.1-x86_64-unknown-ubuntu12.04/bin/clang++
compiler.clang341.alias=/opt/clang+llvm-3.4.1-x86_64-unknown-ubuntu12.04/bin/clang++
compiler.clang341.name=x86 clang 3.4.1
compiler.clang341.intelAsm=-mllvm --x86-asm-syntax=intel
###############################
# GCC for ARM

@ -2,10 +2,10 @@
#port=10240
compileTimeoutMs=5000
defaultCompiler=g46
#compilers=g44:g45:g46:clang34
compilers=go:6g
language=go
compileFilename=file.go
compilers=g44:g45:g46:clang35
#compilers=go:6g
#language=go
#compileFilename=file.go
compiler.go.exe=/usr/bin/gccgo
compiler.go.name=GCC go
compiler.6g.exe=/home/mgodbolt/build/go/pkg/tool/linux_amd64/6g
@ -21,8 +21,10 @@ compiler.g45.alias=/usr/bin/g++-4.5
compiler.g46.exe=/usr/bin/g++-4.6
compiler.g46.name=g++ 4.6
compiler.g46.alias=/usr/bin/g++-4.6
compiler.clang34.exe=/usr/bin/clang++-3.4
compiler.clang34.name=Clang 4.6
compiler.clang35.exe=/usr/bin/clang++-3.5
compiler.clang35.name=Clang 3.5
#compiler.clang35.intelAsm=-masm=intel
compiler.clang35.intelAsm=-mllvm --x86-asm-syntax=intel
#compilers=/usr/bin/g++-4.4:/usr/bin/g++-4.5:/usr/bin/g++-4.6:/usr/bin/g++-4.7:/usr/bin/clang++:/home/mgodbolt/apps/intel-icc-oss/bin/icc:/site/apps/gcc-4.7.2-drw.patched.6/bin/g++:/site/apps/gcc-4.8.0-drw.1/bin/g++
#compiler-wrapper=./c-preload/compiler-wrapper
#compilers=/usr/bin/gdc:/usr/bin/gdc-4.4:/usr/bin/gdc-4.6

@ -166,10 +166,8 @@ Compile.prototype.compile = function (source, compiler, options, filters) {
var dirPath = info.dirPath;
var postProcess = props.get("gcc-explorer", "postProcess");
var outputFilename = path.join(dirPath, 'output.S');
if (compilerInfo.supportedOpts['-masm']) {
var syntax = '-masm=att'; // default at&t
if (filters.intel) syntax = '-masm=intel';
options = options.concat([syntax]);
if (compilerInfo.intelAsm && filters.intel) {
options = options.concat(compilerInfo.intelAsm.split(" "));
}
var compileToAsm = props.get("gcc-explorer", "compileToAsm", "-S").split(" ");
options = options.concat(['-g', '-o', outputFilename]).concat(compileToAsm).concat([inputFilename]);

@ -292,7 +292,7 @@ function Compiler(domRoot, origFilters, windowLocalPrefix, onChangeCallback, lan
var compiler = compilersById[$('.compiler').val()];
if (compiler === undefined)
return;
domRoot.find('.filter button.btn[value="intel"]').toggleClass("disabled", !compiler.supportedOpts["-masm"]);
domRoot.find('.filter button.btn[value="intel"]').toggleClass("disabled", !compiler.intelAsm);
$(".compilerVersion").text(compiler.name + " (" + compiler.version + ")");
}

Loading…
Cancel
Save