compiler-construction

“Pentium-safe FDIV” … in year 2014?

浪尽此生 提交于 2021-01-27 04:13:29
问题 Everytime I look in the compiler settings, the same question comes into my mind: Why does the current compiler of Delphi still have the "Pentium-safe FDIV" compiler option? The Pentium-FDIV-Bug was found in November 1994 and did not occur in CPU models of 1995. Processors at this time were probably only strong enough work with Windows 95, 98 and maybe also Me. As far as I know, the first Intel Pentium 1 CPU with 133 MHz (and therefore fast enough to reach the minimum system requirements of

Bison one or more occurrences in grammar file

Deadly 提交于 2021-01-21 08:00:15
问题 My program that needs to be parsed should be of the form: program : [declaration]+ ; Which should mean: The program consists of one or more declarations. Declaration on its turn is of course defined in a similar way, and so on... Currently, I'm getting an error on the + from the Bison parser. How do I define the one or more condition in a correct way with bison? 回答1: One or more: declarations : declaration | declarations declaration ; Zero or more: declarations : /* empty */ | declarations

Restrict a routine to use a limited set of registers

倖福魔咒の 提交于 2021-01-20 09:32:47
问题 Using compiler option, is it possible to restrict a routine from using certain set of registers? For example: Restrict a routine to use only R0-R8; Purpose: If some compiler option available, then I could ensure certain routines (like Interrupt Service Routines) to use only limited register set, and thus do limited Context Save & Restore. 回答1: When this was last discussed, the consensus was that it is not possible on a function-by-function basis. There are ways to restrict register use

Switch statement with non-constant-expression - Extends C#/IDE ability

六月ゝ 毕业季﹏ 提交于 2020-12-29 13:12:36
问题 Before you start criticizing and pointing me §8.7.2 of C# specification, read carefully :) We all know how switch looks like in C#. Ok so consider the class MainWindow with "nasty" Bar method static int barCounter = 0; public static int Bar() { return ++barCounter; } Somewhere in this class we have code like this Action switchCode = () => { switch (Bar()) { case 1: Console.WriteLine("First"); break; case 2: Console.WriteLine("Second"); break; } }; switchCode(); switchCode(); In the console

Switch statement with non-constant-expression - Extends C#/IDE ability

假如想象 提交于 2020-12-29 13:10:50
问题 Before you start criticizing and pointing me §8.7.2 of C# specification, read carefully :) We all know how switch looks like in C#. Ok so consider the class MainWindow with "nasty" Bar method static int barCounter = 0; public static int Bar() { return ++barCounter; } Somewhere in this class we have code like this Action switchCode = () => { switch (Bar()) { case 1: Console.WriteLine("First"); break; case 2: Console.WriteLine("Second"); break; } }; switchCode(); switchCode(); In the console

Switch statement with non-constant-expression - Extends C#/IDE ability

早过忘川 提交于 2020-12-29 13:10:23
问题 Before you start criticizing and pointing me §8.7.2 of C# specification, read carefully :) We all know how switch looks like in C#. Ok so consider the class MainWindow with "nasty" Bar method static int barCounter = 0; public static int Bar() { return ++barCounter; } Somewhere in this class we have code like this Action switchCode = () => { switch (Bar()) { case 1: Console.WriteLine("First"); break; case 2: Console.WriteLine("Second"); break; } }; switchCode(); switchCode(); In the console

Switch statement with non-constant-expression - Extends C#/IDE ability

空扰寡人 提交于 2020-12-29 13:08:42
问题 Before you start criticizing and pointing me §8.7.2 of C# specification, read carefully :) We all know how switch looks like in C#. Ok so consider the class MainWindow with "nasty" Bar method static int barCounter = 0; public static int Bar() { return ++barCounter; } Somewhere in this class we have code like this Action switchCode = () => { switch (Bar()) { case 1: Console.WriteLine("First"); break; case 2: Console.WriteLine("Second"); break; } }; switchCode(); switchCode(); In the console

What is a clobber?

坚强是说给别人听的谎言 提交于 2020-12-29 09:55:56
问题 Clang TargetInfo has a method called getClobbers : Returns a string of target-specific clobbers, in LLVM format. So, what is a clobber? 回答1: A clobbered register is a register which is trashed i.e. modified in unpredictable way by inline assembler. This usually happens when you need a temp. register or use particular instruction which happens to modify some register as a by-product. Usually programmer explicitly declares registers which are clobbered by his inline asm code but some may be

What is a clobber?

给你一囗甜甜゛ 提交于 2020-12-29 09:52:04
问题 Clang TargetInfo has a method called getClobbers : Returns a string of target-specific clobbers, in LLVM format. So, what is a clobber? 回答1: A clobbered register is a register which is trashed i.e. modified in unpredictable way by inline assembler. This usually happens when you need a temp. register or use particular instruction which happens to modify some register as a by-product. Usually programmer explicitly declares registers which are clobbered by his inline asm code but some may be

What is a clobber?

不羁岁月 提交于 2020-12-29 09:51:14
问题 Clang TargetInfo has a method called getClobbers : Returns a string of target-specific clobbers, in LLVM format. So, what is a clobber? 回答1: A clobbered register is a register which is trashed i.e. modified in unpredictable way by inline assembler. This usually happens when you need a temp. register or use particular instruction which happens to modify some register as a by-product. Usually programmer explicitly declares registers which are clobbered by his inline asm code but some may be