* disable fix for #33439 during bootstrapping with 3.0.x, as 3.0.x cannot compile the currency division without the fix above
git-svn-id: trunk@38558 -
tmoddivnode.firstoptimize, replaced tordconstnode(right).value-1 with
tcgint((qword(1) shl power)-1), so that it becomes independent from the sign
of right, so that in the future, we can also apply this optimization for
negative power-of-2 divisors as well (only a unary minus node would have to
be inserted in this case).
git-svn-id: trunk@36845 -
lower CPUs. Instead of the (sar(temp,sizeof(temp)*8-1) and 1) expression, use
the equivalent, but simpler (temp shr (sizeof(temp)*8-1))
git-svn-id: trunk@36839 -
shiftval to left.resultdef.size*8-1, instead of 31, so that it shifts by 15 or
7 on 16-bit and 8-bit CPUs, when the integer type is small.
git-svn-id: trunk@36820 -
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
their enum name, instead of number
git-svn-id: trunk@36174 -
* tmoddivnode.first_moddivint does not force a 32 bit helper, the used helper depends now on the resultdef type set by tmoddivnode.pass_typecheck
git-svn-id: trunk@31195 -
"sign:=left sar sizeof(left)*8-1; result:=(((left xor sign)-sign) and 2**N-1) xor sign)-sign;"
This solution yields larger code than one suggested by Mantis #21152, however its speed on i386 is approximately the same, and it is also suitable for all operand sizes, all powers of two and all targets.
git-svn-id: trunk@27891 -
side constant with 31 (instead of 15 or 7), because that's how the 16-bit and
8-bit x86 shl/shr instructions behave (even on 16-bit CPUs like 286). The
change does not affect 32-bit and 64-bit platforms, because there the shift
is always done in at least 32 bits.
git-svn-id: trunk@27638 -
nmat.pas:
* correctly disable type checks if one of the arguments for MOD, DIV, SHR, SHL, NOT, -X and +X is a generic type parameter
+ added tests
git-svn-id: trunk@27535 -
* Fixed misplaced parentheses, which were preventing optimization of "unsigned mod power_of_two" into "and" expressions.
* Handling "signed div power_of_two": properly delete the temp node, removes warnings when compiled with "-dEXTDEBUG". This however requires another temp node for storing the result.
* Replaced direct calls to "fpc_sarint64" with inline nodes (in_sar_x_y), allowing target-specific optimizations to take place.
git-svn-id: trunk@25877 -
simplified via typeconvnode (corrects resultdef of "qword(1) shl 33",
mantis #22133)
* simplify shl/shr nodes after their resultdef has been set, so the
resultdef used during simplify is set (fixes same expression as above
when it is calculated by an inline function)
git-svn-id: trunk@21394 -
o support for the new codepage-aware ansistrings in the jvm branch
o empty ansistrings are now always represented by a nil pointer rather than
by an empty string, because an empty string also has a code page which
can confuse code (although this will make ansistrings harder to use
in Java code)
o more string helpers code shared between the general and jvm rtl
o support for indexbyte/word in the jvm rtl (warning: first parameter
is an open array rather than an untyped parameter there, so
indexchar(pcharvar^,10,0) will be equivalent to
indexchar[pcharvar^],10,0) there, which is different from what is
intended; changing it to an untyped parameter wouldn't help though)
o default() support is not yet complete
o calling fpcres is currently broken due to limitations in
sysutils.executeprocess() regarding handling unix quoting and
the compiler using the same command lines for scripts and directly
calling external programs
o compiling the Java compiler currently requires adding ALLOW_WARNINGS=1
to the make command line
git-svn-id: branches/jvmbackend@20887 -