| 1 |
/* PR rtl-optimization/102842 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-fPIC -O2 -fno-omit-frame-pointer -mthumb -march=armv7-a+fp" } */ |
| 4 |
|
| 5 |
struct Plane { |
| 6 |
using T = float; |
| 7 |
T *Row(); |
| 8 |
}; |
| 9 |
using ImageF = Plane; |
| 10 |
long long Mirror_x; |
| 11 |
struct EnsurePaddingInPlaceRowByRow { |
| 12 |
void Process() { |
| 13 |
switch (strategy_) { |
| 14 |
case kSlow: |
| 15 |
float *row = img_.Row(); |
| 16 |
long long xsize = x1_; |
| 17 |
while (Mirror_x >= xsize) |
| 18 |
if (Mirror_x) |
| 19 |
Mirror_x = 2 * xsize - 1; |
| 20 |
*row = Mirror_x; |
| 21 |
} |
| 22 |
} |
| 23 |
ImageF img_; |
| 24 |
unsigned x1_; |
| 25 |
enum { kSlow } strategy_; |
| 26 |
}; |
| 27 |
void FinalizeImageRect() { |
| 28 |
EnsurePaddingInPlaceRowByRow ensure_padding; |
| 29 |
ensure_padding.Process(); |
| 30 |
} |