mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
fix 64-bit shifts on x86_32 (part 2)
My earlier attempt (fa5d76b
) missed an important detail, and somehow I
forgot to test the 32-bit OpenJDK build which made that omission
obvious. Here's the fix.
This commit is contained in:
parent
3f039864d1
commit
24f682f5b6
12
src/x86.cpp
12
src/x86.cpp
@ -2186,9 +2186,9 @@ shiftLeftRR(Context* c, UNUSED unsigned aSize, Assembler::Register* a,
|
|||||||
unsigned bSize, Assembler::Register* b)
|
unsigned bSize, Assembler::Register* b)
|
||||||
{
|
{
|
||||||
if (TargetBytesPerWord == 4 and bSize == 8) {
|
if (TargetBytesPerWord == 4 and bSize == 8) {
|
||||||
|
Assembler::Register cx(rcx);
|
||||||
if (a->low != rcx) {
|
if (a->low != rcx) {
|
||||||
c->client->save(rcx);
|
c->client->save(rcx);
|
||||||
Assembler::Register cx(rcx);
|
|
||||||
ResolvedPromise promise(0x3F);
|
ResolvedPromise promise(0x3F);
|
||||||
Assembler::Constant mask(&promise);
|
Assembler::Constant mask(&promise);
|
||||||
moveRR(c, 4, a, 4, &cx);
|
moveRR(c, 4, a, 4, &cx);
|
||||||
@ -2204,7 +2204,7 @@ shiftLeftRR(Context* c, UNUSED unsigned aSize, Assembler::Register* a,
|
|||||||
|
|
||||||
ResolvedPromise promise(32);
|
ResolvedPromise promise(32);
|
||||||
Assembler::Constant constant(&promise);
|
Assembler::Constant constant(&promise);
|
||||||
compareCR(c, aSize, &constant, aSize, a);
|
compareCR(c, aSize, &constant, aSize, &cx);
|
||||||
|
|
||||||
opcode(c, 0x7c); //jl
|
opcode(c, 0x7c); //jl
|
||||||
c->code.append(2 + 2);
|
c->code.append(2 + 2);
|
||||||
@ -2232,9 +2232,9 @@ shiftRightRR(Context* c, UNUSED unsigned aSize, Assembler::Register* a,
|
|||||||
unsigned bSize, Assembler::Register* b)
|
unsigned bSize, Assembler::Register* b)
|
||||||
{
|
{
|
||||||
if (TargetBytesPerWord == 4 and bSize == 8) {
|
if (TargetBytesPerWord == 4 and bSize == 8) {
|
||||||
|
Assembler::Register cx(rcx);
|
||||||
if (a->low != rcx) {
|
if (a->low != rcx) {
|
||||||
c->client->save(rcx);
|
c->client->save(rcx);
|
||||||
Assembler::Register cx(rcx);
|
|
||||||
ResolvedPromise promise(0x3F);
|
ResolvedPromise promise(0x3F);
|
||||||
Assembler::Constant mask(&promise);
|
Assembler::Constant mask(&promise);
|
||||||
moveRR(c, 4, a, 4, &cx);
|
moveRR(c, 4, a, 4, &cx);
|
||||||
@ -2250,7 +2250,7 @@ shiftRightRR(Context* c, UNUSED unsigned aSize, Assembler::Register* a,
|
|||||||
|
|
||||||
ResolvedPromise promise(32);
|
ResolvedPromise promise(32);
|
||||||
Assembler::Constant constant(&promise);
|
Assembler::Constant constant(&promise);
|
||||||
compareCR(c, aSize, &constant, aSize, a);
|
compareCR(c, aSize, &constant, aSize, &cx);
|
||||||
|
|
||||||
opcode(c, 0x7c); //jl
|
opcode(c, 0x7c); //jl
|
||||||
c->code.append(2 + 3);
|
c->code.append(2 + 3);
|
||||||
@ -2281,9 +2281,9 @@ unsignedShiftRightRR(Context* c, UNUSED unsigned aSize, Assembler::Register* a,
|
|||||||
unsigned bSize, Assembler::Register* b)
|
unsigned bSize, Assembler::Register* b)
|
||||||
{
|
{
|
||||||
if (TargetBytesPerWord == 4 and bSize == 8) {
|
if (TargetBytesPerWord == 4 and bSize == 8) {
|
||||||
|
Assembler::Register cx(rcx);
|
||||||
if (a->low != rcx) {
|
if (a->low != rcx) {
|
||||||
c->client->save(rcx);
|
c->client->save(rcx);
|
||||||
Assembler::Register cx(rcx);
|
|
||||||
ResolvedPromise promise(0x3F);
|
ResolvedPromise promise(0x3F);
|
||||||
Assembler::Constant mask(&promise);
|
Assembler::Constant mask(&promise);
|
||||||
moveRR(c, 4, a, 4, &cx);
|
moveRR(c, 4, a, 4, &cx);
|
||||||
@ -2299,7 +2299,7 @@ unsignedShiftRightRR(Context* c, UNUSED unsigned aSize, Assembler::Register* a,
|
|||||||
|
|
||||||
ResolvedPromise promise(32);
|
ResolvedPromise promise(32);
|
||||||
Assembler::Constant constant(&promise);
|
Assembler::Constant constant(&promise);
|
||||||
compareCR(c, aSize, &constant, aSize, a);
|
compareCR(c, aSize, &constant, aSize, &cx);
|
||||||
|
|
||||||
opcode(c, 0x7c); //jl
|
opcode(c, 0x7c); //jl
|
||||||
c->code.append(2 + 2);
|
c->code.append(2 + 2);
|
||||||
|
@ -385,6 +385,10 @@ public class Longs {
|
|||||||
|
|
||||||
{ long b = 0xBEL; int x = 0; int y = 0xFF;
|
{ long b = 0xBEL; int x = 0; int y = 0xFF;
|
||||||
expect(((b >>> x) & y) == 0xBEL); }
|
expect(((b >>> x) & y) == 0xBEL); }
|
||||||
|
|
||||||
|
{ long b = 0xFFFFFFFFFFFFFFFFL; int s = 20;
|
||||||
|
expect((b >>> -s) == 0xFFFFF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user