TEST_F(PowerPCFixedArithmetic_ADDZE,
canAddToZeroExtendedWithOverflow) {
given([](ProcessorStateVector & states)
{
states.resize(6);
states[0].GPR.R14
= 0x1111111111111111;
states[0].XER.split.CA
= 0;
states[1].GPR.R14
= 0x1111111111111111;
states[1].XER.split.CA
= 1;
states[2].GPR.R14
= 0xffffffffffffffff;
states[2].XER.split.CA
= 0;
states[3].GPR.R14
= 0xffffffffffffffff;
states[3].XER.split.CA
= 1;
states[4].GPR.R14
= 0x7fffffffffffffff;
states[4].XER.split.CA
= 0;
states[5].GPR.R14
= 0x7fffffffffffffff;
states[5].XER.split.CA
= 1;
});
when(R"(
addzeo %r13, %r14
)");
then([](ProcessorStateVector const & states) {
ASSERT_EQ(0x1111111111111111, states[0].GPR.R13);
ASSERT_TRUE(states[0].XER.hasOverflow());
ASSERT_FALSE(states[0].XER.didOverflow());
ASSERT_FALSE(states[0].XER.hasCarry());
ASSERT_EQ(0x1111111111111112, states[1].GPR.R13);
ASSERT_TRUE(states[1].XER.hasOverflow());
ASSERT_FALSE(states[1].XER.didOverflow());
ASSERT_FALSE(states[1].XER.hasCarry());
ASSERT_EQ(0xffffffffffffffff, states[2].GPR.R13);
ASSERT_FALSE(states[2].XER.hasOverflow());
ASSERT_FALSE(states[2].XER.didOverflow());
ASSERT_FALSE(states[2].XER.hasCarry());
ASSERT_EQ(0x0000000000000000, states[3].GPR.R13);
ASSERT_FALSE(states[3].XER.hasOverflow());
ASSERT_FALSE(states[3].XER.didOverflow());
ASSERT_TRUE(states[3].XER.hasCarry());
ASSERT_EQ(0x7fffffffffffffff, states[4].GPR.R13);
ASSERT_TRUE(states[4].XER.hasOverflow());
ASSERT_FALSE(states[4].XER.didOverflow());
ASSERT_FALSE(states[4].XER.hasCarry());
ASSERT_EQ(0x8000000000000000, states[5].GPR.R13);
ASSERT_TRUE(states[5].XER.hasOverflow());
ASSERT_TRUE(states[5].XER.didOverflow());
ASSERT_FALSE(states[5].XER.hasCarry());
});
}
class ADDZESpecification extends PowerPCSpecification
{
def "can add to zero extended with
overflow"(long r14, boolean existingCA, long r13, boolean SO, boolean OV, boolean CA)
{
given:
state.r14 = r14
state.XER.CA = existingCA
when:
execute("addzeo %r13, %r14")
then:
state.r13 == r13
state.XER.SO == SO
state.XER.OV == OV
state.XER.CA == CA
where:
r14
| existingCA || r13
| SO | OV
| CA
0x1111111111111111
| false
|| 0x1111111111111111
| true | false | false
0x1111111111111111
| true
|| 0x1111111111111112
| true | false | false
0x7fffffffffffffff
| false
|| 0x7fffffffffffffff
| true | false | false
0x7fffffffffffffff
| true
|| 0x8000000000000000
| true | true
| false
0xffffffffffffffff
| false
|| 0xffffffffffffffff
| true | false | false
0xffffffffffffffff
| true
|| 0x0000000000000000
| true | false | true
}
}
Because yes, I'm obviously using Gradle to build the client (32 sub-projects, all using the new native language plugins, with Windows, Linux, OS X, iOS, Android and Windows Phone targets) ;-)
Did you happen to look at JNA instead of JNI by any chance? It's far, far easier to use.
--
David Dawson
CEO, Principal Consultant
Simplicity Itself Limited
Tel +44 7866 011 256
Skype: davidadawson
david....@simplicityitself.com
http://www.simplicityitself.com
Wow, good job!
Can we see the code online (especially the JNI you used)?
--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spockframewor...@googlegroups.com.
To post to this group, send email to spockfr...@googlegroups.com.
Visit this group at http://groups.google.com/group/spockframework.
For more options, visit https://groups.google.com/d/optout.
Fairy nuff.
I'd not even considered Spock before for any C related work. This is fab. Thanks for the idea!
--
David Dawson
CEO, Principal Consultant
Simplicity Itself Limited
Tel +44 7866 011 256
Skype: davidadawson
david....@simplicityitself.com
http://www.simplicityitself.com