File: byteunpack.s

package info (click to toggle)
gdb-doc 16.3-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid, trixie
  • size: 244,264 kB
  • sloc: ansic: 2,134,731; asm: 375,582; exp: 206,875; cpp: 73,639; makefile: 70,232; sh: 26,038; python: 13,697; yacc: 11,341; ada: 7,358; xml: 6,098; perl: 5,077; pascal: 3,389; tcl: 2,986; f90: 2,764; lisp: 1,984; cs: 879; lex: 738; sed: 228; awk: 181; objc: 137; fortran: 57
file content (45 lines) | stat: -rw-r--r-- 1,203 bytes parent folder | download | duplicates (33)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Blackfin testcase for playing with BYTEUNPACK
# mach: bfin

	.include "testutils.inc"

	start

	.macro _bu_pre_test i0:req, src0:req, src1:req
	dmm32 I0, \i0
	imm32 R0, \src0
	imm32 R1, \src1
	.endm
	.macro _bu_chk_test dst0:req, dst1:req
	imm32 R2, \dst0
	imm32 R3, \dst1
	CC = R5 == R2;
	IF !CC jump 1f;
	CC = R6 == R3;
	IF !CC jump 1f;
	.endm
	.macro bu_test i0:req, dst0:req, dst1:req, src0:req, src1:req
	_bu_pre_test \i0, \src0, \src1
	(R6, R5) = BYTEUNPACK R1:0;
	_bu_chk_test \dst0, \dst1
	.endm
	.macro bu_r_test i0:req, dst0:req, dst1:req, src0:req, src1:req
	_bu_pre_test \i0, \src0, \src1
	(R6, R5) = BYTEUNPACK R1:0 (R);
	_bu_chk_test \dst0, \dst1
	.endm

	# Taken from PRM
	bu_test 0, 0x00BA00DD, 0x00BE00EF, 0xBEEFBADD, 0xFEEDFACE
	bu_test 1, 0x00EF00BA, 0x00CE00BE, 0xBEEFBADD, 0xFEEDFACE
	bu_test 2, 0x00BE00EF, 0x00FA00CE, 0xBEEFBADD, 0xFEEDFACE
	bu_test 3, 0x00CE00BE, 0x00ED00FA, 0xBEEFBADD, 0xFEEDFACE

	# Taken from PRM
	bu_r_test 0, 0x00FA00CE, 0x00FE00ED, 0xBEEFBADD, 0xFEEDFACE
	bu_r_test 1, 0x00ED00FA, 0x00DD00FE, 0xBEEFBADD, 0xFEEDFACE
	bu_r_test 2, 0x00FE00ED, 0x00BA00DD, 0xBEEFBADD, 0xFEEDFACE
	bu_r_test 3, 0x00DD00FE, 0x00EF00BA, 0xBEEFBADD, 0xFEEDFACE

	pass
1:	fail