Skip to content

Commit f7aa22f

Browse files
author
Ledmington
committed
Removed redundant opcode when creating WeirdVpcmpeqb
1 parent 247d47f commit f7aa22f

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

id/src/main/java/com/ledmington/cpu/x86/InstructionBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public Instruction build() {
144144
&& op2 instanceof RegisterYMM
145145
&& op3 instanceof RegisterYMM
146146
&& op4 == null) {
147-
return new WeirdVpcmpeqb(opcode, op1, op2, op3);
147+
return new WeirdVpcmpeqb(op1, op2, op3);
148148
}
149149

150150
return new GeneralInstruction(prefix, opcode, destinationMask, destinationMaskZero, op1, op2, op3, op4);

id/src/main/java/com/ledmington/cpu/x86/WeirdVpcmpeqb.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
/**
2121
* This specific class represents the specific case of: 'vpcmpeqb k0,ymm16,ymm17' when encoded as '62 b1 7d 20 74 c1'.
2222
*/
23-
public record WeirdVpcmpeqb(Opcode opcode, Operand firstOperand, Operand secondOperand, Operand thirdOperand)
24-
implements Instruction {
23+
public record WeirdVpcmpeqb(Operand firstOperand, Operand secondOperand, Operand thirdOperand) implements Instruction {
2524

2625
@Override
2726
public Opcode opcode() {

id/src/test/java/com/ledmington/cpu/X64Encodings.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10219,14 +10219,8 @@ Opcode.MOVABS, new SegmentedAddress(DS, new Immediate(0x12345678deadbeefL)), EAX
1021910219
.build(),
1022010220
"vpcmpeqb k0,ymm16,ymm18",
1022110221
"62 b3 7d 20 3f c2 00"),
10222-
test(
10223-
new WeirdVpcmpeqb(Opcode.VPCMPEQB, K0, YMM16, YMM17),
10224-
"vpcmpeqb k0,ymm16,ymm17",
10225-
"62 b1 7d 20 74 c1"),
10226-
test(
10227-
new WeirdVpcmpeqb(Opcode.VPCMPEQB, K0, YMM16, YMM18),
10228-
"vpcmpeqb k0,ymm16,ymm18",
10229-
"62 b1 7d 20 74 c2"),
10222+
test(new WeirdVpcmpeqb(K0, YMM16, YMM17), "vpcmpeqb k0,ymm16,ymm17", "62 b1 7d 20 74 c1"),
10223+
test(new WeirdVpcmpeqb(K0, YMM16, YMM18), "vpcmpeqb k0,ymm16,ymm18", "62 b1 7d 20 74 c2"),
1023010224
test(
1023110225
Instruction.builder()
1023210226
.opcode(Opcode.VPCMPEQB)

0 commit comments

Comments
 (0)