提交 d2f200e4 编写于 作者: T twisti

6893554: SPECjvm2008 mpegaudio fails with SecurityException

Summary: The problem occurs with negative numbers, as the 32-bit input values are sign extended into the 64-bit registers.
Reviewed-by: kvn
上级 48160f7a
...@@ -9419,8 +9419,9 @@ instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{ ...@@ -9419,8 +9419,9 @@ instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{
// x |= (x >> 8); // x |= (x >> 8);
// x |= (x >> 16); // x |= (x >> 16);
// return (WORDBITS - popc(x)); // return (WORDBITS - popc(x));
format %{ "SRL $src,1,$dst\t! count leading zeros (int)\n\t" format %{ "SRL $src,1,$tmp\t! count leading zeros (int)\n\t"
"OR $src,$tmp,$dst\n\t" "SRL $src,0,$dst\t! 32-bit zero extend\n\t"
"OR $dst,$tmp,$dst\n\t"
"SRL $dst,2,$tmp\n\t" "SRL $dst,2,$tmp\n\t"
"OR $dst,$tmp,$dst\n\t" "OR $dst,$tmp,$dst\n\t"
"SRL $dst,4,$tmp\n\t" "SRL $dst,4,$tmp\n\t"
...@@ -9437,7 +9438,8 @@ instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{ ...@@ -9437,7 +9438,8 @@ instruct countLeadingZerosI(iRegI dst, iRegI src, iRegI tmp, flagsReg cr) %{
Register Rsrc = $src$$Register; Register Rsrc = $src$$Register;
Register Rtmp = $tmp$$Register; Register Rtmp = $tmp$$Register;
__ srl(Rsrc, 1, Rtmp); __ srl(Rsrc, 1, Rtmp);
__ or3(Rsrc, Rtmp, Rdst); __ srl(Rsrc, 0, Rdst);
__ or3(Rdst, Rtmp, Rdst);
__ srl(Rdst, 2, Rtmp); __ srl(Rdst, 2, Rtmp);
__ or3(Rdst, Rtmp, Rdst); __ or3(Rdst, Rtmp, Rdst);
__ srl(Rdst, 4, Rtmp); __ srl(Rdst, 4, Rtmp);
...@@ -9465,7 +9467,7 @@ instruct countLeadingZerosL(iRegI dst, iRegL src, iRegL tmp, flagsReg cr) %{ ...@@ -9465,7 +9467,7 @@ instruct countLeadingZerosL(iRegI dst, iRegL src, iRegL tmp, flagsReg cr) %{
// x |= (x >> 16); // x |= (x >> 16);
// x |= (x >> 32); // x |= (x >> 32);
// return (WORDBITS - popc(x)); // return (WORDBITS - popc(x));
format %{ "SRLX $src,1,$dst\t! count leading zeros (long)\n\t" format %{ "SRLX $src,1,$tmp\t! count leading zeros (long)\n\t"
"OR $src,$tmp,$dst\n\t" "OR $src,$tmp,$dst\n\t"
"SRLX $dst,2,$tmp\n\t" "SRLX $dst,2,$tmp\n\t"
"OR $dst,$tmp,$dst\n\t" "OR $dst,$tmp,$dst\n\t"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册