1/* 2 * Copyright (c) 2014 Travis Geiselbrecht 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining 5 * a copy of this software and associated documentation files 6 * (the "Software"), to deal in the Software without restriction, 7 * including without limitation the rights to use, copy, modify, merge, 8 * publish, distribute, sublicense, and/or sell copies of the Software, 9 * and to permit persons to whom the Software is furnished to do so, 10 * subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be 13 * included in all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 21 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 */ 23#include <asm.h> 24 25#if ARM_WITH_VFP 26 27.fpu neon 28.syntax unified 29 30.macro disable, scratchreg 31 vmrs \scratchreg, fpexc 32 bic \scratchreg, #(1<<30) 33 vmsr fpexc, \scratchreg 34.endm 35 36.macro vfp_instructions 37 disable r12 38 vadd.f32 s0, s0, s0 39 40 disable r12 41 vadd.f64 d0, d0, d0 42 43 disable r12 44 ldr r0, =float_test_scratch 45 vldr s0, [r0] 46.endm 47 48.macro neon_instructions 49 disable r12 50 vadd.f32 q0, q0, q0 51 52 disable r12 53 ldr r0, =float_test_scratch 54 vld1.f32 { q0 }, [r0] 55 56 disable r12 57 vmov s0, r0 58.endm 59 60#if !ARM_ONLY_THUMB 61.arm 62 63FUNCTION(float_vfp_arm_instruction_test) 64 vfp_instructions 65 bx lr 66 67FUNCTION(float_neon_arm_instruction_test) 68 neon_instructions 69 bx lr 70#endif 71 72.thumb 73 74FUNCTION(float_vfp_thumb_instruction_test) 75 vfp_instructions 76 bx lr 77 78FUNCTION(float_neon_thumb_instruction_test) 79 neon_instructions 80 bx lr 81 82.data 83LOCAL_DATA(float_test_scratch) 84 .word 0 85 .word 0 86 87#endif // ARM_WITH_VFP 88