Skip to contentSkip to conversation

PATCH: libv4l-fix-idct-inline-assembly.diff

PATCH Gregor Jasny 3 participants 3 messages Jul 4, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Hi,

This patch fixes the input constraint for the sar instruction. It allows only an immediate or cl as shift width.

Thanks,
Gregor

v4l2-apps/lib/libv4l/libv4lconvert/jidctflt.c +1 -1
diff -r 61deeffda900 v4l2-apps/lib/libv4l/libv4lconvert/jidctflt.c
@@ -92,7 +92,7 @@ static inline unsigned char descale_and_
       "\tcmpl %4,%1\n"
       "\tcmovg %4,%1\n"
       : "=r"(x)
-      : "0"(x), "Ir"(shift), "ir"(1UL<<(shift-1)), "r" (0xff), "r" (0)
+      : "0"(x), "Ic"((unsigned char)shift), "ir"(1UL<<(shift-1)), "r" (0xff), "r" (0)
       );
   return x;
 }

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#1 lore raw

Hi,

I was just about to send the same patch :)

Note that this is already incorperated into the libv4l-0.3.2 tarbal release which I'm about to announce.

Regards,

Hans

Quoted 15 lines · Gregor Jasny

Hi,

This patch fixes the input constraint for the sar instruction. It allows only an immediate or cl as shift width.

Thanks,
Gregor

diff -r 61deeffda900 v4l2-apps/lib/libv4l/libv4lconvert/jidctflt.c

v4l2-apps/lib/libv4l/libv4lconvert/jidctflt.c static inline unsigned char descale_and_ · line 98

Quoted 8 lines
v4l2-apps/lib/libv4l/libv4lconvert/jidctflt.c +1 -1
@@ -92,7 +92,7 @@ static inline unsigned char descale_and_
       "\tcmpl %4,%1\n"
       "\tcmovg %4,%1\n"
       : "=r"(x)
-      : "0"(x), "Ir"(shift), "ir"(1UL<<(shift-1)), "r" (0xff), "r" (0)
+      : "0"(x), "Ic"((unsigned char)shift), "ir"(1UL<<(shift-1)), "r" (0xff), "r" (0)
       );
   return x;
 }

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#2 lore raw
In reply to Gregor Jasny
Quoted 16 lines · Gregor Jasny

Hi,

This patch fixes the input constraint for the sar instruction. It allows only an immediate or cl as shift width.

Thanks,
Gregor

diff -r 61deeffda900 v4l2-apps/lib/libv4l/libv4lconvert/jidctflt.c

v4l2-apps/lib/libv4l/libv4lconvert/jidctflt.c static inline unsigned char descale_and_ · line 98

Quoted 8 lines
v4l2-apps/lib/libv4l/libv4lconvert/jidctflt.c +1 -1
@@ -92,7 +92,7 @@ static inline unsigned char descale_and_
       "\tcmpl %4,%1\n"
       "\tcmovg %4,%1\n"
       : "=r"(x)
-      : "0"(x), "Ir"(shift), "ir"(1UL<<(shift-1)), "r" (0xff), "r" (0)
+      : "0"(x), "Ic"((unsigned char)shift), "ir"(1UL<<(shift-1)), "r" (0xff), "r" (0)
       );
   return x;
 }

Applied on http://www.linuxtv.org/hg/~tmerle/v4l2-library

Thanks,

Thierry

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list