1 # RUN: llvm-mc -triple=hexagon -filetype=obj -o - %s | llvm-objdump -d - | FileCheck %s 2 # Hexagon Programmer's Reference Manual 11.10.4 XTYPE/FP 3 4 # Floating point addition 5 # CHECK: 11 df 15 eb 6 r17 = sfadd(r21, r31) 7 8 # Classify floating-point value 9 # CHECK: 03 d5 f1 85 10 p3 = sfclass(r17, #21) 11 # CHECK: b3 c2 90 dc 12 p3 = dfclass(r17:16, #21) 13 14 # Compare floating-point value 15 # CHECK: 03 d5 f1 c7 16 p3 = sfcmp.ge(r17, r21) 17 # CHECK: 23 d5 f1 c7 18 p3 = sfcmp.uo(r17, r21) 19 # CHECK: 63 d5 f1 c7 20 p3 = sfcmp.eq(r17, r21) 21 # CHECK: 83 d5 f1 c7 22 p3 = sfcmp.gt(r17, r21) 23 # CHECK: 03 d4 f0 d2 24 p3 = dfcmp.eq(r17:16, r21:20) 25 # CHECK: 23 d4 f0 d2 26 p3 = dfcmp.gt(r17:16, r21:20) 27 # CHECK: 43 d4 f0 d2 28 p3 = dfcmp.ge(r17:16, r21:20) 29 # CHECK: 63 d4 f0 d2 30 p3 = dfcmp.uo(r17:16, r21:20) 31 32 # Convert floating-point value to other format 33 # CHECK: 10 c0 95 84 34 r17:16 = convert_sf2df(r21) 35 # CHECK: 31 c0 14 88 36 r17 = convert_df2sf(r21:20) 37 38 # Convert integer to floating-point value 39 # CHECK: 50 c0 f4 80 40 r17:16 = convert_ud2df(r21:20) 41 # CHECK: 70 c0 f4 80 42 r17:16 = convert_d2df(r21:20) 43 # CHECK: 30 c0 95 84 44 r17:16 = convert_uw2df(r21) 45 # CHECK: 50 c0 95 84 46 r17:16 = convert_w2df(r21) 47 # CHECK: 31 c0 34 88 48 r17 = convert_ud2sf(r21:20) 49 # CHECK: 31 c0 54 88 50 r17 = convert_d2sf(r21:20) 51 # CHECK: 11 c0 35 8b 52 r17 = convert_uw2sf(r21) 53 # CHECK: 11 c0 55 8b 54 r17 = convert_w2sf(r21) 55 56 # Convert floating-point value to integer 57 # CHECK: 10 c0 f4 80 58 r17:16 = convert_df2d(r21:20) 59 # CHECK: 30 c0 f4 80 60 r17:16 = convert_df2ud(r21:20) 61 # CHECK: d0 c0 f4 80 62 r17:16 = convert_df2d(r21:20):chop 63 # CHECK: f0 c0 f4 80 64 r17:16 = convert_df2ud(r21:20):chop 65 # CHECK: 70 c0 95 84 66 r17:16 = convert_sf2ud(r21) 67 # CHECK: 90 c0 95 84 68 r17:16 = convert_sf2d(r21) 69 # CHECK: b0 c0 95 84 70 r17:16 = convert_sf2ud(r21):chop 71 # CHECK: d0 c0 95 84 72 r17:16 = convert_sf2d(r21):chop 73 # CHECK: 31 c0 74 88 74 r17 = convert_df2uw(r21:20) 75 # CHECK: 31 c0 94 88 76 r17 = convert_df2w(r21:20) 77 # CHECK: 31 c0 b4 88 78 r17 = convert_df2uw(r21:20):chop 79 # CHECK: 31 c0 f4 88 80 r17 = convert_df2w(r21:20):chop 81 # CHECK: 11 c0 75 8b 82 r17 = convert_sf2uw(r21) 83 # CHECK: 31 c0 75 8b 84 r17 = convert_sf2uw(r21):chop 85 # CHECK: 11 c0 95 8b 86 r17 = convert_sf2w(r21) 87 # CHECK: 31 c0 95 8b 88 r17 = convert_sf2w(r21):chop 89 90 # Floating point extreme value assistance 91 # CHECK: 11 c0 b5 8b 92 r17 = sffixupr(r21) 93 # CHECK: 11 df d5 eb 94 r17 = sffixupn(r21, r31) 95 # CHECK: 31 df d5 eb 96 r17 = sffixupd(r21, r31) 97 98 # Floating point fused multiply-add 99 # CHECK: 91 df 15 ef 100 r17 += sfmpy(r21, r31) 101 # CHECK: b1 df 15 ef 102 r17 -= sfmpy(r21, r31) 103 104 # Floating point fused multiply-add with scaling 105 # CHECK: f1 df 75 ef 106 r17 += sfmpy(r21, r31, p3):scale 107 108 # Floating point reciprocal square root approximation 109 # CHECK: 71 c0 f5 8b 110 r17, p3 = sfinvsqrta(r21) 111 112 # Floating point fused multiply-add for library routines 113 # CHECK: d1 df 15 ef 114 r17 += sfmpy(r21, r31):lib 115 # CHECK: f1 df 15 ef 116 r17 -= sfmpy(r21, r31):lib 117 118 # Create floating-point constant 119 # CHECK: b1 c2 00 d6 120 r17 = sfmake(#21):pos 121 # CHECK: b1 c2 40 d6 122 r17 = sfmake(#21):neg 123 # CHECK: b0 c2 00 d9 124 r17:16 = dfmake(#21):pos 125 # CHECK: b0 c2 40 d9 126 r17:16 = dfmake(#21):neg 127 128 # Floating point maximum 129 # CHECK: 11 df 95 eb 130 r17 = sfmax(r21, r31) 131 132 # Floating point minimum 133 # CHECK: 31 df 95 eb 134 r17 = sfmin(r21, r31) 135 136 # Floating point multiply 137 # CHECK: 11 df 55 eb 138 r17 = sfmpy(r21, r31) 139 140 # Floating point reciprocal approximation 141 # CHECK: f1 df f5 eb 142 r17, p3 = sfrecipa(r21, r31) 143 144 # Floating point subtraction 145 # CHECK: 31 df 15 eb 146 r17 = sfsub(r21, r31) 147