可以将1种形式的氖寄存器转换成另一种形式

时间:2012-07-11 06:02:12

标签: arm cpu-registers neon

我正在使用arm neon代码开发SIMD架构。 现在的问题是,在我的函数的一次传递中,我使用了霓虹灯中的所有寄存器,因此我在编译时遇到了跟踪错误。

nw2.c: In function 'bit_24':
nw2.c:123: error: unable to find a register to spill in class 'GENERAL_REGS'
nw2.c:123: error: this is the insn:
(insn 33 32 34 5 c:\cs\codesourcery\sourcery_g++_lite\bin\../lib/gcc/arm-none-ea
bi/4.3.3/include/arm_neon.h:9246 (parallel [
            (set (reg:CI 178 [ D.19511 ])
                (unspec:CI [
                       (mem:CI (reg/f:SI 177 [ __a.165 ]) [0 S48 A64])
                        (reg:CI 178 [ D.19511 ])
                        (unspec:V16QI [
                                (const_int 0 [0x0])
                            ] 191)
                    ] 106))
            (set (reg/f:SI 177 [ __a.165 ])
                (plus:SI (reg/f:SI 177 [ __a.165 ])
                    (const_int 24 [0x18])))
       ]) 1593 {neon_vld3qav16qi} (nil))
 nw2.c:123: confused by earlier errors, bailing out

既然我想最小化寄存器,我想知道如果它最初被声明为8x16,是否可以使用寄存器为16x8。

请帮帮我

1 个答案:

答案 0 :(得分:0)

您绝对可以按照自己的方式使用寄存器。

如果编写汇编程序,只需对新类型应用加载/进程/存储操作。

如果你写内在函数,那实际上就是这样。只是重复使用,但要确保它只是时间,它只能以一种方式使用。

您还可以转换“看到”注册表的方式。一个经典的技巧是在一个寄存器中加载4个字符 - 没有用于4个字符的VLD指令 - 但是你可以在NEON寄存器中将一个int加载到4-int reg(4字节)的一个通道中,然后将其转换。

仅使用内在函数进行转换才有意义,但在ASM中,您只需应用对已加载的数据有意义的操作。