From 922b14b8d8352b70879a3307191ab1e3ea5b0218 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 25 Sep 2013 17:33:37 +0000 Subject: [PATCH] Fix segfault in MIPS DSPr2 upsample routines that occurred when doing 'make test' git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1040 632fc199-4ca6-4c93-a231-07263d6284db --- simd/jsimd_mips_dspr2.S | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/simd/jsimd_mips_dspr2.S b/simd/jsimd_mips_dspr2.S index 83744b8..b7136b5 100644 --- a/simd/jsimd_mips_dspr2.S +++ b/simd/jsimd_mips_dspr2.S @@ -486,7 +486,6 @@ LEAF_MIPS_DSPR2(jsimd_h2v1_fancy_upsample_mips_dspr2) nop END(jsimd_h2v1_fancy_upsample_mips_dspr2) -/*****************************************************************************/ /*****************************************************************************/ LEAF_MIPS_DSPR2(jsimd_h2v1_downsample_mips_dspr2) /* @@ -704,15 +703,15 @@ LEAF_MIPS_DSPR2(jsimd_h2v1_upsample_mips_dspr2) lw t7, 0(a3) // t7 = output_data andi t8, a1, 0xf // t8 = residual sll t0, a0, 2 - beqz a0, 4f + blez a0, 4f addu t9, t7, t0 // t9 = output_data end address 0: lw t5, 0(t7) // t5 = outptr lw t6, 0(a2) // t6 = inptr addu t3, t5, a1 // t3 = outptr + output_width (end address) subu t3, t8 // t3 = end address - residual - beqz t3, 2f - nop + beq t5, t3, 2f + move t4, t8 1: ulw t0, 0(t6) // t0 = |P3|P2|P1|P0| ulw t2, 4(t6) // t2 = |P7|P6|P5|P4| @@ -761,15 +760,15 @@ LEAF_MIPS_DSPR2(jsimd_h2v2_upsample_mips_dspr2) * a3 - output_data_ptr */ lw t7, 0(a3) - beqz a0, 7f + blez a0, 7f andi t9, a1, 0xf // t9 = residual 0: lw t6, 0(a2) // t6 = inptr lw t5, 0(t7) // t5 = outptr addu t8, t5, a1 // t8 = outptr end address subu t8, t9 // t8 = end address - residual - beqz t8, 2f - nop + beq t5, t8, 2f + move t4, t9 1: ulw t0, 0(t6) srl t1, t0, 16 -- 2.40.0