## root / tests / tcg / xtensa / test_loop.S @ c09015dd

History | View | Annotate | Download (1.1 kB)

1 |
.include "macros.inc" |
---|---|

2 | |

3 |
test_suite loop |

4 | |

5 |
test loop |

6 |
movi a2, 0 |

7 |
movi a3, 5 |

8 |
loop a3, 1f |

9 |
addi a2, a2, 1 |

10 |
1: |

11 |
assert eqi, a2, 5 |

12 |
test_end |

13 | |

14 |
test loop0 |

15 |
movi a2, 0 |

16 |
loop a2, 1f |

17 |
rsr a2, lcount |

18 |
assert eqi, a2, -1 |

19 |
j 1f |

20 |
1: |

21 |
test_end |

22 | |

23 |
test loop_jump |

24 |
movi a2, 0 |

25 |
movi a3, 5 |

26 |
loop a3, 1f |

27 |
addi a2, a2, 1 |

28 |
j 1f |

29 |
1: |

30 |
assert eqi, a2, 1 |

31 |
test_end |

32 | |

33 |
test loop_branch |

34 |
movi a2, 0 |

35 |
movi a3, 5 |

36 |
loop a3, 1f |

37 |
addi a2, a2, 1 |

38 |
beqi a2, 3, 1f |

39 |
1: |

40 |
assert eqi, a2, 3 |

41 |
test_end |

42 | |

43 |
test loop_manual |

44 |
movi a2, 0 |

45 |
movi a3, 5 |

46 |
movi a4, 1f |

47 |
movi a5, 2f |

48 |
wsr a3, lcount |

49 |
wsr a4, lbeg |

50 |
wsr a5, lend |

51 |
isync |

52 |
j 1f |

53 |
.align 4 |

54 |
1: |

55 |
addi a2, a2, 1 |

56 |
2: |

57 |
assert eqi, a2, 6 |

58 |
test_end |

59 | |

60 |
test loop_excm |

61 |
movi a2, 0 |

62 |
movi a3, 5 |

63 |
rsr a4, ps |

64 |
movi a5, 0x10 |

65 |
or a4, a4, a5 |

66 |
wsr a4, ps |

67 |
isync |

68 |
loop a3, 1f |

69 |
addi a2, a2, 1 |

70 |
1: |

71 |
xor a4, a4, a5 |

72 |
isync |

73 |
wsr a4, ps |

74 |
assert eqi, a2, 1 |

75 |
test_end |

76 | |

77 |
test_suite_end |