OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [testsuite/] [gas/] [score/] [addi.s] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 38 julius
/*
2
 * test relax
3
 * addi <-> addei! : for addei : register number must be in 0-15, offset : 4b, only 16b -> 32b
4
 *   (1)addi rD, simm16 : rD = rD + simm16, -32768 <= simm16 <= 32767
5
 *   (2)addei! rD, imm4 : rD = rD + 2**imm4
6
 * addi <-> subei! : for addei : register number must be in 0-15, offset : 4b, only 16b -> 32b
7
 *   (1)addi rD, simm16 : rD = rD + simm16, -32768 <= simm16 <= 32767
8
 *   (2)subei! rD, imm4 : rD = rD + 2**imm4
9
 
10
 * Author: ligang
11
 */
12
 
13
/* This macro transform 16b instruction to 32b. */
14
.macro tran1632 insn32, insn16, sign
15
.align 4
16
 
17
  \insn16 r0, 0                  #16b -> 32b
18
  \insn32 r0, \sign * 1
19
 
20
  \insn16 r15, 4                 #16b -> 32b
21
  \insn32 r15, \sign * 16
22
 
23
  \insn16 r15, 14                #16b -> 32b
24
  \insn32 r15, \sign * 1024 * 16
25
 
26
  \insn16 r8, 3                  #No transform
27
  \insn16 r8, 3                  #No transform
28
 
29
  \insn16 r15, 15                #No transform. Because 2**15 = 32768, extend range of addi
30
  \insn32 r15, 0x7FFF
31
 
32
.endm
33
 
34
.text
35
 
36
  tran1632 "addi.c", "addei!", 1
37
  tran1632 "addi.c", "subei!", -1

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.