From 5ec80bf163b39a12d56b4cde3751d185839189ec Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 28 Apr 2014 14:02:35 +0100 Subject: [PATCH] fix an orc bug --- TODO | 9 --------- libvips/morphology/hitmiss.c | 23 +++++++++++++++-------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/TODO b/TODO index 3f6450a6..4b86a3b1 100644 --- a/TODO +++ b/TODO @@ -1,13 +1,4 @@ -- clean in nip2 is broken - - works if you use --vips-novector - - 14.04 is orc-0.4.18, there must have been a change - - nope, still broken with 0.4.11 - - - vips_filename_suffix_match() is used by vips_foreign_load_new_from_foreign_sub(), but it splits on ':' ... argh! diff --git a/libvips/morphology/hitmiss.c b/libvips/morphology/hitmiss.c index 093b5ea4..fdbe4584 100644 --- a/libvips/morphology/hitmiss.c +++ b/libvips/morphology/hitmiss.c @@ -51,6 +51,7 @@ */ /* +#define DEBUG_VERBOSE #define DEBUG */ @@ -208,8 +209,14 @@ pass_compile_section( Pass *pass, Morph *morph, gboolean first_pass ) ASM3( "orb", "sum", "sum", "value" ); } else { - if( !mask->coeff[i] ) - ASM3( "andnb", "sum", "sum", "value" ); + if( !mask->coeff[i] ) { + /* You'd think we could use andnb, but it + * fails on some machines with some orc + * versions :( + */ + ASM3( "xorb", "value", "value", one ); + ASM3( "andb", "sum", "sum", "value" ); + } else ASM3( "andb", "sum", "sum", "value" ); } @@ -454,10 +461,10 @@ dilate_gen( REGION *or, void *vseq, void *a, void *b ) if( im_prepare( ir, &s ) ) return( -1 ); -#ifdef DEBUG +#ifdef DEBUG_VERBOSE printf( "dilate_gen: preparing %dx%d@%dx%d pixels\n", s.width, s.height, s.left, s.top ); -#endif /*DEBUG*/ +#endif /*DEBUG_VERBOSE*/ /* Scan mask, building offsets we check when processing. Only do this * if the bpl has changed since the previous im_prepare(). @@ -566,10 +573,10 @@ erode_gen( REGION *or, void *vseq, void *a, void *b ) if( im_prepare( ir, &s ) ) return( -1 ); -#ifdef DEBUG +#ifdef DEBUG_VERBOSE printf( "erode_gen: preparing %dx%d@%dx%d pixels\n", s.width, s.height, s.left, s.top ); -#endif /*DEBUG*/ +#endif /*DEBUG_VERBOSE*/ /* Scan mask, building offsets we check when processing. Only do this * if the bpl has changed since the previous im_prepare(). @@ -665,10 +672,10 @@ morph_vector_gen( REGION *or, void *vseq, void *a, void *b ) if( im_prepare( ir, &s ) ) return( -1 ); -#ifdef DEBUG +#ifdef DEBUG_VERBOSE printf( "morph_vector_gen: preparing %dx%d@%dx%d pixels\n", s.width, s.height, s.left, s.top ); -#endif /*DEBUG*/ +#endif /*DEBUG_VERBOSE*/ for( j = 0; j < morph->n_pass; j++ ) vips_executor_set_program( &executor[j],