comparison src/cpu/sparc/vm/sparc.ad @ 1041:f875b4f472f7

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
author twisti
date Tue, 27 Oct 2009 03:00:27 -0700
parents d40f03b57795
children 97125851f396
comparison
equal deleted inserted replaced
1040:873ec3787992 1041:f875b4f472f7
9417 // x |= (x >> 2); 9417 // x |= (x >> 2);
9418 // x |= (x >> 4); 9418 // x |= (x >> 4);
9419 // x |= (x >> 8); 9419 // x |= (x >> 8);
9420 // x |= (x >> 16); 9420 // x |= (x >> 16);
9421 // return (WORDBITS - popc(x)); 9421 // return (WORDBITS - popc(x));
9422 format %{ "SRL $src,1,$dst\t! count leading zeros (int)\n\t" 9422 format %{ "SRL $src,1,$tmp\t! count leading zeros (int)\n\t"
9423 "OR $src,$tmp,$dst\n\t" 9423 "SRL $src,0,$dst\t! 32-bit zero extend\n\t"
9424 "OR $dst,$tmp,$dst\n\t"
9424 "SRL $dst,2,$tmp\n\t" 9425 "SRL $dst,2,$tmp\n\t"
9425 "OR $dst,$tmp,$dst\n\t" 9426 "OR $dst,$tmp,$dst\n\t"
9426 "SRL $dst,4,$tmp\n\t" 9427 "SRL $dst,4,$tmp\n\t"
9427 "OR $dst,$tmp,$dst\n\t" 9428 "OR $dst,$tmp,$dst\n\t"
9428 "SRL $dst,8,$tmp\n\t" 9429 "SRL $dst,8,$tmp\n\t"
9435 ins_encode %{ 9436 ins_encode %{
9436 Register Rdst = $dst$$Register; 9437 Register Rdst = $dst$$Register;
9437 Register Rsrc = $src$$Register; 9438 Register Rsrc = $src$$Register;
9438 Register Rtmp = $tmp$$Register; 9439 Register Rtmp = $tmp$$Register;
9439 __ srl(Rsrc, 1, Rtmp); 9440 __ srl(Rsrc, 1, Rtmp);
9440 __ or3(Rsrc, Rtmp, Rdst); 9441 __ srl(Rsrc, 0, Rdst);
9442 __ or3(Rdst, Rtmp, Rdst);
9441 __ srl(Rdst, 2, Rtmp); 9443 __ srl(Rdst, 2, Rtmp);
9442 __ or3(Rdst, Rtmp, Rdst); 9444 __ or3(Rdst, Rtmp, Rdst);
9443 __ srl(Rdst, 4, Rtmp); 9445 __ srl(Rdst, 4, Rtmp);
9444 __ or3(Rdst, Rtmp, Rdst); 9446 __ or3(Rdst, Rtmp, Rdst);
9445 __ srl(Rdst, 8, Rtmp); 9447 __ srl(Rdst, 8, Rtmp);
9463 // x |= (x >> 4); 9465 // x |= (x >> 4);
9464 // x |= (x >> 8); 9466 // x |= (x >> 8);
9465 // x |= (x >> 16); 9467 // x |= (x >> 16);
9466 // x |= (x >> 32); 9468 // x |= (x >> 32);
9467 // return (WORDBITS - popc(x)); 9469 // return (WORDBITS - popc(x));
9468 format %{ "SRLX $src,1,$dst\t! count leading zeros (long)\n\t" 9470 format %{ "SRLX $src,1,$tmp\t! count leading zeros (long)\n\t"
9469 "OR $src,$tmp,$dst\n\t" 9471 "OR $src,$tmp,$dst\n\t"
9470 "SRLX $dst,2,$tmp\n\t" 9472 "SRLX $dst,2,$tmp\n\t"
9471 "OR $dst,$tmp,$dst\n\t" 9473 "OR $dst,$tmp,$dst\n\t"
9472 "SRLX $dst,4,$tmp\n\t" 9474 "SRLX $dst,4,$tmp\n\t"
9473 "OR $dst,$tmp,$dst\n\t" 9475 "OR $dst,$tmp,$dst\n\t"