| 1 | /* Test file for AArch64 half-precision floating-point instructions. */ |
| 2 | |
| 3 | .text |
| 4 | fccmp s0, s0, #0, eq |
| 5 | fccmp h0, h0, #0, eq |
| 6 | fccmp s1, s2, #0, le |
| 7 | fccmp h1, h2, #0, le |
| 8 | |
| 9 | fccmpe s0, s0, #0, eq |
| 10 | fccmpe h0, h0, #0, eq |
| 11 | fccmpe s1, s2, #0, le |
| 12 | fccmpe h1, h2, #0, le |
| 13 | |
| 14 | fcmp s0, s0 |
| 15 | fcmp h0, h0 |
| 16 | fcmp s1, s2 |
| 17 | fcmp h1, h2 |
| 18 | |
| 19 | fcmpe s0, s0 |
| 20 | fcmpe h0, h0 |
| 21 | fcmpe s1, s2 |
| 22 | fcmpe h1, h2 |
| 23 | |
| 24 | fcmp s0, #0.0 |
| 25 | fcmp h0, #0.0 |
| 26 | |
| 27 | fcmpe s0, #0.0 |
| 28 | fcmpe h0, #0.0 |
| 29 | |
| 30 | fcsel s0, s0, s1, eq |
| 31 | fcsel h0, h0, h1, eq |
| 32 | |
| 33 | fmov x0, h0 |
| 34 | fmov w0, h0 |
| 35 | fmov h1, x0 |
| 36 | fmov h1, w0 |
| 37 | |
| 38 | /* Scalar data-processing with one source. */ |
| 39 | .macro sdp1src op |
| 40 | \op h0, h1 |
| 41 | \op s0, s1 |
| 42 | \op d0, d1 |
| 43 | .endm |
| 44 | |
| 45 | .text |
| 46 | .irp op, fabs, fneg, fsqrt, frintn, frintp, frintm, frintz |
| 47 | sdp1src \op |
| 48 | .endr |
| 49 | |
| 50 | .irp op, frinta, frintx, frinti |
| 51 | sdp1src \op |
| 52 | .endr |
| 53 | |
| 54 | /* Scalar data-processing with two sources. */ |
| 55 | .macro sdp2src op |
| 56 | \op h0, h1, h2 |
| 57 | \op s0, s1, s2 |
| 58 | \op d0, d1, d2 |
| 59 | .endm |
| 60 | |
| 61 | .text |
| 62 | .irp op, fmul, fdiv, fadd, fsub, fmax, fmin, fmaxnm, fminnm, fnmul |
| 63 | sdp2src \op |
| 64 | .endr |
| 65 | |
| 66 | /* Scalar data-processing with three sources. */ |
| 67 | .macro sdp3src op |
| 68 | \op h0, h1, h2, h3 |
| 69 | \op s0, s1, s2, s3 |
| 70 | \op d0, d1, d2, d3 |
| 71 | .endm |
| 72 | |
| 73 | .text |
| 74 | .irp op, fmadd, fmsub, fnmadd, fnmsub |
| 75 | sdp3src \op |
| 76 | .endr |
| 77 | |
| 78 | /* Scalar conversion. */ |
| 79 | |
| 80 | .macro scvt_fix2fp op |
| 81 | \op s0, w1, #2 |
| 82 | \op s0, x1, #3 |
| 83 | \op h0, w1, #2 |
| 84 | \op h0, x1, #3 |
| 85 | .endm |
| 86 | |
| 87 | .macro scvt_fp2fix op |
| 88 | \op w1, d0, #2 |
| 89 | \op x1, d0, #3 |
| 90 | \op w1, h0, #2 |
| 91 | \op x1, h0, #3 |
| 92 | .endm |
| 93 | |
| 94 | .text |
| 95 | |
| 96 | fmov s0, #1.0 |
| 97 | fmov h0, #1.0 |
| 98 | |
| 99 | .irp op, scvtf, ucvtf |
| 100 | scvt_fix2fp \op |
| 101 | .endr |
| 102 | |
| 103 | .irp op, fcvtzs, fcvtzu |
| 104 | scvt_fp2fix \op |
| 105 | .endr |
| 106 | |
| 107 | .macro scvt_fp2int op |
| 108 | \op w1, s0 |
| 109 | \op x1, d0 |
| 110 | \op w1, h0 |
| 111 | \op x1, h0 |
| 112 | .endm |
| 113 | |
| 114 | .macro scvt_int2fp op |
| 115 | \op s0, w1 |
| 116 | \op d0, x1 |
| 117 | \op h0, w1 |
| 118 | \op h0, x1 |
| 119 | .endm |
| 120 | |
| 121 | .text |
| 122 | .irp op, fcvtns, fcvtnu, fcvtau, fcvtas |
| 123 | scvt_fp2int \op |
| 124 | .endr |
| 125 | |
| 126 | .text |
| 127 | .irp op, fcvtps, fcvtpu, fcvtms, fcvtmu |
| 128 | scvt_fp2int \op |
| 129 | .endr |
| 130 | |
| 131 | .irp op, scvtf, ucvtf |
| 132 | scvt_int2fp \op |
| 133 | .endr |
| 134 | |
| 135 | /* FMOV. */ |
| 136 | |
| 137 | fmov d0, d1 |
| 138 | fmov s0, s1 |
| 139 | fmov h0, h1 |
| 140 | |
| 141 | fmov x0, h1 |
| 142 | fmov w0, h1 |
| 143 | |
| 144 | fmov h1, x0 |
| 145 | fmov h1, w0 |
| 146 | |
| 147 | fmov w0, s1 |
| 148 | fmov x0, d1 |
| 149 | |
| 150 | fmov s1, w0 |
| 151 | fmov d1, x0 |