1# Test ASTAT bits with logical right shift (>>=) 2# mach: bfin 3 4.include "testutils.inc" 5#include "test.h" 6start 7 8.macro __do val:req, shift:req, exp:req 9 # First test when ASTAT starts with all bits cleared 10 imm32 R2, \val; 11 ASTAT = R0; 12 R2 >>= \shift; 13 R3 = ASTAT; 14 CHECKREG R2, (\val >> \shift); 15 CHECKREG R3, \exp; 16 17 # Then test when ASTAT starts with all bits set 18 imm32 R2, \val; 19 ASTAT = R1; 20 R2 >>= \shift; 21 R3 = ASTAT; 22 CHECKREG R3, (\exp) | ~(_AZ|_AN|_V|_V_COPY); 23.endm 24 25.macro _do shift:req, val:req 26 # Automatically test all shifted values 27 .if ((\val >> \shift) & 0xffffffff) == 0 28 __do \val, \shift, _AZ 29 .else 30 .if (\val >> \shift) == 0x80000000 31 __do \val, \shift, _AN 32 .else 33 __do \val, \shift, 0 34 .endif 35 .endif 36 .if (\val >> 1) & 0xffffffff 37 _do \shift, (\val >> 1) 38 .endif 39.endm 40 41.macro do shift:req 42_l_shft_\shift: 43 _do \shift, 0x80000000 44.endm 45 46R0 = 0; 47R1 = -1; 48 49do 0 50do 1 51do 2 52do 3 53do 4 54do 5 55do 6 56do 7 57do 8 58do 9 59do 10 60do 11 61do 12 62do 13 63do 14 64do 15 65do 16 66do 17 67do 18 68do 19 69do 20 70do 21 71do 22 72do 23 73do 24 74do 25 75do 26 76do 27 77do 28 78do 29 79do 30 80do 31 81 82pass 83