URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 321 |
Rev 338 |
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-O -meb isa_rev>=2 -mgp64" } */
|
/* { dg-options "-O -meb isa_rev>=2 -mgp64" } */
|
/* { dg-final { scan-assembler-times "\tins\t|\tdins\t" 1 } } */
|
/* { dg-final { scan-assembler-times "\tins\t|\tdins\t" 1 } } */
|
/* { dg-final { scan-assembler-times "\tsll\t|\tins\t" 1 } } */
|
/* { dg-final { scan-assembler-times "\tsll\t|\tins\t" 1 } } */
|
|
|
/* When inserting something into the top bit of a 32-bit structure,
|
/* When inserting something into the top bit of a 32-bit structure,
|
we must make sure that the register remains properly sign-extended.
|
we must make sure that the register remains properly sign-extended.
|
There are two ways of doing this:
|
There are two ways of doing this:
|
|
|
- use purely 32-bit bit manipulations (a single INS, matched twice here).
|
- use purely 32-bit bit manipulations (a single INS, matched twice here).
|
- use a 64-bit bit manipulation (DINS), and sign-extend the result. We
|
- use a 64-bit bit manipulation (DINS), and sign-extend the result. We
|
check for this extension using SLL. */
|
check for this extension using SLL. */
|
|
|
struct s
|
struct s
|
{
|
{
|
int a:3;
|
int a:3;
|
int b:29;
|
int b:29;
|
};
|
};
|
|
|
NOMIPS16 void
|
NOMIPS16 void
|
f (int a)
|
f (int a)
|
{
|
{
|
struct s s;
|
struct s s;
|
asm volatile ("" : "=r"(s));
|
asm volatile ("" : "=r"(s));
|
s.a = a;
|
s.a = a;
|
asm volatile ("" :: "r"(s));
|
asm volatile ("" :: "r"(s));
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.