OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [charset/] [asm3.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for complex asm statements. Make sure it compiles
2
   then test for some of the asm statements not being translated.  */
3
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
4
   { dg-require-iconv "IBM1047" }
5
   { dg-final { scan-assembler "std" } }
6
   { dg-final { scan-assembler "cld" } }
7
   { dg-final { scan-assembler "rep" } }
8
   { dg-final { scan-assembler "movsb" } } */
9
#define size_t int
10
void *
11
memmove (void *__dest, __const void *__src, size_t __n)
12
{
13
  register unsigned long int __d0, __d1, __d2;
14
  if (__dest < __src)
15
    __asm__ __volatile__
16
      ("cld\n\t"
17
       "rep\n\t"
18
       "movsb"
19
       : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
20
       : "0" (__n), "1" (__src), "2" (__dest)
21
       : "memory");
22
  else
23
    __asm__ __volatile__
24
      ("std\n\t"
25
       "rep\n\t"
26
       "movsb\n\t"
27
       "cld"
28
       : "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
29
       : "0" (__n), "1" (__n - 1 + (const char *) __src),
30
         "2" (__n - 1 + (char *) __dest)
31
       : "memory");
32
  return __dest;
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.