2626import org .junit .jupiter .api .TestMethodOrder ;
2727
2828/* Tests ppc64.vadl instructions against the QEMU ppc64 simulator.
29+ * Covers all instructions not tested in CosimPpc64InstrTest.java.
2930 * Instructions in this class are tested using only a subset of possible values and/or are
3031 * not tested in all available modes.
3132 */
@@ -40,7 +41,7 @@ Stream<DynamicTest> mtspr() throws IOException {
4041 var b = getBuilder ("MTSPR" , id );
4142 var regSrc = b .anyReg ().sample ();
4243 b .fillReg (regSrc );
43- b .add ("mtspr %s, %s" , b .anySpecialReg ().sample (), regSrc );
44+ b .add ("mtspr %s, %s" , b .anyImplementedSpecialReg ().sample (), regSrc );
4445 return b .toTestCase ();
4546 });
4647 }
@@ -51,23 +52,27 @@ Stream<DynamicTest> mfspr() throws IOException {
5152 return runTests3264With (id -> {
5253 var b = getBuilder ("MFSPR" , id );
5354 var regSrc = b .anyReg ().sample ();
54- var spr = b .anySpecialReg ().sample ();
55+ var spr = b .anyImplementedSpecialReg ().sample ();
5556 b .fillReg (regSrc );
5657 b .add ("mtspr %s, %s" , spr , regSrc );
57- b .add ("mfspr %s, %s" , regSrc , spr );
58+ b .add ("mfspr %s, %s" , b . anyReg (). sample () , spr );
5859 return b .toTestCase ();
5960 });
6061 }
6162
62- /* L = 0 doesn't work
6363 @ TestFactory
6464 @ Order (3 )
6565 Stream <DynamicTest > mtmsr () throws IOException {
6666 return runTests3264With (id -> {
6767 var b = getBuilder ("MTMSR" , id );
6868 var regSrc = b .anyReg ().sample ();
69- b.fillReg(regSrc);
70- b.add("mtmsr %s, %s", regSrc, b.anyImmU(1));
69+ var val = b .getImmS (32 )
70+ .clearBit (5 ) // disable IR
71+ .clearBit (9 ).clearBit (10 ) // set TE to 0b00
72+ .clearBit (14 ) // disable PR
73+ .clearBit (15 ); // disable EE
74+ b .fillReg (regSrc , val );
75+ b .add ("mtmsr %s, %s" , regSrc , b .getImmU (1 ));
7176 return b .toTestCase ();
7277 });
7378 }
@@ -78,13 +83,17 @@ Stream<DynamicTest> mfmsr() throws IOException {
7883 return runTests3264With (id -> {
7984 var b = getBuilder ("MFMSR" , id );
8085 var regSrc = b .anyReg ().sample ();
81- b.fillReg(regSrc);
82- b.add("mtmsr %s, %s", regSrc, b.anyImmU(1));
86+ var val = b .getImmS (32 )
87+ .clearBit (5 ) // disable IR
88+ .clearBit (9 ).clearBit (10 ) // set TE to 0b00
89+ .clearBit (14 ) // disable PR
90+ .clearBit (15 ); // disable EE
91+ b .fillReg (regSrc , val );
92+ b .add ("mtmsr %s, %s" , regSrc , 0 );
8393 b .add ("mfmsr %s" , b .anyReg ().sample ());
8494 return b .toTestCase ();
8595 });
8696 }
87- */
8897
8998 @ SuppressWarnings ("MethodName" )
9099 @ TestFactory
0 commit comments