@@ -6924,6 +6924,36 @@ ASSEMBLER_TEST_RUN(BitSetImmediate2, test) {
69246924 EXPECT_EQ (-1 , Call (test->entry (), -1 ));
69256925}
69266926
6927+ ASSEMBLER_TEST_GENERATE (ConditionalZeroIfEqualsZero, assembler) {
6928+ __ SetExtensions (RV_GC | RV_Zicond);
6929+ __ czeroeqz (A0, A0, A1);
6930+ __ ret ();
6931+ }
6932+ ASSEMBLER_TEST_RUN (ConditionalZeroIfEqualsZero, test) {
6933+ EXPECT_DISASSEMBLY (
6934+ " 0eb55533 czero.eqz a0, a0, a1\n "
6935+ " 8082 ret\n " );
6936+
6937+ EXPECT_EQ (0 , Call (test->entry (), 42 , 0 ));
6938+ EXPECT_EQ (42 , Call (test->entry (), 42 , 1 ));
6939+ EXPECT_EQ (42 , Call (test->entry (), 42 , -1 ));
6940+ }
6941+
6942+ ASSEMBLER_TEST_GENERATE (ConditionalZeroIfNotEqualsZero, assembler) {
6943+ __ SetExtensions (RV_GC | RV_Zicond);
6944+ __ czeronez (A0, A0, A1);
6945+ __ ret ();
6946+ }
6947+ ASSEMBLER_TEST_RUN (ConditionalZeroIfNotEqualsZero, test) {
6948+ EXPECT_DISASSEMBLY (
6949+ " 0eb57533 czero.nez a0, a0, a1\n "
6950+ " 8082 ret\n " );
6951+
6952+ EXPECT_EQ (42 , Call (test->entry (), 42 , 0 ));
6953+ EXPECT_EQ (0 , Call (test->entry (), 42 , 1 ));
6954+ EXPECT_EQ (0 , Call (test->entry (), 42 , -1 ));
6955+ }
6956+
69276957ASSEMBLER_TEST_GENERATE (LoadByteAcquire, assembler) {
69286958 __ SetExtensions (RV_GC | RV_Zalasr);
69296959 __ lb (A0, Address (A1), std::memory_order_acquire);
0 commit comments