mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 00:46:02 +02:00
+ added compile time const evaluation for Bsf/Bsr(const) as well
git-svn-id: trunk@35941 -
This commit is contained in:
parent
da8e72b4fe
commit
5393daa994
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12104,6 +12104,7 @@ tests/test/tblock2a.pp svneol=native#text/plain
|
|||||||
tests/test/tbopr.pp svneol=native#text/plain
|
tests/test/tbopr.pp svneol=native#text/plain
|
||||||
tests/test/tbrtlevt.pp svneol=native#text/plain
|
tests/test/tbrtlevt.pp svneol=native#text/plain
|
||||||
tests/test/tbsx1.pp svneol=native#text/plain
|
tests/test/tbsx1.pp svneol=native#text/plain
|
||||||
|
tests/test/tbsx2.pp svneol=native#text/plain
|
||||||
tests/test/tcas128.pp svneol=native#text/pascal
|
tests/test/tcas128.pp svneol=native#text/pascal
|
||||||
tests/test/tcase0.pp svneol=native#text/pascal
|
tests/test/tcase0.pp svneol=native#text/pascal
|
||||||
tests/test/tcase1.pp svneol=native#text/plain
|
tests/test/tcase1.pp svneol=native#text/plain
|
||||||
|
@ -2534,6 +2534,42 @@ implementation
|
|||||||
in_ror_x,
|
in_ror_x,
|
||||||
in_ror_x_y :
|
in_ror_x_y :
|
||||||
result:=handle_const_rox;
|
result:=handle_const_rox;
|
||||||
|
in_bsf_x:
|
||||||
|
begin
|
||||||
|
if left.nodetype=ordconstn then
|
||||||
|
begin
|
||||||
|
case left.resultdef.size of
|
||||||
|
1:
|
||||||
|
result:=cordconstnode.create(BsfByte(Byte(tordconstnode(left).value.uvalue)),resultdef,false);
|
||||||
|
2:
|
||||||
|
result:=cordconstnode.create(BsfWord(Word(tordconstnode(left).value.uvalue)),resultdef,false);
|
||||||
|
4:
|
||||||
|
result:=cordconstnode.create(BsfDWord(DWord(tordconstnode(left).value.uvalue)),resultdef,false);
|
||||||
|
8:
|
||||||
|
result:=cordconstnode.create(BsfQWord(QWord(tordconstnode(left).value.uvalue)),resultdef,false);
|
||||||
|
else
|
||||||
|
internalerror(2017042401);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
in_bsr_x :
|
||||||
|
begin
|
||||||
|
if left.nodetype=ordconstn then
|
||||||
|
begin
|
||||||
|
case left.resultdef.size of
|
||||||
|
1:
|
||||||
|
result:=cordconstnode.create(BsrByte(Byte(tordconstnode(left).value.uvalue)),resultdef,false);
|
||||||
|
2:
|
||||||
|
result:=cordconstnode.create(BsrWord(Word(tordconstnode(left).value.uvalue)),resultdef,false);
|
||||||
|
4:
|
||||||
|
result:=cordconstnode.create(BsrDWord(DWord(tordconstnode(left).value.uvalue)),resultdef,false);
|
||||||
|
8:
|
||||||
|
result:=cordconstnode.create(BsrQWord(QWord(tordconstnode(left).value.uvalue)),resultdef,false);
|
||||||
|
else
|
||||||
|
internalerror(2017042401);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
in_popcnt_x :
|
in_popcnt_x :
|
||||||
begin
|
begin
|
||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
|
1530
tests/test/tbsx2.pp
Normal file
1530
tests/test/tbsx2.pp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user