From d4f7bff1ea85376278ab9fba63a59e02ea35c68d Mon Sep 17 00:00:00 2001 From: svenpanne Date: Wed, 17 Jun 2015 02:06:44 -0700 Subject: [PATCH] Replace OFFSET_OF with offsetof as far as possible. The remaining uses need some non-mechanical work: * non-standard-layout type, probably due to mixed access control * extended field designators Review URL: https://codereview.chromium.org/1173343006 Cr-Commit-Position: refs/heads/master@{#29071} --- src/arm/simulator-arm.cc | 2 +- src/arm64/simulator-arm64.cc | 2 +- src/base/macros.h | 9 +- src/deoptimizer.h | 14 +- src/global-handles.cc | 6 +- src/mips/simulator-mips.cc | 2 +- src/mips64/simulator-mips64.cc | 2 +- src/ppc/simulator-ppc.cc | 2 +- test/cctest/test-assembler-arm.cc | 184 +++--- test/cctest/test-assembler-mips.cc | 794 ++++++++++++------------ test/cctest/test-assembler-mips64.cc | 864 +++++++++++++-------------- test/cctest/test-assembler-ppc.cc | 88 +-- 12 files changed, 981 insertions(+), 988 deletions(-) diff --git a/src/arm/simulator-arm.cc b/src/arm/simulator-arm.cc index 1dd0e2021b..3a02ee0094 100644 --- a/src/arm/simulator-arm.cc +++ b/src/arm/simulator-arm.cc @@ -823,7 +823,7 @@ class Redirection { static Redirection* FromSwiInstruction(Instruction* swi_instruction) { char* addr_of_swi = reinterpret_cast(swi_instruction); char* addr_of_redirection = - addr_of_swi - OFFSET_OF(Redirection, swi_instruction_); + addr_of_swi - offsetof(Redirection, swi_instruction_); return reinterpret_cast(addr_of_redirection); } diff --git a/src/arm64/simulator-arm64.cc b/src/arm64/simulator-arm64.cc index da569625ca..29d3ea2419 100644 --- a/src/arm64/simulator-arm64.cc +++ b/src/arm64/simulator-arm64.cc @@ -490,7 +490,7 @@ class Redirection { static Redirection* FromHltInstruction(Instruction* redirect_call) { char* addr_of_hlt = reinterpret_cast(redirect_call); char* addr_of_redirection = - addr_of_hlt - OFFSET_OF(Redirection, redirect_call_); + addr_of_hlt - offsetof(Redirection, redirect_call_); return reinterpret_cast(addr_of_redirection); } diff --git a/src/base/macros.h b/src/base/macros.h index e98b4f569f..6dc96f4f3b 100644 --- a/src/base/macros.h +++ b/src/base/macros.h @@ -15,12 +15,9 @@ #include "src/base/logging.h" -// The expression OFFSET_OF(type, field) computes the byte-offset -// of the specified field relative to the containing type. This -// corresponds to 'offsetof' (in stddef.h), except that it doesn't -// use 0 or NULL, which causes a problem with the compiler warnings -// we have enabled (which is also why 'offsetof' doesn't seem to work). -// Here we simply use the aligned, non-zero value 16. +// TODO(all) Replace all uses of this macro with C++'s offsetof. To do that, we +// have to make sure that only standard-layout types and simple field +// designators are used. #define OFFSET_OF(type, field) \ (reinterpret_cast(&(reinterpret_cast(16)->field)) - 16) diff --git a/src/deoptimizer.h b/src/deoptimizer.h index 591505fd45..27665522bb 100644 --- a/src/deoptimizer.h +++ b/src/deoptimizer.h @@ -896,23 +896,19 @@ class FrameDescription { } static int frame_size_offset() { - return OFFSET_OF(FrameDescription, frame_size_); + return offsetof(FrameDescription, frame_size_); } - static int pc_offset() { - return OFFSET_OF(FrameDescription, pc_); - } + static int pc_offset() { return offsetof(FrameDescription, pc_); } - static int state_offset() { - return OFFSET_OF(FrameDescription, state_); - } + static int state_offset() { return offsetof(FrameDescription, state_); } static int continuation_offset() { - return OFFSET_OF(FrameDescription, continuation_); + return offsetof(FrameDescription, continuation_); } static int frame_content_offset() { - return OFFSET_OF(FrameDescription, frame_content_); + return offsetof(FrameDescription, frame_content_); } private: diff --git a/src/global-handles.cc b/src/global-handles.cc index 3bb7706eb5..aa6542baee 100644 --- a/src/global-handles.cc +++ b/src/global-handles.cc @@ -39,13 +39,13 @@ class GlobalHandles::Node { // Maps handle location (slot) to the containing node. static Node* FromLocation(Object** location) { - DCHECK(OFFSET_OF(Node, object_) == 0); + DCHECK(offsetof(Node, object_) == 0); return reinterpret_cast(location); } Node() { - DCHECK(OFFSET_OF(Node, class_id_) == Internals::kNodeClassIdOffset); - DCHECK(OFFSET_OF(Node, flags_) == Internals::kNodeFlagsOffset); + DCHECK(offsetof(Node, class_id_) == Internals::kNodeClassIdOffset); + DCHECK(offsetof(Node, flags_) == Internals::kNodeFlagsOffset); STATIC_ASSERT(static_cast(NodeState::kMask) == Internals::kNodeStateMask); STATIC_ASSERT(WEAK == Internals::kNodeStateIsWeakValue); diff --git a/src/mips/simulator-mips.cc b/src/mips/simulator-mips.cc index 54c6a71ceb..1148a7cff6 100644 --- a/src/mips/simulator-mips.cc +++ b/src/mips/simulator-mips.cc @@ -1035,7 +1035,7 @@ class Redirection { static Redirection* FromSwiInstruction(Instruction* swi_instruction) { char* addr_of_swi = reinterpret_cast(swi_instruction); char* addr_of_redirection = - addr_of_swi - OFFSET_OF(Redirection, swi_instruction_); + addr_of_swi - offsetof(Redirection, swi_instruction_); return reinterpret_cast(addr_of_redirection); } diff --git a/src/mips64/simulator-mips64.cc b/src/mips64/simulator-mips64.cc index 200a1bc80b..fee93a867a 100644 --- a/src/mips64/simulator-mips64.cc +++ b/src/mips64/simulator-mips64.cc @@ -965,7 +965,7 @@ class Redirection { static Redirection* FromSwiInstruction(Instruction* swi_instruction) { char* addr_of_swi = reinterpret_cast(swi_instruction); char* addr_of_redirection = - addr_of_swi - OFFSET_OF(Redirection, swi_instruction_); + addr_of_swi - offsetof(Redirection, swi_instruction_); return reinterpret_cast(addr_of_redirection); } diff --git a/src/ppc/simulator-ppc.cc b/src/ppc/simulator-ppc.cc index 118741bc32..261982c0b3 100644 --- a/src/ppc/simulator-ppc.cc +++ b/src/ppc/simulator-ppc.cc @@ -880,7 +880,7 @@ class Redirection { static Redirection* FromSwiInstruction(Instruction* swi_instruction) { char* addr_of_swi = reinterpret_cast(swi_instruction); char* addr_of_redirection = - addr_of_swi - OFFSET_OF(Redirection, swi_instruction_); + addr_of_swi - offsetof(Redirection, swi_instruction_); return reinterpret_cast(addr_of_redirection); } diff --git a/test/cctest/test-assembler-arm.cc b/test/cctest/test-assembler-arm.cc index cb89577991..59ebaab069 100644 --- a/test/cctest/test-assembler-arm.cc +++ b/test/cctest/test-assembler-arm.cc @@ -175,17 +175,17 @@ TEST(3) { __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); __ mov(r4, Operand(r0)); - __ ldr(r0, MemOperand(r4, OFFSET_OF(T, i))); + __ ldr(r0, MemOperand(r4, offsetof(T, i))); __ mov(r2, Operand(r0, ASR, 1)); - __ str(r2, MemOperand(r4, OFFSET_OF(T, i))); - __ ldrsb(r2, MemOperand(r4, OFFSET_OF(T, c))); + __ str(r2, MemOperand(r4, offsetof(T, i))); + __ ldrsb(r2, MemOperand(r4, offsetof(T, c))); __ add(r0, r2, Operand(r0)); __ mov(r2, Operand(r2, LSL, 2)); - __ strb(r2, MemOperand(r4, OFFSET_OF(T, c))); - __ ldrsh(r2, MemOperand(r4, OFFSET_OF(T, s))); + __ strb(r2, MemOperand(r4, offsetof(T, c))); + __ ldrsh(r2, MemOperand(r4, offsetof(T, s))); __ add(r0, r2, Operand(r0)); __ mov(r2, Operand(r2, ASR, 3)); - __ strh(r2, MemOperand(r4, OFFSET_OF(T, s))); + __ strh(r2, MemOperand(r4, offsetof(T, s))); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); CodeDesc desc; @@ -247,68 +247,68 @@ TEST(4) { __ sub(fp, ip, Operand(4)); __ mov(r4, Operand(r0)); - __ vldr(d6, r4, OFFSET_OF(T, a)); - __ vldr(d7, r4, OFFSET_OF(T, b)); + __ vldr(d6, r4, offsetof(T, a)); + __ vldr(d7, r4, offsetof(T, b)); __ vadd(d5, d6, d7); - __ vstr(d5, r4, OFFSET_OF(T, c)); + __ vstr(d5, r4, offsetof(T, c)); __ vmla(d5, d6, d7); __ vmls(d5, d5, d6); __ vmov(r2, r3, d5); __ vmov(d4, r2, r3); - __ vstr(d4, r4, OFFSET_OF(T, b)); + __ vstr(d4, r4, offsetof(T, b)); // Load t.x and t.y, switch values, and store back to the struct. - __ vldr(s0, r4, OFFSET_OF(T, x)); - __ vldr(s31, r4, OFFSET_OF(T, y)); + __ vldr(s0, r4, offsetof(T, x)); + __ vldr(s31, r4, offsetof(T, y)); __ vmov(s16, s0); __ vmov(s0, s31); __ vmov(s31, s16); - __ vstr(s0, r4, OFFSET_OF(T, x)); - __ vstr(s31, r4, OFFSET_OF(T, y)); + __ vstr(s0, r4, offsetof(T, x)); + __ vstr(s31, r4, offsetof(T, y)); // Move a literal into a register that can be encoded in the instruction. __ vmov(d4, 1.0); - __ vstr(d4, r4, OFFSET_OF(T, e)); + __ vstr(d4, r4, offsetof(T, e)); // Move a literal into a register that requires 64 bits to encode. // 0x3ff0000010000000 = 1.000000059604644775390625 __ vmov(d4, 1.000000059604644775390625); - __ vstr(d4, r4, OFFSET_OF(T, d)); + __ vstr(d4, r4, offsetof(T, d)); // Convert from floating point to integer. __ vmov(d4, 2.0); __ vcvt_s32_f64(s31, d4); - __ vstr(s31, r4, OFFSET_OF(T, i)); + __ vstr(s31, r4, offsetof(T, i)); // Convert from integer to floating point. __ mov(lr, Operand(42)); __ vmov(s31, lr); __ vcvt_f64_s32(d4, s31); - __ vstr(d4, r4, OFFSET_OF(T, f)); + __ vstr(d4, r4, offsetof(T, f)); // Convert from fixed point to floating point. __ mov(lr, Operand(2468)); __ vmov(s8, lr); __ vcvt_f64_s32(d4, 2); - __ vstr(d4, r4, OFFSET_OF(T, j)); + __ vstr(d4, r4, offsetof(T, j)); // Test vabs. - __ vldr(d1, r4, OFFSET_OF(T, g)); + __ vldr(d1, r4, offsetof(T, g)); __ vabs(d0, d1); - __ vstr(d0, r4, OFFSET_OF(T, g)); - __ vldr(d2, r4, OFFSET_OF(T, h)); + __ vstr(d0, r4, offsetof(T, g)); + __ vldr(d2, r4, offsetof(T, h)); __ vabs(d0, d2); - __ vstr(d0, r4, OFFSET_OF(T, h)); + __ vstr(d0, r4, offsetof(T, h)); // Test vneg. - __ vldr(d1, r4, OFFSET_OF(T, m)); + __ vldr(d1, r4, offsetof(T, m)); __ vneg(d0, d1); - __ vstr(d0, r4, OFFSET_OF(T, m)); - __ vldr(d1, r4, OFFSET_OF(T, n)); + __ vstr(d0, r4, offsetof(T, m)); + __ vldr(d1, r4, offsetof(T, n)); __ vneg(d0, d1); - __ vstr(d0, r4, OFFSET_OF(T, n)); + __ vstr(d0, r4, offsetof(T, n)); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); @@ -647,19 +647,19 @@ TEST(8) { __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); - __ add(r4, r0, Operand(OFFSET_OF(D, a))); + __ add(r4, r0, Operand(static_cast(offsetof(D, a)))); __ vldm(ia_w, r4, d0, d3); __ vldm(ia_w, r4, d4, d7); - __ add(r4, r0, Operand(OFFSET_OF(D, a))); + __ add(r4, r0, Operand(static_cast(offsetof(D, a)))); __ vstm(ia_w, r4, d6, d7); __ vstm(ia_w, r4, d0, d5); - __ add(r4, r1, Operand(OFFSET_OF(F, a))); + __ add(r4, r1, Operand(static_cast(offsetof(F, a)))); __ vldm(ia_w, r4, s0, s3); __ vldm(ia_w, r4, s4, s7); - __ add(r4, r1, Operand(OFFSET_OF(F, a))); + __ add(r4, r1, Operand(static_cast(offsetof(F, a)))); __ vstm(ia_w, r4, s6, s7); __ vstm(ia_w, r4, s0, s5); @@ -753,22 +753,22 @@ TEST(9) { __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); - __ add(r4, r0, Operand(OFFSET_OF(D, a))); + __ add(r4, r0, Operand(static_cast(offsetof(D, a)))); __ vldm(ia, r4, d0, d3); __ add(r4, r4, Operand(4 * 8)); __ vldm(ia, r4, d4, d7); - __ add(r4, r0, Operand(OFFSET_OF(D, a))); + __ add(r4, r0, Operand(static_cast(offsetof(D, a)))); __ vstm(ia, r4, d6, d7); __ add(r4, r4, Operand(2 * 8)); __ vstm(ia, r4, d0, d5); - __ add(r4, r1, Operand(OFFSET_OF(F, a))); + __ add(r4, r1, Operand(static_cast(offsetof(F, a)))); __ vldm(ia, r4, s0, s3); __ add(r4, r4, Operand(4 * 4)); __ vldm(ia, r4, s4, s7); - __ add(r4, r1, Operand(OFFSET_OF(F, a))); + __ add(r4, r1, Operand(static_cast(offsetof(F, a)))); __ vstm(ia, r4, s6, s7); __ add(r4, r4, Operand(2 * 4)); __ vstm(ia, r4, s0, s5); @@ -863,19 +863,19 @@ TEST(10) { __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); - __ add(r4, r0, Operand(OFFSET_OF(D, h) + 8)); + __ add(r4, r0, Operand(static_cast(offsetof(D, h)) + 8)); __ vldm(db_w, r4, d4, d7); __ vldm(db_w, r4, d0, d3); - __ add(r4, r0, Operand(OFFSET_OF(D, h) + 8)); + __ add(r4, r0, Operand(static_cast(offsetof(D, h)) + 8)); __ vstm(db_w, r4, d0, d5); __ vstm(db_w, r4, d6, d7); - __ add(r4, r1, Operand(OFFSET_OF(F, h) + 4)); + __ add(r4, r1, Operand(static_cast(offsetof(F, h)) + 4)); __ vldm(db_w, r4, s4, s7); __ vldm(db_w, r4, s0, s3); - __ add(r4, r1, Operand(OFFSET_OF(F, h) + 4)); + __ add(r4, r1, Operand(static_cast(offsetof(F, h)) + 4)); __ vstm(db_w, r4, s0, s5); __ vstm(db_w, r4, s6, s7); @@ -951,28 +951,28 @@ TEST(11) { Assembler assm(isolate, NULL, 0); // Test HeapObject untagging. - __ ldr(r1, MemOperand(r0, OFFSET_OF(I, a))); + __ ldr(r1, MemOperand(r0, offsetof(I, a))); __ mov(r1, Operand(r1, ASR, 1), SetCC); __ adc(r1, r1, Operand(r1), LeaveCC, cs); - __ str(r1, MemOperand(r0, OFFSET_OF(I, a))); + __ str(r1, MemOperand(r0, offsetof(I, a))); - __ ldr(r2, MemOperand(r0, OFFSET_OF(I, b))); + __ ldr(r2, MemOperand(r0, offsetof(I, b))); __ mov(r2, Operand(r2, ASR, 1), SetCC); __ adc(r2, r2, Operand(r2), LeaveCC, cs); - __ str(r2, MemOperand(r0, OFFSET_OF(I, b))); + __ str(r2, MemOperand(r0, offsetof(I, b))); // Test corner cases. __ mov(r1, Operand(0xffffffff)); __ mov(r2, Operand::Zero()); __ mov(r3, Operand(r1, ASR, 1), SetCC); // Set the carry. __ adc(r3, r1, Operand(r2)); - __ str(r3, MemOperand(r0, OFFSET_OF(I, c))); + __ str(r3, MemOperand(r0, offsetof(I, c))); __ mov(r1, Operand(0xffffffff)); __ mov(r2, Operand::Zero()); __ mov(r3, Operand(r2, ASR, 1), SetCC); // Unset the carry. __ adc(r3, r1, Operand(r2)); - __ str(r3, MemOperand(r0, OFFSET_OF(I, d))); + __ str(r3, MemOperand(r0, offsetof(I, d))); __ mov(pc, Operand(lr)); @@ -1048,9 +1048,9 @@ TEST(13) { // Load a, b, c into d16, d17, d18. __ mov(r4, Operand(r0)); - __ vldr(d16, r4, OFFSET_OF(T, a)); - __ vldr(d17, r4, OFFSET_OF(T, b)); - __ vldr(d18, r4, OFFSET_OF(T, c)); + __ vldr(d16, r4, offsetof(T, a)); + __ vldr(d17, r4, offsetof(T, b)); + __ vldr(d18, r4, offsetof(T, c)); __ vneg(d25, d16); __ vadd(d25, d25, d17); @@ -1066,12 +1066,12 @@ TEST(13) { // Store d16, d17, d18 into a, b, c. __ mov(r4, Operand(r0)); - __ vstr(d16, r4, OFFSET_OF(T, a)); - __ vstr(d17, r4, OFFSET_OF(T, b)); - __ vstr(d18, r4, OFFSET_OF(T, c)); + __ vstr(d16, r4, offsetof(T, a)); + __ vstr(d17, r4, offsetof(T, b)); + __ vstr(d18, r4, offsetof(T, c)); // Load x, y, z into d29-d31. - __ add(r4, r0, Operand(OFFSET_OF(T, x))); + __ add(r4, r0, Operand(static_cast(offsetof(T, x)))); __ vldm(ia_w, r4, d29, d31); // Swap d29 and d30 via r registers. @@ -1084,7 +1084,7 @@ TEST(13) { __ vcvt_f64_u32(d31, s1); // Store d29-d31 into x, y, z. - __ add(r4, r0, Operand(OFFSET_OF(T, x))); + __ add(r4, r0, Operand(static_cast(offsetof(T, x)))); __ vstm(ia_w, r4, d29, d31); // Move constants into d20, d21, d22 and store into i, j, k. @@ -1094,13 +1094,13 @@ TEST(13) { __ mov(r2, Operand(1079146608)); __ vmov(d22, VmovIndexLo, r1); __ vmov(d22, VmovIndexHi, r2); - __ add(r4, r0, Operand(OFFSET_OF(T, i))); + __ add(r4, r0, Operand(static_cast(offsetof(T, i)))); __ vstm(ia_w, r4, d20, d22); // Move d22 into low and high. __ vmov(r4, VmovIndexLo, d22); - __ str(r4, MemOperand(r0, OFFSET_OF(T, low))); + __ str(r4, MemOperand(r0, offsetof(T, low))); __ vmov(r4, VmovIndexHi, d22); - __ str(r4, MemOperand(r0, OFFSET_OF(T, high))); + __ str(r4, MemOperand(r0, offsetof(T, high))); __ ldm(ia_w, sp, r4.bit() | pc.bit()); @@ -1164,16 +1164,16 @@ TEST(14) { __ vmsr(r1); __ bind(&fpscr_done); - __ vldr(d0, r0, OFFSET_OF(T, left)); - __ vldr(d1, r0, OFFSET_OF(T, right)); + __ vldr(d0, r0, offsetof(T, left)); + __ vldr(d1, r0, offsetof(T, right)); __ vadd(d2, d0, d1); - __ vstr(d2, r0, OFFSET_OF(T, add_result)); + __ vstr(d2, r0, offsetof(T, add_result)); __ vsub(d2, d0, d1); - __ vstr(d2, r0, OFFSET_OF(T, sub_result)); + __ vstr(d2, r0, offsetof(T, sub_result)); __ vmul(d2, d0, d1); - __ vstr(d2, r0, OFFSET_OF(T, mul_result)); + __ vstr(d2, r0, offsetof(T, mul_result)); __ vdiv(d2, d0, d1); - __ vstr(d2, r0, OFFSET_OF(T, div_result)); + __ vstr(d2, r0, offsetof(T, div_result)); __ mov(pc, Operand(lr)); @@ -1264,23 +1264,23 @@ TEST(15) { __ stm(db_w, sp, r4.bit() | lr.bit()); // Move 32 bytes with neon. - __ add(r4, r0, Operand(OFFSET_OF(T, src0))); + __ add(r4, r0, Operand(static_cast(offsetof(T, src0)))); __ vld1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); - __ add(r4, r0, Operand(OFFSET_OF(T, dst0))); + __ add(r4, r0, Operand(static_cast(offsetof(T, dst0)))); __ vst1(Neon8, NeonListOperand(d0, 4), NeonMemOperand(r4)); // Expand 8 bytes into 8 words(16 bits). - __ add(r4, r0, Operand(OFFSET_OF(T, srcA0))); + __ add(r4, r0, Operand(static_cast(offsetof(T, srcA0)))); __ vld1(Neon8, NeonListOperand(d0), NeonMemOperand(r4)); __ vmovl(NeonU8, q0, d0); - __ add(r4, r0, Operand(OFFSET_OF(T, dstA0))); + __ add(r4, r0, Operand(static_cast(offsetof(T, dstA0)))); __ vst1(Neon8, NeonListOperand(d0, 2), NeonMemOperand(r4)); // The same expansion, but with different source and destination registers. - __ add(r4, r0, Operand(OFFSET_OF(T, srcA0))); + __ add(r4, r0, Operand(static_cast(offsetof(T, srcA0)))); __ vld1(Neon8, NeonListOperand(d1), NeonMemOperand(r4)); __ vmovl(NeonU8, q1, d1); - __ add(r4, r0, Operand(OFFSET_OF(T, dstA4))); + __ add(r4, r0, Operand(static_cast(offsetof(T, dstA4)))); __ vst1(Neon8, NeonListOperand(d2, 2), NeonMemOperand(r4)); __ ldm(ia_w, sp, r4.bit() | pc.bit()); @@ -1367,24 +1367,24 @@ TEST(16) { __ stm(db_w, sp, r4.bit() | lr.bit()); __ mov(r4, Operand(r0)); - __ ldr(r0, MemOperand(r4, OFFSET_OF(T, src0))); - __ ldr(r1, MemOperand(r4, OFFSET_OF(T, src1))); + __ ldr(r0, MemOperand(r4, offsetof(T, src0))); + __ ldr(r1, MemOperand(r4, offsetof(T, src1))); __ pkhbt(r2, r0, Operand(r1, LSL, 8)); - __ str(r2, MemOperand(r4, OFFSET_OF(T, dst0))); + __ str(r2, MemOperand(r4, offsetof(T, dst0))); __ pkhtb(r2, r0, Operand(r1, ASR, 8)); - __ str(r2, MemOperand(r4, OFFSET_OF(T, dst1))); + __ str(r2, MemOperand(r4, offsetof(T, dst1))); __ uxtb16(r2, r0, 8); - __ str(r2, MemOperand(r4, OFFSET_OF(T, dst2))); + __ str(r2, MemOperand(r4, offsetof(T, dst2))); __ uxtb(r2, r0, 8); - __ str(r2, MemOperand(r4, OFFSET_OF(T, dst3))); + __ str(r2, MemOperand(r4, offsetof(T, dst3))); - __ ldr(r0, MemOperand(r4, OFFSET_OF(T, src2))); + __ ldr(r0, MemOperand(r4, offsetof(T, src2))); __ uxtab(r2, r0, r1, 8); - __ str(r2, MemOperand(r4, OFFSET_OF(T, dst4))); + __ str(r2, MemOperand(r4, offsetof(T, dst4))); __ ldm(ia_w, sp, r4.bit() | pc.bit()); @@ -1461,11 +1461,11 @@ TEST(sdiv) { __ mov(r3, Operand(r0)); - __ ldr(r0, MemOperand(r3, OFFSET_OF(T, dividend))); - __ ldr(r1, MemOperand(r3, OFFSET_OF(T, divisor))); + __ ldr(r0, MemOperand(r3, offsetof(T, dividend))); + __ ldr(r1, MemOperand(r3, offsetof(T, divisor))); __ sdiv(r2, r0, r1); - __ str(r2, MemOperand(r3, OFFSET_OF(T, result))); + __ str(r2, MemOperand(r3, offsetof(T, result))); __ bx(lr); @@ -1525,11 +1525,11 @@ TEST(udiv) { __ mov(r3, Operand(r0)); - __ ldr(r0, MemOperand(r3, OFFSET_OF(T, dividend))); - __ ldr(r1, MemOperand(r3, OFFSET_OF(T, divisor))); + __ ldr(r0, MemOperand(r3, offsetof(T, dividend))); + __ ldr(r1, MemOperand(r3, offsetof(T, divisor))); __ sdiv(r2, r0, r1); - __ str(r2, MemOperand(r3, OFFSET_OF(T, result))); + __ str(r2, MemOperand(r3, offsetof(T, result))); __ bx(lr); @@ -1917,29 +1917,29 @@ TEST(ARMv8_vrintX) { __ mov(r4, Operand(r0)); // Test vrinta - __ vldr(d6, r4, OFFSET_OF(T, input)); + __ vldr(d6, r4, offsetof(T, input)); __ vrinta(d5, d6); - __ vstr(d5, r4, OFFSET_OF(T, ar)); + __ vstr(d5, r4, offsetof(T, ar)); // Test vrintn - __ vldr(d6, r4, OFFSET_OF(T, input)); + __ vldr(d6, r4, offsetof(T, input)); __ vrintn(d5, d6); - __ vstr(d5, r4, OFFSET_OF(T, nr)); + __ vstr(d5, r4, offsetof(T, nr)); // Test vrintp - __ vldr(d6, r4, OFFSET_OF(T, input)); + __ vldr(d6, r4, offsetof(T, input)); __ vrintp(d5, d6); - __ vstr(d5, r4, OFFSET_OF(T, pr)); + __ vstr(d5, r4, offsetof(T, pr)); // Test vrintm - __ vldr(d6, r4, OFFSET_OF(T, input)); + __ vldr(d6, r4, offsetof(T, input)); __ vrintm(d5, d6); - __ vstr(d5, r4, OFFSET_OF(T, mr)); + __ vstr(d5, r4, offsetof(T, mr)); // Test vrintz - __ vldr(d6, r4, OFFSET_OF(T, input)); + __ vldr(d6, r4, offsetof(T, input)); __ vrintz(d5, d6); - __ vstr(d5, r4, OFFSET_OF(T, zr)); + __ vstr(d5, r4, offsetof(T, zr)); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); diff --git a/test/cctest/test-assembler-mips.cc b/test/cctest/test-assembler-mips.cc index e159023347..3dd294573b 100644 --- a/test/cctest/test-assembler-mips.cc +++ b/test/cctest/test-assembler-mips.cc @@ -278,61 +278,61 @@ TEST(MIPS3) { Label L, C; // Double precision floating point instructions. - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); __ add_d(f8, f4, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, c)) ); // c = a + b. + __ sdc1(f8, MemOperand(a0, offsetof(T, c)) ); // c = a + b. __ mov_d(f10, f8); // c __ neg_d(f12, f6); // -b __ sub_d(f10, f10, f12); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, d)) ); // d = c - (-b). + __ sdc1(f10, MemOperand(a0, offsetof(T, d)) ); // d = c - (-b). - __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, b)) ); // b = a. + __ sdc1(f4, MemOperand(a0, offsetof(T, b)) ); // b = a. __ li(t0, 120); __ mtc1(t0, f14); __ cvt_d_w(f14, f14); // f14 = 120.0. __ mul_d(f10, f10, f14); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, e)) ); // e = d * 120 = 1.8066e16. + __ sdc1(f10, MemOperand(a0, offsetof(T, e)) ); // e = d * 120 = 1.8066e16. __ div_d(f12, f10, f4); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(T, f)) ); // f = e / a = 120.44. + __ sdc1(f12, MemOperand(a0, offsetof(T, f)) ); // f = e / a = 120.44. __ sqrt_d(f14, f12); - __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, g)) ); + __ sdc1(f14, MemOperand(a0, offsetof(T, g)) ); // g = sqrt(f) = 10.97451593465515908537 if (IsMipsArchVariant(kMips32r2)) { - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, h)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, i)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, h)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, i)) ); __ madd_d(f14, f6, f4, f6); - __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, h)) ); + __ sdc1(f14, MemOperand(a0, offsetof(T, h)) ); } // Single precision floating point instructions. - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fa)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(T, fb)) ); + __ lwc1(f4, MemOperand(a0, offsetof(T, fa)) ); + __ lwc1(f6, MemOperand(a0, offsetof(T, fb)) ); __ add_s(f8, f4, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(T, fc)) ); // fc = fa + fb. + __ swc1(f8, MemOperand(a0, offsetof(T, fc)) ); // fc = fa + fb. __ neg_s(f10, f6); // -fb __ sub_s(f10, f8, f10); - __ swc1(f10, MemOperand(a0, OFFSET_OF(T, fd)) ); // fd = fc - (-fb). + __ swc1(f10, MemOperand(a0, offsetof(T, fd)) ); // fd = fc - (-fb). - __ swc1(f4, MemOperand(a0, OFFSET_OF(T, fb)) ); // fb = fa. + __ swc1(f4, MemOperand(a0, offsetof(T, fb)) ); // fb = fa. __ li(t0, 120); __ mtc1(t0, f14); __ cvt_s_w(f14, f14); // f14 = 120.0. __ mul_s(f10, f10, f14); - __ swc1(f10, MemOperand(a0, OFFSET_OF(T, fe)) ); // fe = fd * 120 + __ swc1(f10, MemOperand(a0, offsetof(T, fe)) ); // fe = fd * 120 __ div_s(f12, f10, f4); - __ swc1(f12, MemOperand(a0, OFFSET_OF(T, ff)) ); // ff = fe / fa + __ swc1(f12, MemOperand(a0, offsetof(T, ff)) ); // ff = fe / fa __ sqrt_s(f14, f12); - __ swc1(f14, MemOperand(a0, OFFSET_OF(T, fg)) ); + __ swc1(f14, MemOperand(a0, offsetof(T, fg)) ); __ jr(ra); __ nop(); @@ -398,8 +398,8 @@ TEST(MIPS4) { Assembler assm(isolate, NULL, 0); Label L, C; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); // Swap f4 and f6, by using four integer registers, t0-t3. if (!IsFp64Mode()) { @@ -425,8 +425,8 @@ TEST(MIPS4) { __ mthc1(t3, f4); } // Store the swapped f4 and f5 back to memory. - __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, c)) ); + __ sdc1(f4, MemOperand(a0, offsetof(T, a)) ); + __ sdc1(f6, MemOperand(a0, offsetof(T, c)) ); __ jr(ra); __ nop(); @@ -466,30 +466,30 @@ TEST(MIPS5) { Label L, C; // Load all structure elements to registers. - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(T, i)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(T, j)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); + __ lw(t0, MemOperand(a0, offsetof(T, i)) ); + __ lw(t1, MemOperand(a0, offsetof(T, j)) ); // Convert double in f4 to int in element i. __ cvt_w_d(f8, f4); __ mfc1(t2, f8); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, i)) ); + __ sw(t2, MemOperand(a0, offsetof(T, i)) ); // Convert double in f6 to int in element j. __ cvt_w_d(f10, f6); __ mfc1(t3, f10); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, j)) ); + __ sw(t3, MemOperand(a0, offsetof(T, j)) ); // Convert int in original i (t0) to double in a. __ mtc1(t0, f12); __ cvt_d_w(f0, f12); - __ sdc1(f0, MemOperand(a0, OFFSET_OF(T, a)) ); + __ sdc1(f0, MemOperand(a0, offsetof(T, a)) ); // Convert int in original j (t1) to double in b. __ mtc1(t1, f14); __ cvt_d_w(f2, f14); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(T, b)) ); + __ sdc1(f2, MemOperand(a0, offsetof(T, b)) ); __ jr(ra); __ nop(); @@ -535,31 +535,31 @@ TEST(MIPS6) { Label L, C; // Basic word load/store. - __ lw(t0, MemOperand(a0, OFFSET_OF(T, ui)) ); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, r1)) ); + __ lw(t0, MemOperand(a0, offsetof(T, ui)) ); + __ sw(t0, MemOperand(a0, offsetof(T, r1)) ); // lh with positive data. - __ lh(t1, MemOperand(a0, OFFSET_OF(T, ui)) ); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, r2)) ); + __ lh(t1, MemOperand(a0, offsetof(T, ui)) ); + __ sw(t1, MemOperand(a0, offsetof(T, r2)) ); // lh with negative data. - __ lh(t2, MemOperand(a0, OFFSET_OF(T, si)) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, r3)) ); + __ lh(t2, MemOperand(a0, offsetof(T, si)) ); + __ sw(t2, MemOperand(a0, offsetof(T, r3)) ); // lhu with negative data. - __ lhu(t3, MemOperand(a0, OFFSET_OF(T, si)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, r4)) ); + __ lhu(t3, MemOperand(a0, offsetof(T, si)) ); + __ sw(t3, MemOperand(a0, offsetof(T, r4)) ); // lb with negative data. - __ lb(t4, MemOperand(a0, OFFSET_OF(T, si)) ); - __ sw(t4, MemOperand(a0, OFFSET_OF(T, r5)) ); + __ lb(t4, MemOperand(a0, offsetof(T, si)) ); + __ sw(t4, MemOperand(a0, offsetof(T, r5)) ); // sh writes only 1/2 of word. __ lui(t5, 0x3333); __ ori(t5, t5, 0x3333); - __ sw(t5, MemOperand(a0, OFFSET_OF(T, r6)) ); - __ lhu(t5, MemOperand(a0, OFFSET_OF(T, si)) ); - __ sh(t5, MemOperand(a0, OFFSET_OF(T, r6)) ); + __ sw(t5, MemOperand(a0, offsetof(T, r6)) ); + __ lhu(t5, MemOperand(a0, offsetof(T, si)) ); + __ sh(t5, MemOperand(a0, offsetof(T, r6)) ); __ jr(ra); __ nop(); @@ -615,8 +615,8 @@ TEST(MIPS7) { MacroAssembler assm(isolate, NULL, 0); Label neither_is_nan, less_than, outa_here; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); if (!IsMipsArchVariant(kMips32r6)) { __ c(UN, D, f4, f6); __ bc1f(&neither_is_nan); @@ -625,7 +625,7 @@ TEST(MIPS7) { __ bc1eqz(&neither_is_nan, f2); } __ nop(); - __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); + __ sw(zero_reg, MemOperand(a0, offsetof(T, result)) ); __ Branch(&outa_here); __ bind(&neither_is_nan); @@ -642,12 +642,12 @@ TEST(MIPS7) { } __ nop(); - __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); + __ sw(zero_reg, MemOperand(a0, offsetof(T, result)) ); __ Branch(&outa_here); __ bind(&less_than); __ Addu(t0, zero_reg, Operand(1)); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, result)) ); // Set true. + __ sw(t0, MemOperand(a0, offsetof(T, result)) ); // Set true. // This test-case should have additional tests. @@ -706,7 +706,7 @@ TEST(MIPS8) { MacroAssembler assm(isolate, NULL, 0); // Basic word load. - __ lw(t0, MemOperand(a0, OFFSET_OF(T, input)) ); + __ lw(t0, MemOperand(a0, offsetof(T, input)) ); // ROTR instruction (called through the Ror macro). __ Ror(t1, t0, 0x0004); @@ -718,13 +718,13 @@ TEST(MIPS8) { __ Ror(t7, t0, 0x001c); // Basic word store. - __ sw(t1, MemOperand(a0, OFFSET_OF(T, result_rotr_4)) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, result_rotr_8)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, result_rotr_12)) ); - __ sw(t4, MemOperand(a0, OFFSET_OF(T, result_rotr_16)) ); - __ sw(t5, MemOperand(a0, OFFSET_OF(T, result_rotr_20)) ); - __ sw(t6, MemOperand(a0, OFFSET_OF(T, result_rotr_24)) ); - __ sw(t7, MemOperand(a0, OFFSET_OF(T, result_rotr_28)) ); + __ sw(t1, MemOperand(a0, offsetof(T, result_rotr_4)) ); + __ sw(t2, MemOperand(a0, offsetof(T, result_rotr_8)) ); + __ sw(t3, MemOperand(a0, offsetof(T, result_rotr_12)) ); + __ sw(t4, MemOperand(a0, offsetof(T, result_rotr_16)) ); + __ sw(t5, MemOperand(a0, offsetof(T, result_rotr_20)) ); + __ sw(t6, MemOperand(a0, offsetof(T, result_rotr_24)) ); + __ sw(t7, MemOperand(a0, offsetof(T, result_rotr_28)) ); // ROTRV instruction (called through the Ror macro). __ li(t7, 0x0004); @@ -743,13 +743,13 @@ TEST(MIPS8) { __ Ror(t7, t0, t7); // Basic word store. - __ sw(t1, MemOperand(a0, OFFSET_OF(T, result_rotrv_4)) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, result_rotrv_8)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, result_rotrv_12)) ); - __ sw(t4, MemOperand(a0, OFFSET_OF(T, result_rotrv_16)) ); - __ sw(t5, MemOperand(a0, OFFSET_OF(T, result_rotrv_20)) ); - __ sw(t6, MemOperand(a0, OFFSET_OF(T, result_rotrv_24)) ); - __ sw(t7, MemOperand(a0, OFFSET_OF(T, result_rotrv_28)) ); + __ sw(t1, MemOperand(a0, offsetof(T, result_rotrv_4)) ); + __ sw(t2, MemOperand(a0, offsetof(T, result_rotrv_8)) ); + __ sw(t3, MemOperand(a0, offsetof(T, result_rotrv_12)) ); + __ sw(t4, MemOperand(a0, offsetof(T, result_rotrv_16)) ); + __ sw(t5, MemOperand(a0, offsetof(T, result_rotrv_20)) ); + __ sw(t6, MemOperand(a0, offsetof(T, result_rotrv_24)) ); + __ sw(t7, MemOperand(a0, offsetof(T, result_rotrv_28)) ); __ jr(ra); __ nop(); @@ -832,31 +832,31 @@ TEST(MIPS10) { // Load all structure elements to registers. // (f0, f1) = a (fp32), f0 = a (fp64) - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, a))); + __ ldc1(f0, MemOperand(a0, offsetof(T, a))); if (IsFp64Mode()) { __ mfc1(t0, f0); // t0 = f0(31..0) __ mfhc1(t1, f0); // t1 = sign_extend(f0(63..32)) - __ sw(t0, MemOperand(a0, OFFSET_OF(T, dbl_mant))); // dbl_mant = t0 - __ sw(t1, MemOperand(a0, OFFSET_OF(T, dbl_exp))); // dbl_exp = t1 + __ sw(t0, MemOperand(a0, offsetof(T, dbl_mant))); // dbl_mant = t0 + __ sw(t1, MemOperand(a0, offsetof(T, dbl_exp))); // dbl_exp = t1 } else { // Save the raw bits of the double. __ mfc1(t0, f0); // t0 = a1 __ mfc1(t1, f1); // t1 = a2 - __ sw(t0, MemOperand(a0, OFFSET_OF(T, dbl_mant))); // dbl_mant = t0 - __ sw(t1, MemOperand(a0, OFFSET_OF(T, dbl_exp))); // dbl_exp = t1 + __ sw(t0, MemOperand(a0, offsetof(T, dbl_mant))); // dbl_mant = t0 + __ sw(t1, MemOperand(a0, offsetof(T, dbl_exp))); // dbl_exp = t1 } // Convert double in f0 to word, save hi/lo parts. __ cvt_w_d(f0, f0); // a_word = (word)a __ mfc1(t0, f0); // f0 has a 32-bits word. t0 = a_word - __ sw(t0, MemOperand(a0, OFFSET_OF(T, word))); // word = a_word + __ sw(t0, MemOperand(a0, offsetof(T, word))); // word = a_word // Convert the b word to double b. - __ lw(t0, MemOperand(a0, OFFSET_OF(T, b_word))); + __ lw(t0, MemOperand(a0, offsetof(T, b_word))); __ mtc1(t0, f8); // f8 has a 32-bits word. __ cvt_d_w(f10, f8); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b))); + __ sdc1(f10, MemOperand(a0, offsetof(T, b))); __ jr(ra); __ nop(); @@ -911,80 +911,80 @@ TEST(MIPS11) { Assembler assm(isolate, NULL, 0); // Test all combinations of LWL and vAddr. - __ lw(t0, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ lwl(t0, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, lwl_0)) ); + __ lw(t0, MemOperand(a0, offsetof(T, reg_init)) ); + __ lwl(t0, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t0, MemOperand(a0, offsetof(T, lwl_0)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ lwl(t1, MemOperand(a0, OFFSET_OF(T, mem_init) + 1) ); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, lwl_1)) ); + __ lw(t1, MemOperand(a0, offsetof(T, reg_init)) ); + __ lwl(t1, MemOperand(a0, offsetof(T, mem_init) + 1) ); + __ sw(t1, MemOperand(a0, offsetof(T, lwl_1)) ); - __ lw(t2, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ lwl(t2, MemOperand(a0, OFFSET_OF(T, mem_init) + 2) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, lwl_2)) ); + __ lw(t2, MemOperand(a0, offsetof(T, reg_init)) ); + __ lwl(t2, MemOperand(a0, offsetof(T, mem_init) + 2) ); + __ sw(t2, MemOperand(a0, offsetof(T, lwl_2)) ); - __ lw(t3, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ lwl(t3, MemOperand(a0, OFFSET_OF(T, mem_init) + 3) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, lwl_3)) ); + __ lw(t3, MemOperand(a0, offsetof(T, reg_init)) ); + __ lwl(t3, MemOperand(a0, offsetof(T, mem_init) + 3) ); + __ sw(t3, MemOperand(a0, offsetof(T, lwl_3)) ); // Test all combinations of LWR and vAddr. - __ lw(t0, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ lwr(t0, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, lwr_0)) ); + __ lw(t0, MemOperand(a0, offsetof(T, reg_init)) ); + __ lwr(t0, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t0, MemOperand(a0, offsetof(T, lwr_0)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ lwr(t1, MemOperand(a0, OFFSET_OF(T, mem_init) + 1) ); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, lwr_1)) ); + __ lw(t1, MemOperand(a0, offsetof(T, reg_init)) ); + __ lwr(t1, MemOperand(a0, offsetof(T, mem_init) + 1) ); + __ sw(t1, MemOperand(a0, offsetof(T, lwr_1)) ); - __ lw(t2, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ lwr(t2, MemOperand(a0, OFFSET_OF(T, mem_init) + 2) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, lwr_2)) ); + __ lw(t2, MemOperand(a0, offsetof(T, reg_init)) ); + __ lwr(t2, MemOperand(a0, offsetof(T, mem_init) + 2) ); + __ sw(t2, MemOperand(a0, offsetof(T, lwr_2)) ); - __ lw(t3, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ lwr(t3, MemOperand(a0, OFFSET_OF(T, mem_init) + 3) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, lwr_3)) ); + __ lw(t3, MemOperand(a0, offsetof(T, reg_init)) ); + __ lwr(t3, MemOperand(a0, offsetof(T, mem_init) + 3) ); + __ sw(t3, MemOperand(a0, offsetof(T, lwr_3)) ); // Test all combinations of SWL and vAddr. - __ lw(t0, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, swl_0)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ swl(t0, MemOperand(a0, OFFSET_OF(T, swl_0)) ); + __ lw(t0, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t0, MemOperand(a0, offsetof(T, swl_0)) ); + __ lw(t0, MemOperand(a0, offsetof(T, reg_init)) ); + __ swl(t0, MemOperand(a0, offsetof(T, swl_0)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, swl_1)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ swl(t1, MemOperand(a0, OFFSET_OF(T, swl_1) + 1) ); + __ lw(t1, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t1, MemOperand(a0, offsetof(T, swl_1)) ); + __ lw(t1, MemOperand(a0, offsetof(T, reg_init)) ); + __ swl(t1, MemOperand(a0, offsetof(T, swl_1) + 1) ); - __ lw(t2, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, swl_2)) ); - __ lw(t2, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ swl(t2, MemOperand(a0, OFFSET_OF(T, swl_2) + 2) ); + __ lw(t2, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t2, MemOperand(a0, offsetof(T, swl_2)) ); + __ lw(t2, MemOperand(a0, offsetof(T, reg_init)) ); + __ swl(t2, MemOperand(a0, offsetof(T, swl_2) + 2) ); - __ lw(t3, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, swl_3)) ); - __ lw(t3, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ swl(t3, MemOperand(a0, OFFSET_OF(T, swl_3) + 3) ); + __ lw(t3, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t3, MemOperand(a0, offsetof(T, swl_3)) ); + __ lw(t3, MemOperand(a0, offsetof(T, reg_init)) ); + __ swl(t3, MemOperand(a0, offsetof(T, swl_3) + 3) ); // Test all combinations of SWR and vAddr. - __ lw(t0, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, swr_0)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ swr(t0, MemOperand(a0, OFFSET_OF(T, swr_0)) ); + __ lw(t0, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t0, MemOperand(a0, offsetof(T, swr_0)) ); + __ lw(t0, MemOperand(a0, offsetof(T, reg_init)) ); + __ swr(t0, MemOperand(a0, offsetof(T, swr_0)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, swr_1)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ swr(t1, MemOperand(a0, OFFSET_OF(T, swr_1) + 1) ); + __ lw(t1, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t1, MemOperand(a0, offsetof(T, swr_1)) ); + __ lw(t1, MemOperand(a0, offsetof(T, reg_init)) ); + __ swr(t1, MemOperand(a0, offsetof(T, swr_1) + 1) ); - __ lw(t2, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, swr_2)) ); - __ lw(t2, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ swr(t2, MemOperand(a0, OFFSET_OF(T, swr_2) + 2) ); + __ lw(t2, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t2, MemOperand(a0, offsetof(T, swr_2)) ); + __ lw(t2, MemOperand(a0, offsetof(T, reg_init)) ); + __ swr(t2, MemOperand(a0, offsetof(T, swr_2) + 2) ); - __ lw(t3, MemOperand(a0, OFFSET_OF(T, mem_init)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, swr_3)) ); - __ lw(t3, MemOperand(a0, OFFSET_OF(T, reg_init)) ); - __ swr(t3, MemOperand(a0, OFFSET_OF(T, swr_3) + 3) ); + __ lw(t3, MemOperand(a0, offsetof(T, mem_init)) ); + __ sw(t3, MemOperand(a0, offsetof(T, swr_3)) ); + __ lw(t3, MemOperand(a0, offsetof(T, reg_init)) ); + __ swr(t3, MemOperand(a0, offsetof(T, swr_3) + 3) ); __ jr(ra); __ nop(); @@ -1065,8 +1065,8 @@ TEST(MIPS12) { __ mov(t6, fp); // Save frame pointer. __ mov(fp, a0); // Access struct T by fp. - __ lw(t0, MemOperand(a0, OFFSET_OF(T, y)) ); - __ lw(t3, MemOperand(a0, OFFSET_OF(T, y4)) ); + __ lw(t0, MemOperand(a0, offsetof(T, y)) ); + __ lw(t3, MemOperand(a0, offsetof(T, y4)) ); __ addu(t1, t0, t3); __ subu(t4, t0, t3); @@ -1084,30 +1084,30 @@ TEST(MIPS12) { __ push(t3); __ pop(t4); __ nop(); - __ sw(t0, MemOperand(fp, OFFSET_OF(T, y)) ); - __ lw(t0, MemOperand(fp, OFFSET_OF(T, y)) ); + __ sw(t0, MemOperand(fp, offsetof(T, y)) ); + __ lw(t0, MemOperand(fp, offsetof(T, y)) ); __ nop(); - __ sw(t0, MemOperand(fp, OFFSET_OF(T, y)) ); - __ lw(t1, MemOperand(fp, OFFSET_OF(T, y)) ); + __ sw(t0, MemOperand(fp, offsetof(T, y)) ); + __ lw(t1, MemOperand(fp, offsetof(T, y)) ); __ nop(); __ push(t1); - __ lw(t1, MemOperand(fp, OFFSET_OF(T, y)) ); + __ lw(t1, MemOperand(fp, offsetof(T, y)) ); __ pop(t1); __ nop(); __ push(t1); - __ lw(t2, MemOperand(fp, OFFSET_OF(T, y)) ); + __ lw(t2, MemOperand(fp, offsetof(T, y)) ); __ pop(t1); __ nop(); __ push(t1); - __ lw(t2, MemOperand(fp, OFFSET_OF(T, y)) ); + __ lw(t2, MemOperand(fp, offsetof(T, y)) ); __ pop(t2); __ nop(); __ push(t2); - __ lw(t2, MemOperand(fp, OFFSET_OF(T, y)) ); + __ lw(t2, MemOperand(fp, offsetof(T, y)) ); __ pop(t1); __ nop(); __ push(t1); - __ lw(t2, MemOperand(fp, OFFSET_OF(T, y)) ); + __ lw(t2, MemOperand(fp, offsetof(T, y)) ); __ pop(t3); __ nop(); @@ -1152,19 +1152,19 @@ TEST(MIPS13) { MacroAssembler assm(isolate, NULL, 0); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, cvt_small_in))); + __ sw(t0, MemOperand(a0, offsetof(T, cvt_small_in))); __ Cvt_d_uw(f10, t0, f22); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, cvt_small_out))); + __ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out))); __ Trunc_uw_d(f10, f10, f22); - __ swc1(f10, MemOperand(a0, OFFSET_OF(T, trunc_small_out))); + __ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out))); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, cvt_big_in))); + __ sw(t0, MemOperand(a0, offsetof(T, cvt_big_in))); __ Cvt_d_uw(f8, t0, f22); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, cvt_big_out))); + __ sdc1(f8, MemOperand(a0, offsetof(T, cvt_big_out))); __ Trunc_uw_d(f8, f8, f22); - __ swc1(f8, MemOperand(a0, OFFSET_OF(T, trunc_big_out))); + __ swc1(f8, MemOperand(a0, offsetof(T, trunc_big_out))); __ jr(ra); __ nop(); @@ -1234,46 +1234,46 @@ TEST(MIPS14) { // Disable FPU exceptions. __ ctc1(zero_reg, FCSR); #define RUN_ROUND_TEST(x) \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, round_up_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, round_up_in))); \ __ x##_w_d(f0, f0); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_up_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, x##_up_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, round_down_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, round_down_in))); \ __ x##_w_d(f0, f0); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_down_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, x##_down_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, neg_round_up_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, neg_round_up_in))); \ __ x##_w_d(f0, f0); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, neg_##x##_up_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, neg_##x##_up_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, neg_round_down_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, neg_round_down_in))); \ __ x##_w_d(f0, f0); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, neg_##x##_down_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, neg_##x##_down_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err1_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, err1_in))); \ __ ctc1(zero_reg, FCSR); \ __ x##_w_d(f0, f0); \ __ cfc1(a2, FCSR); \ - __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err1_out))); \ + __ sw(a2, MemOperand(a0, offsetof(T, x##_err1_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err2_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, err2_in))); \ __ ctc1(zero_reg, FCSR); \ __ x##_w_d(f0, f0); \ __ cfc1(a2, FCSR); \ - __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err2_out))); \ + __ sw(a2, MemOperand(a0, offsetof(T, x##_err2_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err3_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, err3_in))); \ __ ctc1(zero_reg, FCSR); \ __ x##_w_d(f0, f0); \ __ cfc1(a2, FCSR); \ - __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err3_out))); \ + __ sw(a2, MemOperand(a0, offsetof(T, x##_err3_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err4_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, err4_in))); \ __ ctc1(zero_reg, FCSR); \ __ x##_w_d(f0, f0); \ __ cfc1(a2, FCSR); \ - __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err4_out))); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_invalid_result))); + __ sw(a2, MemOperand(a0, offsetof(T, x##_err4_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, x##_invalid_result))); RUN_ROUND_TEST(round) RUN_ROUND_TEST(floor) @@ -1364,26 +1364,26 @@ TEST(seleqz_selnez) { // Integer part of test. __ addiu(t1, zero_reg, 1); // t1 = 1 __ seleqz(t3, t1, zero_reg); // t3 = 1 - __ sw(t3, MemOperand(a0, OFFSET_OF(Test, a))); // a = 1 + __ sw(t3, MemOperand(a0, offsetof(Test, a))); // a = 1 __ seleqz(t2, t1, t1); // t2 = 0 - __ sw(t2, MemOperand(a0, OFFSET_OF(Test, b))); // b = 0 + __ sw(t2, MemOperand(a0, offsetof(Test, b))); // b = 0 __ selnez(t3, t1, zero_reg); // t3 = 1; - __ sw(t3, MemOperand(a0, OFFSET_OF(Test, c))); // c = 0 + __ sw(t3, MemOperand(a0, offsetof(Test, c))); // c = 0 __ selnez(t3, t1, t1); // t3 = 1 - __ sw(t3, MemOperand(a0, OFFSET_OF(Test, d))); // d = 1 + __ sw(t3, MemOperand(a0, offsetof(Test, d))); // d = 1 // Floating point part of test. - __ ldc1(f0, MemOperand(a0, OFFSET_OF(Test, e)) ); // src - __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, f)) ); // test - __ lwc1(f8, MemOperand(a0, OFFSET_OF(Test, i)) ); // src - __ lwc1(f10, MemOperand(a0, OFFSET_OF(Test, j)) ); // test + __ ldc1(f0, MemOperand(a0, offsetof(Test, e)) ); // src + __ ldc1(f2, MemOperand(a0, offsetof(Test, f)) ); // test + __ lwc1(f8, MemOperand(a0, offsetof(Test, i)) ); // src + __ lwc1(f10, MemOperand(a0, offsetof(Test, j)) ); // test __ seleqz_d(f4, f0, f2); __ selnez_d(f6, f0, f2); __ seleqz_s(f12, f8, f10); __ selnez_s(f14, f8, f10); - __ sdc1(f4, MemOperand(a0, OFFSET_OF(Test, g)) ); // src - __ sdc1(f6, MemOperand(a0, OFFSET_OF(Test, h)) ); // src - __ swc1(f12, MemOperand(a0, OFFSET_OF(Test, k)) ); // src - __ swc1(f14, MemOperand(a0, OFFSET_OF(Test, l)) ); // src + __ sdc1(f4, MemOperand(a0, offsetof(Test, g)) ); // src + __ sdc1(f6, MemOperand(a0, offsetof(Test, h)) ); // src + __ swc1(f12, MemOperand(a0, offsetof(Test, k)) ); // src + __ swc1(f14, MemOperand(a0, offsetof(Test, l)) ); // src __ jr(ra); __ nop(); CodeDesc desc; @@ -1471,18 +1471,18 @@ TEST(min_max) { float outputsfmin[tableLength] = {2.0, 2.0, 3.0, 3.0, fltNaN}; float outputsfmax[tableLength] = {3.0, 3.0, 3.0, 3.0, fltNaN}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b))); - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, e))); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, f))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a))); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, b))); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, e))); + __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, f))); __ min_d(f10, f4, f8); __ max_d(f12, f4, f8); __ min_s(f14, f2, f6); __ max_s(f16, f2, f6); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, c))); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, d))); - __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, g))); - __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, h))); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, c))); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, d))); + __ swc1(f14, MemOperand(a0, offsetof(TestFloat, g))); + __ swc1(f16, MemOperand(a0, offsetof(TestFloat, h))); __ jr(ra); __ nop(); @@ -1593,12 +1593,12 @@ TEST(rint_d) { int fcsr_inputs[4] = {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; double* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lw(t0, MemOperand(a0, offsetof(TestFloat, fcsr)) ); __ cfc1(t1, FCSR); __ ctc1(t0, FCSR); __ rint_d(f8, f4); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); + __ sdc1(f8, MemOperand(a0, offsetof(TestFloat, b)) ); __ ctc1(t1, FCSR); __ jr(ra); __ nop(); @@ -1638,16 +1638,16 @@ TEST(sel) { } Test; Test test; - __ ldc1(f0, MemOperand(a0, OFFSET_OF(Test, dd)) ); // test - __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, ds)) ); // src1 - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, dt)) ); // src2 - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, fd)) ); // test - __ lwc1(f8, MemOperand(a0, OFFSET_OF(Test, fs)) ); // src1 - __ lwc1(f10, MemOperand(a0, OFFSET_OF(Test, ft)) ); // src2 + __ ldc1(f0, MemOperand(a0, offsetof(Test, dd)) ); // test + __ ldc1(f2, MemOperand(a0, offsetof(Test, ds)) ); // src1 + __ ldc1(f4, MemOperand(a0, offsetof(Test, dt)) ); // src2 + __ lwc1(f6, MemOperand(a0, offsetof(Test, fd)) ); // test + __ lwc1(f8, MemOperand(a0, offsetof(Test, fs)) ); // src1 + __ lwc1(f10, MemOperand(a0, offsetof(Test, ft)) ); // src2 __ sel_d(f0, f2, f4); __ sel_s(f6, f8, f10); - __ sdc1(f0, MemOperand(a0, OFFSET_OF(Test, dd)) ); - __ swc1(f6, MemOperand(a0, OFFSET_OF(Test, fd)) ); + __ sdc1(f0, MemOperand(a0, offsetof(Test, dd)) ); + __ swc1(f6, MemOperand(a0, offsetof(Test, fd)) ); __ jr(ra); __ nop(); CodeDesc desc; @@ -1772,12 +1772,12 @@ TEST(rint_s) { int fcsr_inputs[4] = {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; float* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lw(t0, MemOperand(a0, offsetof(TestFloat, fcsr)) ); __ cfc1(t1, FCSR); __ ctc1(t0, FCSR); __ rint_s(f8, f4); - __ swc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); + __ swc1(f8, MemOperand(a0, offsetof(TestFloat, b)) ); __ ctc1(t1, FCSR); __ jr(ra); __ nop(); @@ -1869,18 +1869,18 @@ TEST(mina_maxa) { -10.0, -11.2, -9.8 }; - __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); - __ lwc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); - __ lwc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); + __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, b)) ); + __ lwc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); + __ lwc1(f10, MemOperand(a0, offsetof(TestFloat, d)) ); __ mina_d(f6, f2, f4); __ mina_s(f12, f8, f10); __ maxa_d(f14, f2, f4); __ maxa_s(f16, f8, f10); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resf)) ); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resd)) ); - __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, resf1)) ); - __ sdc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, resd1)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, resf)) ); + __ sdc1(f6, MemOperand(a0, offsetof(TestFloat, resd)) ); + __ swc1(f16, MemOperand(a0, offsetof(TestFloat, resf1)) ); + __ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resd1)) ); __ jr(ra); __ nop(); @@ -1939,12 +1939,12 @@ TEST(trunc_l) { 2147483648.0, dFPU64InvalidResult, dFPU64InvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ trunc_l_d(f8, f4); __ trunc_l_s(f10, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2001,26 +2001,26 @@ TEST(movz_movn) { 5.3, -5.3, 5.3, -2.9 }; - __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, rt)) ); + __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) ); + __ lw(t0, MemOperand(a0, offsetof(TestFloat, rt)) ); __ li(t1, 0x0); __ mtc1(t1, f12); __ mtc1(t1, f10); __ mtc1(t1, f16); __ mtc1(t1, f14); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, bold)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dold)) ); - __ sdc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, bold1)) ); - __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, dold1)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, bold)) ); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, dold)) ); + __ sdc1(f16, MemOperand(a0, offsetof(TestFloat, bold1)) ); + __ swc1(f14, MemOperand(a0, offsetof(TestFloat, dold1)) ); __ movz_s(f10, f6, t0); __ movz_d(f12, f2, t0); __ movn_s(f14, f6, t0); __ movn_d(f16, f2, t0); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); - __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, d1)) ); - __ sdc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, b1)) ); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, d)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, b)) ); + __ swc1(f14, MemOperand(a0, offsetof(TestFloat, d1)) ); + __ sdc1(f16, MemOperand(a0, offsetof(TestFloat, b1)) ); __ jr(ra); __ nop(); @@ -2101,26 +2101,26 @@ TEST(movt_movd) { } HandleScope scope(isolate); MacroAssembler assm(isolate, NULL, 0); - __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, srcd)) ); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, srcf)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); + __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, srcd)) ); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, srcf)) ); + __ lw(t1, MemOperand(a0, offsetof(TestFloat, fcsr)) ); __ cfc1(t0, FCSR); __ ctc1(t1, FCSR); __ li(t2, 0x0); __ mtc1(t2, f12); __ mtc1(t2, f10); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstdold)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstfold)) ); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstdold)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstfold)) ); __ movt_s(f12, f4, test.cc); __ movt_d(f10, f2, test.cc); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstf)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstd)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstdold1)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstfold1)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstf)) ); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstd)) ); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstdold1)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstfold1)) ); __ movf_s(f12, f4, test.cc); __ movf_d(f10, f2, test.cc); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstf1)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstd1)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstf1)) ); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstd1)) ); __ ctc1(t0, FCSR); __ jr(ra); __ nop(); @@ -2200,12 +2200,12 @@ TEST(cvt_w_d) { int fcsr_inputs[4] = {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; double* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(Test, fcsr)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lw(t0, MemOperand(a0, offsetof(Test, fcsr)) ); __ cfc1(t1, FCSR); __ ctc1(t0, FCSR); __ cvt_w_d(f8, f4); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, b)) ); __ ctc1(t1, FCSR); __ jr(ra); __ nop(); @@ -2259,12 +2259,12 @@ TEST(trunc_w) { kFPUInvalidResult, kFPUInvalidResult, kFPUInvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ trunc_w_d(f8, f4); __ trunc_w_s(f10, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ swc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2316,12 +2316,12 @@ TEST(round_w) { kFPUInvalidResult, kFPUInvalidResult, kFPUInvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ round_w_d(f8, f4); __ round_w_s(f10, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ swc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2374,12 +2374,12 @@ TEST(round_l) { 2147483648.0, dFPU64InvalidResult, dFPU64InvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ round_l_d(f8, f4); __ round_l_s(f10, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2440,14 +2440,14 @@ TEST(sub) { 0.5, -0.5, 0.0, -10.1, -10.1, -5.8, 10.1, 10.1, 5.8, -0.5, 0.5, 0.0 }; - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); - __ ldc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b)) ); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); + __ ldc1(f10, MemOperand(a0, offsetof(TestFloat, d)) ); __ sub_s(f6, f2, f4); __ sub_d(f12, f8, f10); - __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); + __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); __ jr(ra); __ nop(); @@ -2507,20 +2507,20 @@ TEST(sqrt_rsqrt_recip) { }; - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); __ sqrt_s(f6, f2); __ sqrt_d(f12, f8); __ rsqrt_d(f14, f8); __ rsqrt_s(f16, f2); __ recip_d(f18, f8); __ recip_s(f20, f2); - __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); - __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, resultS1)) ); - __ sdc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, resultD1)) ); - __ swc1(f20, MemOperand(a0, OFFSET_OF(TestFloat, resultS2)) ); - __ sdc1(f18, MemOperand(a0, OFFSET_OF(TestFloat, resultD2)) ); + __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); + __ swc1(f16, MemOperand(a0, offsetof(TestFloat, resultS1)) ); + __ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resultD1)) ); + __ swc1(f20, MemOperand(a0, offsetof(TestFloat, resultS2)) ); + __ sdc1(f18, MemOperand(a0, offsetof(TestFloat, resultD2)) ); __ jr(ra); __ nop(); @@ -2593,12 +2593,12 @@ TEST(neg) { float outputs_S[tableLength] = { 0.0, -4.0, 2.0 }; - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); __ neg_s(f6, f2); __ neg_d(f12, f8); - __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); + __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); __ jr(ra); __ nop(); @@ -2648,14 +2648,14 @@ TEST(mul) { 4.8, 4.8, -4.8, -0.29 }; - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b)) ); + __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, c)) ); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, d)) ); __ mul_s(f10, f2, f4); __ mul_d(f12, f6, f8); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, resultS)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); __ jr(ra); __ nop(); @@ -2705,12 +2705,12 @@ TEST(mov) { 5.3, -5.3, 5.3, -2.9 }; - __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); + __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) ); __ mov_s(f18, f6); __ mov_d(f20, f2); - __ swc1(f18, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); - __ sdc1(f20, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); + __ swc1(f18, MemOperand(a0, offsetof(TestFloat, d)) ); + __ sdc1(f20, MemOperand(a0, offsetof(TestFloat, b)) ); __ jr(ra); __ nop(); @@ -2763,12 +2763,12 @@ TEST(floor_w) { kFPUInvalidResult, kFPUInvalidResult, kFPUInvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ floor_w_d(f8, f4); __ floor_w_s(f10, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ swc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2821,12 +2821,12 @@ TEST(floor_l) { 2147483648.0, dFPU64InvalidResult, dFPU64InvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ floor_l_d(f8, f4); __ floor_l_s(f10, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2879,12 +2879,12 @@ TEST(ceil_w) { kFPUInvalidResult, kFPUInvalidResult, kFPUInvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ ceil_w_d(f8, f4); __ ceil_w_s(f10, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ swc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2937,12 +2937,12 @@ TEST(ceil_l) { 2147483648.0, dFPU64InvalidResult, dFPU64InvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ ceil_l_d(f8, f4); __ ceil_l_s(f10, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -3190,15 +3190,15 @@ TEST(BITSWAP) { Assembler assm(isolate, NULL, 0); - __ lw(a2, MemOperand(a0, OFFSET_OF(T, r1))); + __ lw(a2, MemOperand(a0, offsetof(T, r1))); __ nop(); __ bitswap(a1, a2); - __ sw(a1, MemOperand(a0, OFFSET_OF(T, r1))); + __ sw(a1, MemOperand(a0, offsetof(T, r1))); - __ lw(a2, MemOperand(a0, OFFSET_OF(T, r2))); + __ lw(a2, MemOperand(a0, offsetof(T, r2))); __ nop(); __ bitswap(a1, a2); - __ sw(a1, MemOperand(a0, OFFSET_OF(T, r2))); + __ sw(a1, MemOperand(a0, offsetof(T, r2))); __ jr(ra); __ nop(); @@ -3253,86 +3253,86 @@ TEST(class_fmt) { // the doubles t.a ... t.f. MacroAssembler assm(isolate, NULL, 0); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dSignalingNan))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dSignalingNan))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dSignalingNan))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dSignalingNan))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dQuietNan))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dQuietNan))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dQuietNan))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dQuietNan))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegInf))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dNegInf))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegInf))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dNegInf))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegNorm))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dNegNorm))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegNorm))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dNegNorm))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegSubnorm))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dNegSubnorm))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegSubnorm))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dNegSubnorm))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegZero))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dNegZero))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegZero))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dNegZero))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosInf))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dPosInf))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosInf))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dPosInf))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosNorm))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dPosNorm))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosNorm))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dPosNorm))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosSubnorm))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dPosSubnorm))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosSubnorm))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dPosSubnorm))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosZero))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dPosZero))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosZero))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dPosZero))); // Testing instruction CLASS.S - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fSignalingNan))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fSignalingNan))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fSignalingNan))); + __ swc1(f6, MemOperand(a0, offsetof(T, fSignalingNan))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fQuietNan))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fQuietNan))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fQuietNan))); + __ swc1(f6, MemOperand(a0, offsetof(T, fQuietNan))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegInf))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fNegInf))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegInf))); + __ swc1(f6, MemOperand(a0, offsetof(T, fNegInf))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegNorm))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fNegNorm))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegNorm))); + __ swc1(f6, MemOperand(a0, offsetof(T, fNegNorm))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegSubnorm))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fNegSubnorm))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegSubnorm))); + __ swc1(f6, MemOperand(a0, offsetof(T, fNegSubnorm))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegZero))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fNegZero))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegZero))); + __ swc1(f6, MemOperand(a0, offsetof(T, fNegZero))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosInf))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fPosInf))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosInf))); + __ swc1(f6, MemOperand(a0, offsetof(T, fPosInf))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosNorm))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fPosNorm))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosNorm))); + __ swc1(f6, MemOperand(a0, offsetof(T, fPosNorm))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosSubnorm))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fPosSubnorm))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosSubnorm))); + __ swc1(f6, MemOperand(a0, offsetof(T, fPosSubnorm))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosZero))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fPosZero))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosZero))); + __ swc1(f6, MemOperand(a0, offsetof(T, fPosZero))); __ jr(ra); __ nop(); @@ -3415,13 +3415,13 @@ TEST(ABS) { // Disable FPU exceptions. __ ctc1(zero_reg, FCSR); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a))); __ abs_d(f10, f4); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, a))); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, a))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b))); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b))); __ abs_s(f10, f4); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, b))); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, b))); // Restore FCSR. __ ctc1(a1, FCSR); @@ -3509,15 +3509,15 @@ TEST(ADD_FMT) { TestFloat test; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a))); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, b))); __ add_d(f10, f8, f4); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, c))); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, c))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, fa))); - __ lwc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, fb))); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, fa))); + __ lwc1(f8, MemOperand(a0, offsetof(TestFloat, fb))); __ add_s(f10, f8, f4); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, fc))); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, fc))); __ jr(ra); __ nop(); @@ -3595,11 +3595,11 @@ TEST(C_COND_FMT) { __ li(t1, 1); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, dOp1))); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, dOp2))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, dOp1))); + __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, dOp2))); - __ lwc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, fOp1))); - __ lwc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, fOp2))); + __ lwc1(f14, MemOperand(a0, offsetof(TestFloat, fOp1))); + __ lwc1(f16, MemOperand(a0, offsetof(TestFloat, fOp2))); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3607,8 +3607,8 @@ TEST(C_COND_FMT) { __ c_s(F, f14, f16, 2); __ movt(t2, t1, 0); __ movt(t3, t1, 2); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dF)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fF)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dF)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fF)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3616,8 +3616,8 @@ TEST(C_COND_FMT) { __ c_s(UN, f14, f16, 4); __ movt(t2, t1, 2); __ movt(t3, t1, 4); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUn)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUn)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUn)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUn)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3625,8 +3625,8 @@ TEST(C_COND_FMT) { __ c_s(EQ, f14, f16, 6); __ movt(t2, t1, 4); __ movt(t3, t1, 6); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dEq)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fEq)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dEq)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fEq)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3634,8 +3634,8 @@ TEST(C_COND_FMT) { __ c_s(UEQ, f14, f16, 0); __ movt(t2, t1, 6); __ movt(t3, t1, 0); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUeq)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUeq)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUeq)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUeq)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3643,8 +3643,8 @@ TEST(C_COND_FMT) { __ c_s(OLT, f14, f16, 2); __ movt(t2, t1, 0); __ movt(t3, t1, 2); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dOlt)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fOlt)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dOlt)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fOlt)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3652,8 +3652,8 @@ TEST(C_COND_FMT) { __ c_s(ULT, f14, f16, 4); __ movt(t2, t1, 2); __ movt(t3, t1, 4); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUlt)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUlt)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUlt)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUlt)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3661,8 +3661,8 @@ TEST(C_COND_FMT) { __ c_s(OLE, f14, f16, 6); __ movt(t2, t1, 4); __ movt(t3, t1, 6); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dOle)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fOle)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dOle)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fOle)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3670,8 +3670,8 @@ TEST(C_COND_FMT) { __ c_s(ULE, f14, f16, 0); __ movt(t2, t1, 6); __ movt(t3, t1, 0); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUle)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUle)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUle)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUle)) ); __ jr(ra); __ nop(); @@ -3812,66 +3812,66 @@ TEST(CMP_COND_FMT) { __ li(t1, 1); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, dOp1))); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, dOp2))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, dOp1))); + __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, dOp2))); - __ lwc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, fOp1))); - __ lwc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, fOp2))); + __ lwc1(f14, MemOperand(a0, offsetof(TestFloat, fOp1))); + __ lwc1(f16, MemOperand(a0, offsetof(TestFloat, fOp2))); __ cmp_d(F, f2, f4, f6); __ cmp_s(F, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dF)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fF)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dF)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fF)) ); __ cmp_d(UN, f2, f4, f6); __ cmp_s(UN, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUn)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUn)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUn)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUn)) ); __ cmp_d(EQ, f2, f4, f6); __ cmp_s(EQ, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dEq)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fEq)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dEq)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fEq)) ); __ cmp_d(UEQ, f2, f4, f6); __ cmp_s(UEQ, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUeq)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUeq)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUeq)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUeq)) ); __ cmp_d(LT, f2, f4, f6); __ cmp_s(LT, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOlt)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOlt)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOlt)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOlt)) ); __ cmp_d(ULT, f2, f4, f6); __ cmp_s(ULT, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUlt)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUlt)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUlt)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUlt)) ); __ cmp_d(LE, f2, f4, f6); __ cmp_s(LE, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOle)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOle)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOle)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOle)) ); __ cmp_d(ULE, f2, f4, f6); __ cmp_s(ULE, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUle)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUle)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUle)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUle)) ); __ cmp_d(ORD, f2, f4, f6); __ cmp_s(ORD, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOr)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOr)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOr)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOr)) ); __ cmp_d(UNE, f2, f4, f6); __ cmp_s(UNE, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUne)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUne)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUne)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUne)) ); __ cmp_d(NE, f2, f4, f6); __ cmp_s(NE, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dNe)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fNe)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dNe)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fNe)) ); __ jr(ra); __ nop(); @@ -4029,10 +4029,10 @@ TEST(CVT) { __ ctc1(zero_reg, FCSR); #define GENERATE_CVT_TEST(x, y, z) \ - __ y##c1(f0, MemOperand(a0, OFFSET_OF(TestFloat, x##_in))); \ + __ y##c1(f0, MemOperand(a0, offsetof(TestFloat, x##_in))); \ __ x(f0, f0); \ __ nop(); \ - __ z##c1(f0, MemOperand(a0, OFFSET_OF(TestFloat, x##_out))); + __ z##c1(f0, MemOperand(a0, offsetof(TestFloat, x##_out))); GENERATE_CVT_TEST(cvt_d_s, lw, sd) GENERATE_CVT_TEST(cvt_d_w, lw, sd) @@ -4245,17 +4245,17 @@ TEST(DIV_FMT) { // Disable FPU exceptions. __ ctc1(zero_reg, FCSR); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, dOp1)) ); - __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, dOp2)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, dOp1)) ); + __ ldc1(f2, MemOperand(a0, offsetof(Test, dOp2)) ); __ nop(); __ div_d(f6, f4, f2); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(Test, dRes)) ); + __ sdc1(f6, MemOperand(a0, offsetof(Test, dRes)) ); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(Test, fOp1)) ); - __ lwc1(f2, MemOperand(a0, OFFSET_OF(Test, fOp2)) ); + __ lwc1(f4, MemOperand(a0, offsetof(Test, fOp1)) ); + __ lwc1(f2, MemOperand(a0, offsetof(Test, fOp2)) ); __ nop(); __ div_s(f6, f4, f2); - __ swc1(f6, MemOperand(a0, OFFSET_OF(Test, fRes)) ); + __ swc1(f6, MemOperand(a0, offsetof(Test, fRes)) ); // Restore FCSR. __ ctc1(a1, FCSR); diff --git a/test/cctest/test-assembler-mips64.cc b/test/cctest/test-assembler-mips64.cc index 0494a755c9..f3a94896d0 100644 --- a/test/cctest/test-assembler-mips64.cc +++ b/test/cctest/test-assembler-mips64.cc @@ -289,61 +289,61 @@ TEST(MIPS3) { Label L, C; // Double precision floating point instructions. - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); __ add_d(f8, f4, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, c)) ); // c = a + b. + __ sdc1(f8, MemOperand(a0, offsetof(T, c)) ); // c = a + b. __ mov_d(f10, f8); // c __ neg_d(f12, f6); // -b __ sub_d(f10, f10, f12); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, d)) ); // d = c - (-b). + __ sdc1(f10, MemOperand(a0, offsetof(T, d)) ); // d = c - (-b). - __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, b)) ); // b = a. + __ sdc1(f4, MemOperand(a0, offsetof(T, b)) ); // b = a. __ li(a4, 120); __ mtc1(a4, f14); __ cvt_d_w(f14, f14); // f14 = 120.0. __ mul_d(f10, f10, f14); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, e)) ); // e = d * 120 = 1.8066e16. + __ sdc1(f10, MemOperand(a0, offsetof(T, e)) ); // e = d * 120 = 1.8066e16. __ div_d(f12, f10, f4); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(T, f)) ); // f = e / a = 120.44. + __ sdc1(f12, MemOperand(a0, offsetof(T, f)) ); // f = e / a = 120.44. __ sqrt_d(f14, f12); - __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, g)) ); + __ sdc1(f14, MemOperand(a0, offsetof(T, g)) ); // g = sqrt(f) = 10.97451593465515908537 if (kArchVariant == kMips64r2) { - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, h)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, i)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, h)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, i)) ); __ madd_d(f14, f6, f4, f6); - __ sdc1(f14, MemOperand(a0, OFFSET_OF(T, h)) ); + __ sdc1(f14, MemOperand(a0, offsetof(T, h)) ); } // Single precision floating point instructions. - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fa)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(T, fb)) ); + __ lwc1(f4, MemOperand(a0, offsetof(T, fa)) ); + __ lwc1(f6, MemOperand(a0, offsetof(T, fb)) ); __ add_s(f8, f4, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(T, fc)) ); // fc = fa + fb. + __ swc1(f8, MemOperand(a0, offsetof(T, fc)) ); // fc = fa + fb. __ neg_s(f10, f6); // -fb __ sub_s(f10, f8, f10); - __ swc1(f10, MemOperand(a0, OFFSET_OF(T, fd)) ); // fd = fc - (-fb). + __ swc1(f10, MemOperand(a0, offsetof(T, fd)) ); // fd = fc - (-fb). - __ swc1(f4, MemOperand(a0, OFFSET_OF(T, fb)) ); // fb = fa. + __ swc1(f4, MemOperand(a0, offsetof(T, fb)) ); // fb = fa. __ li(t0, 120); __ mtc1(t0, f14); __ cvt_s_w(f14, f14); // f14 = 120.0. __ mul_s(f10, f10, f14); - __ swc1(f10, MemOperand(a0, OFFSET_OF(T, fe)) ); // fe = fd * 120 + __ swc1(f10, MemOperand(a0, offsetof(T, fe)) ); // fe = fd * 120 __ div_s(f12, f10, f4); - __ swc1(f12, MemOperand(a0, OFFSET_OF(T, ff)) ); // ff = fe / fa + __ swc1(f12, MemOperand(a0, offsetof(T, ff)) ); // ff = fe / fa __ sqrt_s(f14, f12); - __ swc1(f14, MemOperand(a0, OFFSET_OF(T, fg)) ); + __ swc1(f14, MemOperand(a0, offsetof(T, fg)) ); __ jr(ra); __ nop(); @@ -412,8 +412,8 @@ TEST(MIPS4) { Assembler assm(isolate, NULL, 0); Label L, C; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a))); - __ ldc1(f5, MemOperand(a0, OFFSET_OF(T, b))); + __ ldc1(f4, MemOperand(a0, offsetof(T, a))); + __ ldc1(f5, MemOperand(a0, offsetof(T, b))); // Swap f4 and f5, by using 3 integer registers, a4-a6, // both two 32-bit chunks, and one 64-bit chunk. @@ -428,16 +428,16 @@ TEST(MIPS4) { __ dmtc1(a6, f4); // Store the swapped f4 and f5 back to memory. - __ sdc1(f4, MemOperand(a0, OFFSET_OF(T, a))); - __ sdc1(f5, MemOperand(a0, OFFSET_OF(T, c))); + __ sdc1(f4, MemOperand(a0, offsetof(T, a))); + __ sdc1(f5, MemOperand(a0, offsetof(T, c))); // Test sign extension of move operations from coprocessor. - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, d))); + __ ldc1(f4, MemOperand(a0, offsetof(T, d))); __ mfhc1(a4, f4); __ mfc1(a5, f4); - __ sd(a4, MemOperand(a0, OFFSET_OF(T, high))); - __ sd(a5, MemOperand(a0, OFFSET_OF(T, low))); + __ sd(a4, MemOperand(a0, offsetof(T, high))); + __ sd(a5, MemOperand(a0, offsetof(T, low))); __ jr(ra); __ nop(); @@ -480,30 +480,30 @@ TEST(MIPS5) { Label L, C; // Load all structure elements to registers. - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); - __ lw(a4, MemOperand(a0, OFFSET_OF(T, i)) ); - __ lw(a5, MemOperand(a0, OFFSET_OF(T, j)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); + __ lw(a4, MemOperand(a0, offsetof(T, i)) ); + __ lw(a5, MemOperand(a0, offsetof(T, j)) ); // Convert double in f4 to int in element i. __ cvt_w_d(f8, f4); __ mfc1(a6, f8); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, i)) ); + __ sw(a6, MemOperand(a0, offsetof(T, i)) ); // Convert double in f6 to int in element j. __ cvt_w_d(f10, f6); __ mfc1(a7, f10); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, j)) ); + __ sw(a7, MemOperand(a0, offsetof(T, j)) ); // Convert int in original i (a4) to double in a. __ mtc1(a4, f12); __ cvt_d_w(f0, f12); - __ sdc1(f0, MemOperand(a0, OFFSET_OF(T, a)) ); + __ sdc1(f0, MemOperand(a0, offsetof(T, a)) ); // Convert int in original j (a5) to double in b. __ mtc1(a5, f14); __ cvt_d_w(f2, f14); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(T, b)) ); + __ sdc1(f2, MemOperand(a0, offsetof(T, b)) ); __ jr(ra); __ nop(); @@ -549,31 +549,31 @@ TEST(MIPS6) { Label L, C; // Basic word load/store. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, ui)) ); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, r1)) ); + __ lw(a4, MemOperand(a0, offsetof(T, ui)) ); + __ sw(a4, MemOperand(a0, offsetof(T, r1)) ); // lh with positive data. - __ lh(a5, MemOperand(a0, OFFSET_OF(T, ui)) ); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, r2)) ); + __ lh(a5, MemOperand(a0, offsetof(T, ui)) ); + __ sw(a5, MemOperand(a0, offsetof(T, r2)) ); // lh with negative data. - __ lh(a6, MemOperand(a0, OFFSET_OF(T, si)) ); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, r3)) ); + __ lh(a6, MemOperand(a0, offsetof(T, si)) ); + __ sw(a6, MemOperand(a0, offsetof(T, r3)) ); // lhu with negative data. - __ lhu(a7, MemOperand(a0, OFFSET_OF(T, si)) ); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, r4)) ); + __ lhu(a7, MemOperand(a0, offsetof(T, si)) ); + __ sw(a7, MemOperand(a0, offsetof(T, r4)) ); // lb with negative data. - __ lb(t0, MemOperand(a0, OFFSET_OF(T, si)) ); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, r5)) ); + __ lb(t0, MemOperand(a0, offsetof(T, si)) ); + __ sw(t0, MemOperand(a0, offsetof(T, r5)) ); // sh writes only 1/2 of word. __ lui(t1, 0x3333); __ ori(t1, t1, 0x3333); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, r6)) ); - __ lhu(t1, MemOperand(a0, OFFSET_OF(T, si)) ); - __ sh(t1, MemOperand(a0, OFFSET_OF(T, r6)) ); + __ sw(t1, MemOperand(a0, offsetof(T, r6)) ); + __ lhu(t1, MemOperand(a0, offsetof(T, si)) ); + __ sh(t1, MemOperand(a0, offsetof(T, r6)) ); __ jr(ra); __ nop(); @@ -619,8 +619,8 @@ TEST(MIPS7) { MacroAssembler assm(isolate, NULL, 0); Label neither_is_nan, less_than, outa_here; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, a)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(T, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(T, a)) ); + __ ldc1(f6, MemOperand(a0, offsetof(T, b)) ); if (kArchVariant != kMips64r6) { __ c(UN, D, f4, f6); __ bc1f(&neither_is_nan); @@ -629,7 +629,7 @@ TEST(MIPS7) { __ bc1eqz(&neither_is_nan, f2); } __ nop(); - __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); + __ sw(zero_reg, MemOperand(a0, offsetof(T, result)) ); __ Branch(&outa_here); __ bind(&neither_is_nan); @@ -643,12 +643,12 @@ TEST(MIPS7) { } __ nop(); - __ sw(zero_reg, MemOperand(a0, OFFSET_OF(T, result)) ); + __ sw(zero_reg, MemOperand(a0, offsetof(T, result)) ); __ Branch(&outa_here); __ bind(&less_than); __ Addu(a4, zero_reg, Operand(1)); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, result)) ); // Set true. + __ sw(a4, MemOperand(a0, offsetof(T, result)) ); // Set true. // This test-case should have additional tests. @@ -707,7 +707,7 @@ TEST(MIPS8) { MacroAssembler assm(isolate, NULL, 0); // Basic word load. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, input)) ); + __ lw(a4, MemOperand(a0, offsetof(T, input)) ); // ROTR instruction (called through the Ror macro). __ Ror(a5, a4, 0x0004); @@ -719,13 +719,13 @@ TEST(MIPS8) { __ Ror(t3, a4, 0x001c); // Basic word store. - __ sw(a5, MemOperand(a0, OFFSET_OF(T, result_rotr_4)) ); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, result_rotr_8)) ); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, result_rotr_12)) ); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, result_rotr_16)) ); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, result_rotr_20)) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, result_rotr_24)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, result_rotr_28)) ); + __ sw(a5, MemOperand(a0, offsetof(T, result_rotr_4)) ); + __ sw(a6, MemOperand(a0, offsetof(T, result_rotr_8)) ); + __ sw(a7, MemOperand(a0, offsetof(T, result_rotr_12)) ); + __ sw(t0, MemOperand(a0, offsetof(T, result_rotr_16)) ); + __ sw(t1, MemOperand(a0, offsetof(T, result_rotr_20)) ); + __ sw(t2, MemOperand(a0, offsetof(T, result_rotr_24)) ); + __ sw(t3, MemOperand(a0, offsetof(T, result_rotr_28)) ); // ROTRV instruction (called through the Ror macro). __ li(t3, 0x0004); @@ -744,13 +744,13 @@ TEST(MIPS8) { __ Ror(t3, a4, t3); // Basic word store. - __ sw(a5, MemOperand(a0, OFFSET_OF(T, result_rotrv_4)) ); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, result_rotrv_8)) ); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, result_rotrv_12)) ); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, result_rotrv_16)) ); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, result_rotrv_20)) ); - __ sw(t2, MemOperand(a0, OFFSET_OF(T, result_rotrv_24)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(T, result_rotrv_28)) ); + __ sw(a5, MemOperand(a0, offsetof(T, result_rotrv_4)) ); + __ sw(a6, MemOperand(a0, offsetof(T, result_rotrv_8)) ); + __ sw(a7, MemOperand(a0, offsetof(T, result_rotrv_12)) ); + __ sw(t0, MemOperand(a0, offsetof(T, result_rotrv_16)) ); + __ sw(t1, MemOperand(a0, offsetof(T, result_rotrv_20)) ); + __ sw(t2, MemOperand(a0, offsetof(T, result_rotrv_24)) ); + __ sw(t3, MemOperand(a0, offsetof(T, result_rotrv_28)) ); __ jr(ra); __ nop(); @@ -838,42 +838,42 @@ TEST(MIPS10) { // - 32 FP regs of 64-bits each, no odd/even pairs. // - Note that cvt_l_d/cvt_d_l ARE legal in FR=1 mode. // Load all structure elements to registers. - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, a))); + __ ldc1(f0, MemOperand(a0, offsetof(T, a))); // Save the raw bits of the double. __ mfc1(a4, f0); __ mfhc1(a5, f0); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, dbl_mant))); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, dbl_exp))); + __ sw(a4, MemOperand(a0, offsetof(T, dbl_mant))); + __ sw(a5, MemOperand(a0, offsetof(T, dbl_exp))); // Convert double in f0 to long, save hi/lo parts. __ cvt_l_d(f0, f0); __ mfc1(a4, f0); // f0 LS 32 bits of long. __ mfhc1(a5, f0); // f0 MS 32 bits of long. - __ sw(a4, MemOperand(a0, OFFSET_OF(T, long_lo))); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, long_hi))); + __ sw(a4, MemOperand(a0, offsetof(T, long_lo))); + __ sw(a5, MemOperand(a0, offsetof(T, long_hi))); // Combine the high/low ints, convert back to double. __ dsll32(a6, a5, 0); // Move a5 to high bits of a6. __ or_(a6, a6, a4); __ dmtc1(a6, f1); __ cvt_d_l(f1, f1); - __ sdc1(f1, MemOperand(a0, OFFSET_OF(T, a_converted))); + __ sdc1(f1, MemOperand(a0, offsetof(T, a_converted))); // Convert the b long integers to double b. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, b_long_lo))); - __ lw(a5, MemOperand(a0, OFFSET_OF(T, b_long_hi))); + __ lw(a4, MemOperand(a0, offsetof(T, b_long_lo))); + __ lw(a5, MemOperand(a0, offsetof(T, b_long_hi))); __ mtc1(a4, f8); // f8 LS 32-bits. __ mthc1(a5, f8); // f8 MS 32-bits. __ cvt_d_l(f10, f8); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, b))); + __ sdc1(f10, MemOperand(a0, offsetof(T, b))); // Convert double b back to long-int. - __ ldc1(f31, MemOperand(a0, OFFSET_OF(T, b))); + __ ldc1(f31, MemOperand(a0, offsetof(T, b))); __ cvt_l_d(f31, f31); __ dmfc1(a7, f31); - __ sd(a7, MemOperand(a0, OFFSET_OF(T, b_long_as_int64))); + __ sd(a7, MemOperand(a0, offsetof(T, b_long_as_int64))); __ jr(ra); @@ -936,80 +936,80 @@ TEST(MIPS11) { Assembler assm(isolate, NULL, 0); // Test all combinations of LWL and vAddr. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ lwl(a4, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, lwl_0))); + __ lw(a4, MemOperand(a0, offsetof(T, reg_init))); + __ lwl(a4, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a4, MemOperand(a0, offsetof(T, lwl_0))); - __ lw(a5, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ lwl(a5, MemOperand(a0, OFFSET_OF(T, mem_init) + 1)); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, lwl_1))); + __ lw(a5, MemOperand(a0, offsetof(T, reg_init))); + __ lwl(a5, MemOperand(a0, offsetof(T, mem_init) + 1)); + __ sw(a5, MemOperand(a0, offsetof(T, lwl_1))); - __ lw(a6, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ lwl(a6, MemOperand(a0, OFFSET_OF(T, mem_init) + 2)); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, lwl_2))); + __ lw(a6, MemOperand(a0, offsetof(T, reg_init))); + __ lwl(a6, MemOperand(a0, offsetof(T, mem_init) + 2)); + __ sw(a6, MemOperand(a0, offsetof(T, lwl_2))); - __ lw(a7, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ lwl(a7, MemOperand(a0, OFFSET_OF(T, mem_init) + 3)); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, lwl_3))); + __ lw(a7, MemOperand(a0, offsetof(T, reg_init))); + __ lwl(a7, MemOperand(a0, offsetof(T, mem_init) + 3)); + __ sw(a7, MemOperand(a0, offsetof(T, lwl_3))); // Test all combinations of LWR and vAddr. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ lwr(a4, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, lwr_0))); + __ lw(a4, MemOperand(a0, offsetof(T, reg_init))); + __ lwr(a4, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a4, MemOperand(a0, offsetof(T, lwr_0))); - __ lw(a5, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ lwr(a5, MemOperand(a0, OFFSET_OF(T, mem_init) + 1)); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, lwr_1))); + __ lw(a5, MemOperand(a0, offsetof(T, reg_init))); + __ lwr(a5, MemOperand(a0, offsetof(T, mem_init) + 1)); + __ sw(a5, MemOperand(a0, offsetof(T, lwr_1))); - __ lw(a6, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ lwr(a6, MemOperand(a0, OFFSET_OF(T, mem_init) + 2)); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, lwr_2)) ); + __ lw(a6, MemOperand(a0, offsetof(T, reg_init))); + __ lwr(a6, MemOperand(a0, offsetof(T, mem_init) + 2)); + __ sw(a6, MemOperand(a0, offsetof(T, lwr_2)) ); - __ lw(a7, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ lwr(a7, MemOperand(a0, OFFSET_OF(T, mem_init) + 3)); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, lwr_3)) ); + __ lw(a7, MemOperand(a0, offsetof(T, reg_init))); + __ lwr(a7, MemOperand(a0, offsetof(T, mem_init) + 3)); + __ sw(a7, MemOperand(a0, offsetof(T, lwr_3)) ); // Test all combinations of SWL and vAddr. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, swl_0))); - __ lw(a4, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ swl(a4, MemOperand(a0, OFFSET_OF(T, swl_0))); + __ lw(a4, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a4, MemOperand(a0, offsetof(T, swl_0))); + __ lw(a4, MemOperand(a0, offsetof(T, reg_init))); + __ swl(a4, MemOperand(a0, offsetof(T, swl_0))); - __ lw(a5, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, swl_1))); - __ lw(a5, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ swl(a5, MemOperand(a0, OFFSET_OF(T, swl_1) + 1)); + __ lw(a5, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a5, MemOperand(a0, offsetof(T, swl_1))); + __ lw(a5, MemOperand(a0, offsetof(T, reg_init))); + __ swl(a5, MemOperand(a0, offsetof(T, swl_1) + 1)); - __ lw(a6, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, swl_2))); - __ lw(a6, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ swl(a6, MemOperand(a0, OFFSET_OF(T, swl_2) + 2)); + __ lw(a6, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a6, MemOperand(a0, offsetof(T, swl_2))); + __ lw(a6, MemOperand(a0, offsetof(T, reg_init))); + __ swl(a6, MemOperand(a0, offsetof(T, swl_2) + 2)); - __ lw(a7, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, swl_3))); - __ lw(a7, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ swl(a7, MemOperand(a0, OFFSET_OF(T, swl_3) + 3)); + __ lw(a7, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a7, MemOperand(a0, offsetof(T, swl_3))); + __ lw(a7, MemOperand(a0, offsetof(T, reg_init))); + __ swl(a7, MemOperand(a0, offsetof(T, swl_3) + 3)); // Test all combinations of SWR and vAddr. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, swr_0))); - __ lw(a4, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ swr(a4, MemOperand(a0, OFFSET_OF(T, swr_0))); + __ lw(a4, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a4, MemOperand(a0, offsetof(T, swr_0))); + __ lw(a4, MemOperand(a0, offsetof(T, reg_init))); + __ swr(a4, MemOperand(a0, offsetof(T, swr_0))); - __ lw(a5, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, swr_1))); - __ lw(a5, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ swr(a5, MemOperand(a0, OFFSET_OF(T, swr_1) + 1)); + __ lw(a5, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a5, MemOperand(a0, offsetof(T, swr_1))); + __ lw(a5, MemOperand(a0, offsetof(T, reg_init))); + __ swr(a5, MemOperand(a0, offsetof(T, swr_1) + 1)); - __ lw(a6, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, swr_2))); - __ lw(a6, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ swr(a6, MemOperand(a0, OFFSET_OF(T, swr_2) + 2)); + __ lw(a6, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a6, MemOperand(a0, offsetof(T, swr_2))); + __ lw(a6, MemOperand(a0, offsetof(T, reg_init))); + __ swr(a6, MemOperand(a0, offsetof(T, swr_2) + 2)); - __ lw(a7, MemOperand(a0, OFFSET_OF(T, mem_init))); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, swr_3))); - __ lw(a7, MemOperand(a0, OFFSET_OF(T, reg_init))); - __ swr(a7, MemOperand(a0, OFFSET_OF(T, swr_3) + 3)); + __ lw(a7, MemOperand(a0, offsetof(T, mem_init))); + __ sw(a7, MemOperand(a0, offsetof(T, swr_3))); + __ lw(a7, MemOperand(a0, offsetof(T, reg_init))); + __ swr(a7, MemOperand(a0, offsetof(T, swr_3) + 3)); __ jr(ra); __ nop(); @@ -1067,8 +1067,8 @@ TEST(MIPS12) { __ mov(t2, fp); // Save frame pointer. __ mov(fp, a0); // Access struct T by fp. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, y))); - __ lw(a7, MemOperand(a0, OFFSET_OF(T, y4))); + __ lw(a4, MemOperand(a0, offsetof(T, y))); + __ lw(a7, MemOperand(a0, offsetof(T, y4))); __ addu(a5, a4, a7); __ subu(t0, a4, a7); @@ -1086,30 +1086,30 @@ TEST(MIPS12) { __ push(a7); __ pop(t0); __ nop(); - __ sw(a4, MemOperand(fp, OFFSET_OF(T, y))); - __ lw(a4, MemOperand(fp, OFFSET_OF(T, y))); + __ sw(a4, MemOperand(fp, offsetof(T, y))); + __ lw(a4, MemOperand(fp, offsetof(T, y))); __ nop(); - __ sw(a4, MemOperand(fp, OFFSET_OF(T, y))); - __ lw(a5, MemOperand(fp, OFFSET_OF(T, y))); + __ sw(a4, MemOperand(fp, offsetof(T, y))); + __ lw(a5, MemOperand(fp, offsetof(T, y))); __ nop(); __ push(a5); - __ lw(a5, MemOperand(fp, OFFSET_OF(T, y))); + __ lw(a5, MemOperand(fp, offsetof(T, y))); __ pop(a5); __ nop(); __ push(a5); - __ lw(a6, MemOperand(fp, OFFSET_OF(T, y))); + __ lw(a6, MemOperand(fp, offsetof(T, y))); __ pop(a5); __ nop(); __ push(a5); - __ lw(a6, MemOperand(fp, OFFSET_OF(T, y))); + __ lw(a6, MemOperand(fp, offsetof(T, y))); __ pop(a6); __ nop(); __ push(a6); - __ lw(a6, MemOperand(fp, OFFSET_OF(T, y))); + __ lw(a6, MemOperand(fp, offsetof(T, y))); __ pop(a5); __ nop(); __ push(a5); - __ lw(a6, MemOperand(fp, OFFSET_OF(T, y))); + __ lw(a6, MemOperand(fp, offsetof(T, y))); __ pop(a7); __ nop(); @@ -1154,19 +1154,19 @@ TEST(MIPS13) { MacroAssembler assm(isolate, NULL, 0); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, cvt_small_in))); + __ sw(a4, MemOperand(a0, offsetof(T, cvt_small_in))); __ Cvt_d_uw(f10, a4, f22); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(T, cvt_small_out))); + __ sdc1(f10, MemOperand(a0, offsetof(T, cvt_small_out))); __ Trunc_uw_d(f10, f10, f22); - __ swc1(f10, MemOperand(a0, OFFSET_OF(T, trunc_small_out))); + __ swc1(f10, MemOperand(a0, offsetof(T, trunc_small_out))); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, cvt_big_in))); + __ sw(a4, MemOperand(a0, offsetof(T, cvt_big_in))); __ Cvt_d_uw(f8, a4, f22); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(T, cvt_big_out))); + __ sdc1(f8, MemOperand(a0, offsetof(T, cvt_big_out))); __ Trunc_uw_d(f8, f8, f22); - __ swc1(f8, MemOperand(a0, OFFSET_OF(T, trunc_big_out))); + __ swc1(f8, MemOperand(a0, offsetof(T, trunc_big_out))); __ jr(ra); __ nop(); @@ -1236,46 +1236,46 @@ TEST(MIPS14) { // Disable FPU exceptions. __ ctc1(zero_reg, FCSR); #define RUN_ROUND_TEST(x) \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, round_up_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, round_up_in))); \ __ x##_w_d(f0, f0); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_up_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, x##_up_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, round_down_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, round_down_in))); \ __ x##_w_d(f0, f0); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_down_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, x##_down_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, neg_round_up_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, neg_round_up_in))); \ __ x##_w_d(f0, f0); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, neg_##x##_up_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, neg_##x##_up_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, neg_round_down_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, neg_round_down_in))); \ __ x##_w_d(f0, f0); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, neg_##x##_down_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, neg_##x##_down_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err1_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, err1_in))); \ __ ctc1(zero_reg, FCSR); \ __ x##_w_d(f0, f0); \ __ cfc1(a2, FCSR); \ - __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err1_out))); \ + __ sw(a2, MemOperand(a0, offsetof(T, x##_err1_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err2_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, err2_in))); \ __ ctc1(zero_reg, FCSR); \ __ x##_w_d(f0, f0); \ __ cfc1(a2, FCSR); \ - __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err2_out))); \ + __ sw(a2, MemOperand(a0, offsetof(T, x##_err2_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err3_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, err3_in))); \ __ ctc1(zero_reg, FCSR); \ __ x##_w_d(f0, f0); \ __ cfc1(a2, FCSR); \ - __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err3_out))); \ + __ sw(a2, MemOperand(a0, offsetof(T, x##_err3_out))); \ \ - __ ldc1(f0, MemOperand(a0, OFFSET_OF(T, err4_in))); \ + __ ldc1(f0, MemOperand(a0, offsetof(T, err4_in))); \ __ ctc1(zero_reg, FCSR); \ __ x##_w_d(f0, f0); \ __ cfc1(a2, FCSR); \ - __ sw(a2, MemOperand(a0, OFFSET_OF(T, x##_err4_out))); \ - __ swc1(f0, MemOperand(a0, OFFSET_OF(T, x##_invalid_result))); + __ sw(a2, MemOperand(a0, offsetof(T, x##_err4_out))); \ + __ swc1(f0, MemOperand(a0, offsetof(T, x##_invalid_result))); RUN_ROUND_TEST(round) RUN_ROUND_TEST(floor) @@ -1363,48 +1363,48 @@ TEST(MIPS16) { Label L, C; // Basic 32-bit word load/store, with un-signed data. - __ lw(a4, MemOperand(a0, OFFSET_OF(T, ui))); - __ sw(a4, MemOperand(a0, OFFSET_OF(T, r1))); + __ lw(a4, MemOperand(a0, offsetof(T, ui))); + __ sw(a4, MemOperand(a0, offsetof(T, r1))); // Check that the data got zero-extended into 64-bit a4. - __ sd(a4, MemOperand(a0, OFFSET_OF(T, r2))); + __ sd(a4, MemOperand(a0, offsetof(T, r2))); // Basic 32-bit word load/store, with SIGNED data. - __ lw(a5, MemOperand(a0, OFFSET_OF(T, si))); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, r3))); + __ lw(a5, MemOperand(a0, offsetof(T, si))); + __ sw(a5, MemOperand(a0, offsetof(T, r3))); // Check that the data got sign-extended into 64-bit a4. - __ sd(a5, MemOperand(a0, OFFSET_OF(T, r4))); + __ sd(a5, MemOperand(a0, offsetof(T, r4))); // 32-bit UNSIGNED word load/store, with SIGNED data. - __ lwu(a6, MemOperand(a0, OFFSET_OF(T, si))); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, r5))); + __ lwu(a6, MemOperand(a0, offsetof(T, si))); + __ sw(a6, MemOperand(a0, offsetof(T, r5))); // Check that the data got zero-extended into 64-bit a4. - __ sd(a6, MemOperand(a0, OFFSET_OF(T, r6))); + __ sd(a6, MemOperand(a0, offsetof(T, r6))); // lh with positive data. - __ lh(a5, MemOperand(a0, OFFSET_OF(T, ui))); - __ sw(a5, MemOperand(a0, OFFSET_OF(T, r2))); + __ lh(a5, MemOperand(a0, offsetof(T, ui))); + __ sw(a5, MemOperand(a0, offsetof(T, r2))); // lh with negative data. - __ lh(a6, MemOperand(a0, OFFSET_OF(T, si))); - __ sw(a6, MemOperand(a0, OFFSET_OF(T, r3))); + __ lh(a6, MemOperand(a0, offsetof(T, si))); + __ sw(a6, MemOperand(a0, offsetof(T, r3))); // lhu with negative data. - __ lhu(a7, MemOperand(a0, OFFSET_OF(T, si))); - __ sw(a7, MemOperand(a0, OFFSET_OF(T, r4))); + __ lhu(a7, MemOperand(a0, offsetof(T, si))); + __ sw(a7, MemOperand(a0, offsetof(T, r4))); // lb with negative data. - __ lb(t0, MemOperand(a0, OFFSET_OF(T, si))); - __ sw(t0, MemOperand(a0, OFFSET_OF(T, r5))); + __ lb(t0, MemOperand(a0, offsetof(T, si))); + __ sw(t0, MemOperand(a0, offsetof(T, r5))); // // sh writes only 1/2 of word. __ lui(t1, 0x3333); __ ori(t1, t1, 0x3333); - __ sw(t1, MemOperand(a0, OFFSET_OF(T, r6))); - __ lhu(t1, MemOperand(a0, OFFSET_OF(T, si))); - __ sh(t1, MemOperand(a0, OFFSET_OF(T, r6))); + __ sw(t1, MemOperand(a0, offsetof(T, r6))); + __ lhu(t1, MemOperand(a0, offsetof(T, si))); + __ sh(t1, MemOperand(a0, offsetof(T, r6))); __ jr(ra); __ nop(); @@ -1466,26 +1466,26 @@ TEST(seleqz_selnez) { // Integer part of test. __ addiu(t1, zero_reg, 1); // t1 = 1 __ seleqz(t3, t1, zero_reg); // t3 = 1 - __ sw(t3, MemOperand(a0, OFFSET_OF(Test, a))); // a = 1 + __ sw(t3, MemOperand(a0, offsetof(Test, a))); // a = 1 __ seleqz(t2, t1, t1); // t2 = 0 - __ sw(t2, MemOperand(a0, OFFSET_OF(Test, b))); // b = 0 + __ sw(t2, MemOperand(a0, offsetof(Test, b))); // b = 0 __ selnez(t3, t1, zero_reg); // t3 = 1; - __ sw(t3, MemOperand(a0, OFFSET_OF(Test, c))); // c = 0 + __ sw(t3, MemOperand(a0, offsetof(Test, c))); // c = 0 __ selnez(t3, t1, t1); // t3 = 1 - __ sw(t3, MemOperand(a0, OFFSET_OF(Test, d))); // d = 1 + __ sw(t3, MemOperand(a0, offsetof(Test, d))); // d = 1 // Floating point part of test. - __ ldc1(f0, MemOperand(a0, OFFSET_OF(Test, e)) ); // src - __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, f)) ); // test - __ lwc1(f8, MemOperand(a0, OFFSET_OF(Test, i)) ); // src - __ lwc1(f10, MemOperand(a0, OFFSET_OF(Test, j)) ); // test + __ ldc1(f0, MemOperand(a0, offsetof(Test, e)) ); // src + __ ldc1(f2, MemOperand(a0, offsetof(Test, f)) ); // test + __ lwc1(f8, MemOperand(a0, offsetof(Test, i)) ); // src + __ lwc1(f10, MemOperand(a0, offsetof(Test, j)) ); // test __ seleqz_d(f4, f0, f2); __ selnez_d(f6, f0, f2); __ seleqz_s(f12, f8, f10); __ selnez_s(f14, f8, f10); - __ sdc1(f4, MemOperand(a0, OFFSET_OF(Test, g)) ); // src - __ sdc1(f6, MemOperand(a0, OFFSET_OF(Test, h)) ); // src - __ swc1(f12, MemOperand(a0, OFFSET_OF(Test, k)) ); // src - __ swc1(f14, MemOperand(a0, OFFSET_OF(Test, l)) ); // src + __ sdc1(f4, MemOperand(a0, offsetof(Test, g)) ); // src + __ sdc1(f6, MemOperand(a0, offsetof(Test, h)) ); // src + __ swc1(f12, MemOperand(a0, offsetof(Test, k)) ); // src + __ swc1(f14, MemOperand(a0, offsetof(Test, l)) ); // src __ jr(ra); __ nop(); CodeDesc desc; @@ -1574,18 +1574,18 @@ TEST(min_max) { float outputsfmin[tableLength] = {2.0, 2.0, 3.0, 3.0, fltNaN}; float outputsfmax[tableLength] = {3.0, 3.0, 3.0, 3.0, fltNaN}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b))); - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, e))); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, f))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a))); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, b))); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, e))); + __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, f))); __ min_d(f10, f4, f8); __ max_d(f12, f4, f8); __ min_s(f14, f2, f6); __ max_s(f16, f2, f6); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, c))); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, d))); - __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, g))); - __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, h))); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, c))); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, d))); + __ swc1(f14, MemOperand(a0, offsetof(TestFloat, g))); + __ swc1(f16, MemOperand(a0, offsetof(TestFloat, h))); __ jr(ra); __ nop(); @@ -1696,11 +1696,11 @@ TEST(rint_d) { int fcsr_inputs[4] = {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; double* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lw(t0, MemOperand(a0, offsetof(TestFloat, fcsr)) ); __ ctc1(t0, FCSR); __ rint_d(f8, f4); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); + __ sdc1(f8, MemOperand(a0, offsetof(TestFloat, b)) ); __ jr(ra); __ nop(); @@ -1739,16 +1739,16 @@ TEST(sel) { } Test; Test test; - __ ldc1(f0, MemOperand(a0, OFFSET_OF(Test, dd)) ); // test - __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, ds)) ); // src1 - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, dt)) ); // src2 - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, fd)) ); // test - __ lwc1(f8, MemOperand(a0, OFFSET_OF(Test, fs)) ); // src1 - __ lwc1(f10, MemOperand(a0, OFFSET_OF(Test, ft)) ); // src2 + __ ldc1(f0, MemOperand(a0, offsetof(Test, dd)) ); // test + __ ldc1(f2, MemOperand(a0, offsetof(Test, ds)) ); // src1 + __ ldc1(f4, MemOperand(a0, offsetof(Test, dt)) ); // src2 + __ lwc1(f6, MemOperand(a0, offsetof(Test, fd)) ); // test + __ lwc1(f8, MemOperand(a0, offsetof(Test, fs)) ); // src1 + __ lwc1(f10, MemOperand(a0, offsetof(Test, ft)) ); // src2 __ sel_d(f0, f2, f4); __ sel_s(f6, f8, f10); - __ sdc1(f0, MemOperand(a0, OFFSET_OF(Test, dd)) ); - __ swc1(f6, MemOperand(a0, OFFSET_OF(Test, fd)) ); + __ sdc1(f0, MemOperand(a0, offsetof(Test, dd)) ); + __ swc1(f6, MemOperand(a0, offsetof(Test, fd)) ); __ jr(ra); __ nop(); CodeDesc desc; @@ -1873,12 +1873,12 @@ TEST(rint_s) { int fcsr_inputs[4] = {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; float* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lw(t0, MemOperand(a0, offsetof(TestFloat, fcsr)) ); __ cfc1(t1, FCSR); __ ctc1(t0, FCSR); __ rint_s(f8, f4); - __ swc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); + __ swc1(f8, MemOperand(a0, offsetof(TestFloat, b)) ); __ ctc1(t1, FCSR); __ jr(ra); __ nop(); @@ -1970,18 +1970,18 @@ TEST(mina_maxa) { -10.0, -11.2, -9.8 }; - __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); - __ lwc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); - __ lwc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); + __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, b)) ); + __ lwc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); + __ lwc1(f10, MemOperand(a0, offsetof(TestFloat, d)) ); __ mina_d(f6, f2, f4); __ mina_s(f12, f8, f10); __ maxa_d(f14, f2, f4); __ maxa_s(f16, f8, f10); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resf)) ); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resd)) ); - __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, resf1)) ); - __ sdc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, resd1)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, resf)) ); + __ sdc1(f6, MemOperand(a0, offsetof(TestFloat, resd)) ); + __ swc1(f16, MemOperand(a0, offsetof(TestFloat, resf1)) ); + __ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resd1)) ); __ jr(ra); __ nop(); @@ -2042,12 +2042,12 @@ TEST(trunc_l) { 2147483648.0, dFPU64InvalidResult, dFPU64InvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ trunc_l_d(f8, f4); __ trunc_l_s(f10, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2104,26 +2104,26 @@ TEST(movz_movn) { 5.3, -5.3, 5.3, -2.9 }; - __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(TestFloat, rt)) ); + __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) ); + __ lw(t0, MemOperand(a0, offsetof(TestFloat, rt)) ); __ li(t1, 0x0); __ mtc1(t1, f12); __ mtc1(t1, f10); __ mtc1(t1, f16); __ mtc1(t1, f14); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, bold)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dold)) ); - __ sdc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, bold1)) ); - __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, dold1)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, bold)) ); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, dold)) ); + __ sdc1(f16, MemOperand(a0, offsetof(TestFloat, bold1)) ); + __ swc1(f14, MemOperand(a0, offsetof(TestFloat, dold1)) ); __ movz_s(f10, f6, t0); __ movz_d(f12, f2, t0); __ movn_s(f14, f6, t0); __ movn_d(f16, f2, t0); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); - __ swc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, d1)) ); - __ sdc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, b1)) ); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, d)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, b)) ); + __ swc1(f14, MemOperand(a0, offsetof(TestFloat, d1)) ); + __ sdc1(f16, MemOperand(a0, offsetof(TestFloat, b1)) ); __ jr(ra); __ nop(); @@ -2203,26 +2203,26 @@ TEST(movt_movd) { } HandleScope scope(isolate); MacroAssembler assm(isolate, NULL, 0); - __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, srcd)) ); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, srcf)) ); - __ lw(t1, MemOperand(a0, OFFSET_OF(TestFloat, fcsr)) ); + __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, srcd)) ); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, srcf)) ); + __ lw(t1, MemOperand(a0, offsetof(TestFloat, fcsr)) ); __ cfc1(t0, FCSR); __ ctc1(t1, FCSR); __ li(t2, 0x0); __ mtc1(t2, f12); __ mtc1(t2, f10); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstdold)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstfold)) ); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstdold)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstfold)) ); __ movt_s(f12, f4, test.cc); __ movt_d(f10, f2, test.cc); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstf)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstd)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstdold1)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstfold1)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstf)) ); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstd)) ); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstdold1)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstfold1)) ); __ movf_s(f12, f4, test.cc); __ movf_d(f10, f2, test.cc); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, dstf1)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, dstd1)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, dstf1)) ); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, dstd1)) ); __ ctc1(t0, FCSR); __ jr(ra); __ nop(); @@ -2303,12 +2303,12 @@ TEST(cvt_w_d) { int fcsr_inputs[4] = {kRoundToNearest, kRoundToZero, kRoundToPlusInf, kRoundToMinusInf}; double* outputs[4] = {outputs_RN, outputs_RZ, outputs_RP, outputs_RM}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lw(t0, MemOperand(a0, OFFSET_OF(Test, fcsr)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lw(t0, MemOperand(a0, offsetof(Test, fcsr)) ); __ cfc1(t1, FCSR); __ ctc1(t0, FCSR); __ cvt_w_d(f8, f4); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, b)) ); __ ctc1(t1, FCSR); __ jr(ra); __ nop(); @@ -2362,12 +2362,12 @@ TEST(trunc_w) { kFPUInvalidResult, kFPUInvalidResult, kFPUInvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ trunc_w_d(f8, f4); __ trunc_w_s(f10, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ swc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2419,12 +2419,12 @@ TEST(round_w) { kFPUInvalidResult, kFPUInvalidResult, kFPUInvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ round_w_d(f8, f4); __ round_w_s(f10, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ swc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2476,12 +2476,12 @@ TEST(round_l) { 2147483648.0, dFPU64InvalidResult, dFPU64InvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ round_l_d(f8, f4); __ round_l_s(f10, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2542,14 +2542,14 @@ TEST(sub) { 0.5, -0.5, 0.0, -10.1, -10.1, -5.8, 10.1, 10.1, 5.8, -0.5, 0.5, 0.0 }; - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); - __ ldc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b)) ); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); + __ ldc1(f10, MemOperand(a0, offsetof(TestFloat, d)) ); __ sub_s(f6, f2, f4); __ sub_d(f12, f8, f10); - __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); + __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); __ jr(ra); __ nop(); @@ -2609,20 +2609,20 @@ TEST(sqrt_rsqrt_recip) { }; - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); __ sqrt_s(f6, f2); __ sqrt_d(f12, f8); __ rsqrt_d(f14, f8); __ rsqrt_s(f16, f2); __ recip_d(f18, f8); __ recip_s(f20, f2); - __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); - __ swc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, resultS1)) ); - __ sdc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, resultD1)) ); - __ swc1(f20, MemOperand(a0, OFFSET_OF(TestFloat, resultS2)) ); - __ sdc1(f18, MemOperand(a0, OFFSET_OF(TestFloat, resultD2)) ); + __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); + __ swc1(f16, MemOperand(a0, offsetof(TestFloat, resultS1)) ); + __ sdc1(f14, MemOperand(a0, offsetof(TestFloat, resultD1)) ); + __ swc1(f20, MemOperand(a0, offsetof(TestFloat, resultS2)) ); + __ sdc1(f18, MemOperand(a0, offsetof(TestFloat, resultD2)) ); __ jr(ra); __ nop(); @@ -2695,12 +2695,12 @@ TEST(neg) { float outputs_S[tableLength] = { -4.0, 2.0 }; - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, c)) ); __ neg_s(f6, f2); __ neg_d(f12, f8); - __ swc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); + __ swc1(f6, MemOperand(a0, offsetof(TestFloat, resultS)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); __ jr(ra); __ nop(); @@ -2751,14 +2751,14 @@ TEST(mul) { 4.8, 4.8, -4.8, -0.29 }; - __ lwc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); + __ lwc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b)) ); + __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, c)) ); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, d)) ); __ mul_s(f10, f2, f4); __ mul_d(f12, f6, f8); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, resultS)) ); - __ sdc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, resultD)) ); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, resultS)) ); + __ sdc1(f12, MemOperand(a0, offsetof(TestFloat, resultD)) ); __ jr(ra); __ nop(); @@ -2808,12 +2808,12 @@ TEST(mov) { 5.3, -5.3, 5.3, -2.9 }; - __ ldc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, c)) ); + __ ldc1(f2, MemOperand(a0, offsetof(TestFloat, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(TestFloat, c)) ); __ mov_s(f18, f6); __ mov_d(f20, f2); - __ swc1(f18, MemOperand(a0, OFFSET_OF(TestFloat, d)) ); - __ sdc1(f20, MemOperand(a0, OFFSET_OF(TestFloat, b)) ); + __ swc1(f18, MemOperand(a0, offsetof(TestFloat, d)) ); + __ sdc1(f20, MemOperand(a0, offsetof(TestFloat, b)) ); __ jr(ra); __ nop(); @@ -2866,12 +2866,12 @@ TEST(floor_w) { kFPUInvalidResult, kFPUInvalidResult, kFPUInvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ floor_w_d(f8, f4); __ floor_w_s(f10, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ swc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2923,12 +2923,12 @@ TEST(floor_l) { 2147483648.0, dFPU64InvalidResult, dFPU64InvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ floor_l_d(f8, f4); __ floor_l_s(f10, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -2980,12 +2980,12 @@ TEST(ceil_w) { kFPUInvalidResult, kFPUInvalidResult, kFPUInvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ ceil_w_d(f8, f4); __ ceil_w_s(f10, f6); - __ swc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ swc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ swc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ swc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -3037,12 +3037,12 @@ TEST(ceil_l) { 2147483648.0, dFPU64InvalidResult, dFPU64InvalidResult}; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, a)) ); - __ lwc1(f6, MemOperand(a0, OFFSET_OF(Test, b)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, a)) ); + __ lwc1(f6, MemOperand(a0, offsetof(Test, b)) ); __ ceil_l_d(f8, f4); __ ceil_l_s(f10, f6); - __ sdc1(f8, MemOperand(a0, OFFSET_OF(Test, c)) ); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(Test, d)) ); + __ sdc1(f8, MemOperand(a0, offsetof(Test, c)) ); + __ sdc1(f10, MemOperand(a0, offsetof(Test, d)) ); __ jr(ra); __ nop(); Test test; @@ -3305,35 +3305,35 @@ TEST(BITSWAP) { Assembler assm(isolate, NULL, 0); - __ ld(a4, MemOperand(a0, OFFSET_OF(T, r1))); + __ ld(a4, MemOperand(a0, offsetof(T, r1))); __ nop(); __ bitswap(a6, a4); - __ sd(a6, MemOperand(a0, OFFSET_OF(T, r1))); + __ sd(a6, MemOperand(a0, offsetof(T, r1))); - __ ld(a4, MemOperand(a0, OFFSET_OF(T, r2))); + __ ld(a4, MemOperand(a0, offsetof(T, r2))); __ nop(); __ bitswap(a6, a4); - __ sd(a6, MemOperand(a0, OFFSET_OF(T, r2))); + __ sd(a6, MemOperand(a0, offsetof(T, r2))); - __ ld(a4, MemOperand(a0, OFFSET_OF(T, r3))); + __ ld(a4, MemOperand(a0, offsetof(T, r3))); __ nop(); __ bitswap(a6, a4); - __ sd(a6, MemOperand(a0, OFFSET_OF(T, r3))); + __ sd(a6, MemOperand(a0, offsetof(T, r3))); - __ ld(a4, MemOperand(a0, OFFSET_OF(T, r4))); + __ ld(a4, MemOperand(a0, offsetof(T, r4))); __ nop(); __ bitswap(a6, a4); - __ sd(a6, MemOperand(a0, OFFSET_OF(T, r4))); + __ sd(a6, MemOperand(a0, offsetof(T, r4))); - __ ld(a4, MemOperand(a0, OFFSET_OF(T, r5))); + __ ld(a4, MemOperand(a0, offsetof(T, r5))); __ nop(); __ dbitswap(a6, a4); - __ sd(a6, MemOperand(a0, OFFSET_OF(T, r5))); + __ sd(a6, MemOperand(a0, offsetof(T, r5))); - __ ld(a4, MemOperand(a0, OFFSET_OF(T, r6))); + __ ld(a4, MemOperand(a0, offsetof(T, r6))); __ nop(); __ dbitswap(a6, a4); - __ sd(a6, MemOperand(a0, OFFSET_OF(T, r6))); + __ sd(a6, MemOperand(a0, offsetof(T, r6))); __ jr(ra); __ nop(); @@ -3396,86 +3396,86 @@ TEST(class_fmt) { // the doubles t.a ... t.f. MacroAssembler assm(isolate, NULL, 0); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dSignalingNan))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dSignalingNan))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dSignalingNan))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dSignalingNan))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dQuietNan))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dQuietNan))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dQuietNan))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dQuietNan))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegInf))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dNegInf))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegInf))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dNegInf))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegNorm))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dNegNorm))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegNorm))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dNegNorm))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegSubnorm))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dNegSubnorm))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegSubnorm))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dNegSubnorm))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dNegZero))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dNegZero))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dNegZero))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dNegZero))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosInf))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dPosInf))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosInf))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dPosInf))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosNorm))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dPosNorm))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosNorm))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dPosNorm))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosSubnorm))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dPosSubnorm))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosSubnorm))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dPosSubnorm))); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(T, dPosZero))); + __ ldc1(f4, MemOperand(a0, offsetof(T, dPosZero))); __ class_d(f6, f4); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(T, dPosZero))); + __ sdc1(f6, MemOperand(a0, offsetof(T, dPosZero))); // Testing instruction CLASS.S - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fSignalingNan))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fSignalingNan))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fSignalingNan))); + __ swc1(f6, MemOperand(a0, offsetof(T, fSignalingNan))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fQuietNan))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fQuietNan))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fQuietNan))); + __ swc1(f6, MemOperand(a0, offsetof(T, fQuietNan))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegInf))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fNegInf))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegInf))); + __ swc1(f6, MemOperand(a0, offsetof(T, fNegInf))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegNorm))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fNegNorm))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegNorm))); + __ swc1(f6, MemOperand(a0, offsetof(T, fNegNorm))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegSubnorm))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fNegSubnorm))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegSubnorm))); + __ swc1(f6, MemOperand(a0, offsetof(T, fNegSubnorm))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fNegZero))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fNegZero))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fNegZero))); + __ swc1(f6, MemOperand(a0, offsetof(T, fNegZero))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosInf))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fPosInf))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosInf))); + __ swc1(f6, MemOperand(a0, offsetof(T, fPosInf))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosNorm))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fPosNorm))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosNorm))); + __ swc1(f6, MemOperand(a0, offsetof(T, fPosNorm))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosSubnorm))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fPosSubnorm))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosSubnorm))); + __ swc1(f6, MemOperand(a0, offsetof(T, fPosSubnorm))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(T, fPosZero))); + __ lwc1(f4, MemOperand(a0, offsetof(T, fPosZero))); __ class_s(f6, f4); - __ swc1(f6, MemOperand(a0, OFFSET_OF(T, fPosZero))); + __ swc1(f6, MemOperand(a0, offsetof(T, fPosZero))); __ jr(ra); __ nop(); @@ -3552,17 +3552,17 @@ TEST(ABS) { // Save FIR. __ cfc1(a1, FCSR); - __ sd(a1, MemOperand(a0, OFFSET_OF(TestFloat, fcsr))); + __ sd(a1, MemOperand(a0, offsetof(TestFloat, fcsr))); // Disable FPU exceptions. __ ctc1(zero_reg, FCSR); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a))); __ abs_d(f10, f4); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, a))); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, a))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, b))); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, b))); __ abs_s(f10, f4); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, b))); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, b))); // Restore FCSR. __ ctc1(a1, FCSR); @@ -3650,15 +3650,15 @@ TEST(ADD_FMT) { TestFloat test; - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, a))); - __ ldc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, b))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, a))); + __ ldc1(f8, MemOperand(a0, offsetof(TestFloat, b))); __ add_d(f10, f8, f4); - __ sdc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, c))); + __ sdc1(f10, MemOperand(a0, offsetof(TestFloat, c))); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, fa))); - __ lwc1(f8, MemOperand(a0, OFFSET_OF(TestFloat, fb))); + __ lwc1(f4, MemOperand(a0, offsetof(TestFloat, fa))); + __ lwc1(f8, MemOperand(a0, offsetof(TestFloat, fb))); __ add_s(f10, f8, f4); - __ swc1(f10, MemOperand(a0, OFFSET_OF(TestFloat, fc))); + __ swc1(f10, MemOperand(a0, offsetof(TestFloat, fc))); __ jr(ra); __ nop(); @@ -3736,11 +3736,11 @@ TEST(C_COND_FMT) { __ li(t1, 1); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, dOp1))); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, dOp2))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, dOp1))); + __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, dOp2))); - __ lwc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, fOp1))); - __ lwc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, fOp2))); + __ lwc1(f14, MemOperand(a0, offsetof(TestFloat, fOp1))); + __ lwc1(f16, MemOperand(a0, offsetof(TestFloat, fOp2))); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3748,8 +3748,8 @@ TEST(C_COND_FMT) { __ c_s(F, f14, f16, 2); __ movt(t2, t1, 0); __ movt(t3, t1, 2); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dF)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fF)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dF)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fF)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3757,8 +3757,8 @@ TEST(C_COND_FMT) { __ c_s(UN, f14, f16, 4); __ movt(t2, t1, 2); __ movt(t3, t1, 4); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUn)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUn)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUn)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUn)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3766,8 +3766,8 @@ TEST(C_COND_FMT) { __ c_s(EQ, f14, f16, 6); __ movt(t2, t1, 4); __ movt(t3, t1, 6); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dEq)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fEq)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dEq)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fEq)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3775,8 +3775,8 @@ TEST(C_COND_FMT) { __ c_s(UEQ, f14, f16, 0); __ movt(t2, t1, 6); __ movt(t3, t1, 0); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUeq)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUeq)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUeq)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUeq)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3784,8 +3784,8 @@ TEST(C_COND_FMT) { __ c_s(OLT, f14, f16, 2); __ movt(t2, t1, 0); __ movt(t3, t1, 2); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dOlt)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fOlt)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dOlt)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fOlt)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3793,8 +3793,8 @@ TEST(C_COND_FMT) { __ c_s(ULT, f14, f16, 4); __ movt(t2, t1, 2); __ movt(t3, t1, 4); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUlt)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUlt)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUlt)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUlt)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3802,8 +3802,8 @@ TEST(C_COND_FMT) { __ c_s(OLE, f14, f16, 6); __ movt(t2, t1, 4); __ movt(t3, t1, 6); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dOle)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fOle)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dOle)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fOle)) ); __ mov(t2, zero_reg); __ mov(t3, zero_reg); @@ -3811,8 +3811,8 @@ TEST(C_COND_FMT) { __ c_s(ULE, f14, f16, 0); __ movt(t2, t1, 6); __ movt(t3, t1, 0); - __ sw(t2, MemOperand(a0, OFFSET_OF(TestFloat, dUle)) ); - __ sw(t3, MemOperand(a0, OFFSET_OF(TestFloat, fUle)) ); + __ sw(t2, MemOperand(a0, offsetof(TestFloat, dUle)) ); + __ sw(t3, MemOperand(a0, offsetof(TestFloat, fUle)) ); __ jr(ra); __ nop(); @@ -3953,66 +3953,66 @@ TEST(CMP_COND_FMT) { __ li(t1, 1); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(TestFloat, dOp1))); - __ ldc1(f6, MemOperand(a0, OFFSET_OF(TestFloat, dOp2))); + __ ldc1(f4, MemOperand(a0, offsetof(TestFloat, dOp1))); + __ ldc1(f6, MemOperand(a0, offsetof(TestFloat, dOp2))); - __ lwc1(f14, MemOperand(a0, OFFSET_OF(TestFloat, fOp1))); - __ lwc1(f16, MemOperand(a0, OFFSET_OF(TestFloat, fOp2))); + __ lwc1(f14, MemOperand(a0, offsetof(TestFloat, fOp1))); + __ lwc1(f16, MemOperand(a0, offsetof(TestFloat, fOp2))); __ cmp_d(F, f2, f4, f6); __ cmp_s(F, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dF)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fF)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dF)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fF)) ); __ cmp_d(UN, f2, f4, f6); __ cmp_s(UN, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUn)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUn)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUn)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUn)) ); __ cmp_d(EQ, f2, f4, f6); __ cmp_s(EQ, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dEq)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fEq)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dEq)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fEq)) ); __ cmp_d(UEQ, f2, f4, f6); __ cmp_s(UEQ, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUeq)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUeq)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUeq)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUeq)) ); __ cmp_d(LT, f2, f4, f6); __ cmp_s(LT, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOlt)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOlt)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOlt)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOlt)) ); __ cmp_d(ULT, f2, f4, f6); __ cmp_s(ULT, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUlt)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUlt)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUlt)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUlt)) ); __ cmp_d(LE, f2, f4, f6); __ cmp_s(LE, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOle)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOle)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOle)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOle)) ); __ cmp_d(ULE, f2, f4, f6); __ cmp_s(ULE, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUle)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUle)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUle)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUle)) ); __ cmp_d(ORD, f2, f4, f6); __ cmp_s(ORD, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dOr)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fOr)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dOr)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fOr)) ); __ cmp_d(UNE, f2, f4, f6); __ cmp_s(UNE, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dUne)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fUne)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dUne)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fUne)) ); __ cmp_d(NE, f2, f4, f6); __ cmp_s(NE, f12, f14, f16); - __ sdc1(f2, MemOperand(a0, OFFSET_OF(TestFloat, dNe)) ); - __ swc1(f12, MemOperand(a0, OFFSET_OF(TestFloat, fNe)) ); + __ sdc1(f2, MemOperand(a0, offsetof(TestFloat, dNe)) ); + __ swc1(f12, MemOperand(a0, offsetof(TestFloat, fNe)) ); __ jr(ra); __ nop(); @@ -4170,10 +4170,10 @@ TEST(CVT) { __ ctc1(zero_reg, FCSR); #define GENERATE_CVT_TEST(x, y, z) \ - __ y##c1(f0, MemOperand(a0, OFFSET_OF(TestFloat, x##_in))); \ + __ y##c1(f0, MemOperand(a0, offsetof(TestFloat, x##_in))); \ __ x(f0, f0); \ __ nop(); \ - __ z##c1(f0, MemOperand(a0, OFFSET_OF(TestFloat, x##_out))); + __ z##c1(f0, MemOperand(a0, offsetof(TestFloat, x##_out))); GENERATE_CVT_TEST(cvt_d_s, lw, sd) GENERATE_CVT_TEST(cvt_d_w, lw, sd) @@ -4350,17 +4350,17 @@ TEST(DIV_FMT) { // Disable FPU exceptions. __ ctc1(zero_reg, FCSR); - __ ldc1(f4, MemOperand(a0, OFFSET_OF(Test, dOp1)) ); - __ ldc1(f2, MemOperand(a0, OFFSET_OF(Test, dOp2)) ); + __ ldc1(f4, MemOperand(a0, offsetof(Test, dOp1)) ); + __ ldc1(f2, MemOperand(a0, offsetof(Test, dOp2)) ); __ nop(); __ div_d(f6, f4, f2); - __ sdc1(f6, MemOperand(a0, OFFSET_OF(Test, dRes)) ); + __ sdc1(f6, MemOperand(a0, offsetof(Test, dRes)) ); - __ lwc1(f4, MemOperand(a0, OFFSET_OF(Test, fOp1)) ); - __ lwc1(f2, MemOperand(a0, OFFSET_OF(Test, fOp2)) ); + __ lwc1(f4, MemOperand(a0, offsetof(Test, fOp1)) ); + __ lwc1(f2, MemOperand(a0, offsetof(Test, fOp2)) ); __ nop(); __ div_s(f6, f4, f2); - __ swc1(f6, MemOperand(a0, OFFSET_OF(Test, fRes)) ); + __ swc1(f6, MemOperand(a0, offsetof(Test, fRes)) ); // Restore FCSR. __ ctc1(a1, FCSR); diff --git a/test/cctest/test-assembler-ppc.cc b/test/cctest/test-assembler-ppc.cc index 4a2e7d3983..b2dca6a9fc 100644 --- a/test/cctest/test-assembler-ppc.cc +++ b/test/cctest/test-assembler-ppc.cc @@ -194,21 +194,21 @@ TEST(3) { __ mr(r4, r3); // modify field int i of struct - __ lwz(r3, MemOperand(r4, OFFSET_OF(T, i))); + __ lwz(r3, MemOperand(r4, offsetof(T, i))); __ srwi(r5, r3, Operand(1)); - __ stw(r5, MemOperand(r4, OFFSET_OF(T, i))); + __ stw(r5, MemOperand(r4, offsetof(T, i))); // modify field char c of struct - __ lbz(r5, MemOperand(r4, OFFSET_OF(T, c))); + __ lbz(r5, MemOperand(r4, offsetof(T, c))); __ add(r3, r5, r3); __ slwi(r5, r5, Operand(2)); - __ stb(r5, MemOperand(r4, OFFSET_OF(T, c))); + __ stb(r5, MemOperand(r4, offsetof(T, c))); // modify field int16_t s of struct - __ lhz(r5, MemOperand(r4, OFFSET_OF(T, s))); + __ lhz(r5, MemOperand(r4, offsetof(T, s))); __ add(r3, r5, r3); __ srwi(r5, r5, Operand(3)); - __ sth(r5, MemOperand(r4, OFFSET_OF(T, s))); + __ sth(r5, MemOperand(r4, offsetof(T, s))); // restore frame #if V8_TARGET_ARCH_PPC64 @@ -278,59 +278,59 @@ TEST(4) { __ sub(fp, ip, Operand(4)); __ mov(r4, Operand(r0)); - __ vldr(d6, r4, OFFSET_OF(T, a)); - __ vldr(d7, r4, OFFSET_OF(T, b)); + __ vldr(d6, r4, offsetof(T, a)); + __ vldr(d7, r4, offsetof(T, b)); __ vadd(d5, d6, d7); - __ vstr(d5, r4, OFFSET_OF(T, c)); + __ vstr(d5, r4, offsetof(T, c)); __ vmov(r2, r3, d5); __ vmov(d4, r2, r3); - __ vstr(d4, r4, OFFSET_OF(T, b)); + __ vstr(d4, r4, offsetof(T, b)); // Load t.x and t.y, switch values, and store back to the struct. - __ vldr(s0, r4, OFFSET_OF(T, x)); - __ vldr(s31, r4, OFFSET_OF(T, y)); + __ vldr(s0, r4, offsetof(T, x)); + __ vldr(s31, r4, offsetof(T, y)); __ vmov(s16, s0); __ vmov(s0, s31); __ vmov(s31, s16); - __ vstr(s0, r4, OFFSET_OF(T, x)); - __ vstr(s31, r4, OFFSET_OF(T, y)); + __ vstr(s0, r4, offsetof(T, x)); + __ vstr(s31, r4, offsetof(T, y)); // Move a literal into a register that can be encoded in the instruction. __ vmov(d4, 1.0); - __ vstr(d4, r4, OFFSET_OF(T, e)); + __ vstr(d4, r4, offsetof(T, e)); // Move a literal into a register that requires 64 bits to encode. // 0x3ff0000010000000 = 1.000000059604644775390625 __ vmov(d4, 1.000000059604644775390625); - __ vstr(d4, r4, OFFSET_OF(T, d)); + __ vstr(d4, r4, offsetof(T, d)); // Convert from floating point to integer. __ vmov(d4, 2.0); __ vcvt_s32_f64(s31, d4); - __ vstr(s31, r4, OFFSET_OF(T, i)); + __ vstr(s31, r4, offsetof(T, i)); // Convert from integer to floating point. __ mov(lr, Operand(42)); __ vmov(s31, lr); __ vcvt_f64_s32(d4, s31); - __ vstr(d4, r4, OFFSET_OF(T, f)); + __ vstr(d4, r4, offsetof(T, f)); // Test vabs. - __ vldr(d1, r4, OFFSET_OF(T, g)); + __ vldr(d1, r4, offsetof(T, g)); __ vabs(d0, d1); - __ vstr(d0, r4, OFFSET_OF(T, g)); - __ vldr(d2, r4, OFFSET_OF(T, h)); + __ vstr(d0, r4, offsetof(T, g)); + __ vldr(d2, r4, offsetof(T, h)); __ vabs(d0, d2); - __ vstr(d0, r4, OFFSET_OF(T, h)); + __ vstr(d0, r4, offsetof(T, h)); // Test vneg. - __ vldr(d1, r4, OFFSET_OF(T, m)); + __ vldr(d1, r4, offsetof(T, m)); __ vneg(d0, d1); - __ vstr(d0, r4, OFFSET_OF(T, m)); - __ vldr(d1, r4, OFFSET_OF(T, n)); + __ vstr(d0, r4, offsetof(T, m)); + __ vldr(d1, r4, offsetof(T, n)); __ vneg(d0, d1); - __ vstr(d0, r4, OFFSET_OF(T, n)); + __ vstr(d0, r4, offsetof(T, n)); __ ldm(ia_w, sp, r4.bit() | fp.bit() | pc.bit()); @@ -677,19 +677,19 @@ TEST(8) { __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); - __ addi(r4, r0, Operand(OFFSET_OF(D, a))); + __ addi(r4, r0, Operand(offsetof(D, a))); __ vldm(ia_w, r4, d0, d3); __ vldm(ia_w, r4, d4, d7); - __ addi(r4, r0, Operand(OFFSET_OF(D, a))); + __ addi(r4, r0, Operand(offsetof(D, a))); __ vstm(ia_w, r4, d6, d7); __ vstm(ia_w, r4, d0, d5); - __ addi(r4, r1, Operand(OFFSET_OF(F, a))); + __ addi(r4, r1, Operand(offsetof(F, a))); __ vldm(ia_w, r4, s0, s3); __ vldm(ia_w, r4, s4, s7); - __ addi(r4, r1, Operand(OFFSET_OF(F, a))); + __ addi(r4, r1, Operand(offsetof(F, a))); __ vstm(ia_w, r4, s6, s7); __ vstm(ia_w, r4, s0, s5); @@ -789,22 +789,22 @@ TEST(9) { __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); - __ addi(r4, r0, Operand(OFFSET_OF(D, a))); + __ addi(r4, r0, Operand(offsetof(D, a))); __ vldm(ia, r4, d0, d3); __ addi(r4, r4, Operand(4 * 8)); __ vldm(ia, r4, d4, d7); - __ addi(r4, r0, Operand(OFFSET_OF(D, a))); + __ addi(r4, r0, Operand(offsetof(D, a))); __ vstm(ia, r4, d6, d7); __ addi(r4, r4, Operand(2 * 8)); __ vstm(ia, r4, d0, d5); - __ addi(r4, r1, Operand(OFFSET_OF(F, a))); + __ addi(r4, r1, Operand(offsetof(F, a))); __ vldm(ia, r4, s0, s3); __ addi(r4, r4, Operand(4 * 4)); __ vldm(ia, r4, s4, s7); - __ addi(r4, r1, Operand(OFFSET_OF(F, a))); + __ addi(r4, r1, Operand(offsetof(F, a))); __ vstm(ia, r4, s6, s7); __ addi(r4, r4, Operand(2 * 4)); __ vstm(ia, r4, s0, s5); @@ -905,19 +905,19 @@ TEST(10) { __ stm(db_w, sp, r4.bit() | fp.bit() | lr.bit()); __ sub(fp, ip, Operand(4)); - __ addi(r4, r0, Operand(OFFSET_OF(D, h) + 8)); + __ addi(r4, r0, Operand(offsetof(D, h) + 8)); __ vldm(db_w, r4, d4, d7); __ vldm(db_w, r4, d0, d3); - __ addi(r4, r0, Operand(OFFSET_OF(D, h) + 8)); + __ addi(r4, r0, Operand(offsetof(D, h) + 8)); __ vstm(db_w, r4, d0, d5); __ vstm(db_w, r4, d6, d7); - __ addi(r4, r1, Operand(OFFSET_OF(F, h) + 4)); + __ addi(r4, r1, Operand(offsetof(F, h) + 4)); __ vldm(db_w, r4, s4, s7); __ vldm(db_w, r4, s0, s3); - __ addi(r4, r1, Operand(OFFSET_OF(F, h) + 4)); + __ addi(r4, r1, Operand(offsetof(F, h) + 4)); __ vstm(db_w, r4, s0, s5); __ vstm(db_w, r4, s6, s7); @@ -996,28 +996,28 @@ TEST(11) { Assembler assm(isolate, NULL, 0); // Test HeapObject untagging. - __ ldr(r1, MemOperand(r0, OFFSET_OF(I, a))); + __ ldr(r1, MemOperand(r0, offsetof(I, a))); __ mov(r1, Operand(r1, ASR, 1), SetCC); __ adc(r1, r1, Operand(r1), LeaveCC, cs); - __ str(r1, MemOperand(r0, OFFSET_OF(I, a))); + __ str(r1, MemOperand(r0, offsetof(I, a))); - __ ldr(r2, MemOperand(r0, OFFSET_OF(I, b))); + __ ldr(r2, MemOperand(r0, offsetof(I, b))); __ mov(r2, Operand(r2, ASR, 1), SetCC); __ adc(r2, r2, Operand(r2), LeaveCC, cs); - __ str(r2, MemOperand(r0, OFFSET_OF(I, b))); + __ str(r2, MemOperand(r0, offsetof(I, b))); // Test corner cases. __ mov(r1, Operand(0xffffffff)); __ mov(r2, Operand::Zero()); __ mov(r3, Operand(r1, ASR, 1), SetCC); // Set the carry. __ adc(r3, r1, Operand(r2)); - __ str(r3, MemOperand(r0, OFFSET_OF(I, c))); + __ str(r3, MemOperand(r0, offsetof(I, c))); __ mov(r1, Operand(0xffffffff)); __ mov(r2, Operand::Zero()); __ mov(r3, Operand(r2, ASR, 1), SetCC); // Unset the carry. __ adc(r3, r1, Operand(r2)); - __ str(r3, MemOperand(r0, OFFSET_OF(I, d))); + __ str(r3, MemOperand(r0, offsetof(I, d))); __ mov(pc, Operand(lr));