@@ -79,8 +79,6 @@ enum reg_val_type {
79
79
REG_64BIT_32BIT ,
80
80
/* 32-bit compatible, need truncation for 64-bit ops. */
81
81
REG_32BIT ,
82
- /* 32-bit zero extended. */
83
- REG_32BIT_ZERO_EX ,
84
82
/* 32-bit no sign/zero extension needed. */
85
83
REG_32BIT_POS
86
84
};
@@ -349,7 +347,7 @@ static int build_int_epilogue(struct jit_ctx *ctx, int dest_reg)
349
347
if (dest_reg == MIPS_R_RA ) {
350
348
/* Don't let zero extended value escape. */
351
349
td = get_reg_val_type (ctx , prog -> len , BPF_REG_0 );
352
- if (td == REG_64BIT || td == REG_32BIT_ZERO_EX )
350
+ if (td == REG_64BIT )
353
351
emit_instr (ctx , sll , r0 , r0 , 0 );
354
352
}
355
353
@@ -695,7 +693,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
695
693
if (dst < 0 )
696
694
return dst ;
697
695
td = get_reg_val_type (ctx , this_idx , insn -> dst_reg );
698
- if (td == REG_64BIT || td == REG_32BIT_ZERO_EX ) {
696
+ if (td == REG_64BIT ) {
699
697
/* sign extend */
700
698
emit_instr (ctx , sll , dst , dst , 0 );
701
699
}
@@ -710,7 +708,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
710
708
if (dst < 0 )
711
709
return dst ;
712
710
td = get_reg_val_type (ctx , this_idx , insn -> dst_reg );
713
- if (td == REG_64BIT || td == REG_32BIT_ZERO_EX ) {
711
+ if (td == REG_64BIT ) {
714
712
/* sign extend */
715
713
emit_instr (ctx , sll , dst , dst , 0 );
716
714
}
@@ -724,7 +722,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
724
722
if (dst < 0 )
725
723
return dst ;
726
724
td = get_reg_val_type (ctx , this_idx , insn -> dst_reg );
727
- if (td == REG_64BIT || td == REG_32BIT_ZERO_EX )
725
+ if (td == REG_64BIT )
728
726
/* sign extend */
729
727
emit_instr (ctx , sll , dst , dst , 0 );
730
728
if (insn -> imm == 1 ) {
@@ -863,13 +861,13 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
863
861
if (src < 0 || dst < 0 )
864
862
return - EINVAL ;
865
863
td = get_reg_val_type (ctx , this_idx , insn -> dst_reg );
866
- if (td == REG_64BIT || td == REG_32BIT_ZERO_EX ) {
864
+ if (td == REG_64BIT ) {
867
865
/* sign extend */
868
866
emit_instr (ctx , sll , dst , dst , 0 );
869
867
}
870
868
did_move = false;
871
869
ts = get_reg_val_type (ctx , this_idx , insn -> src_reg );
872
- if (ts == REG_64BIT || ts == REG_32BIT_ZERO_EX ) {
870
+ if (ts == REG_64BIT ) {
873
871
int tmp_reg = MIPS_R_AT ;
874
872
875
873
if (bpf_op == BPF_MOV ) {
@@ -1257,8 +1255,7 @@ static int build_one_insn(const struct bpf_insn *insn, struct jit_ctx *ctx,
1257
1255
if (insn -> imm == 64 && td == REG_32BIT )
1258
1256
emit_instr (ctx , dinsu , dst , MIPS_R_ZERO , 32 , 32 );
1259
1257
1260
- if (insn -> imm != 64 &&
1261
- (td == REG_64BIT || td == REG_32BIT_ZERO_EX )) {
1258
+ if (insn -> imm != 64 && td == REG_64BIT ) {
1262
1259
/* sign extend */
1263
1260
emit_instr (ctx , sll , dst , dst , 0 );
1264
1261
}
0 commit comments