# Changeset View

Changeset View

# Standalone View

Standalone View

# compiler/cmm/CmmMachOp.hs

Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 48 | data MachOp | |||
---|---|---|---|---|---|

102 | | MO_S_Shr Width -- signed shift right | 102 | | MO_S_Shr Width -- signed shift right | ||

103 | 103 | | |||

104 | -- Conversions. Some of these will be NOPs. | 104 | -- Conversions. Some of these will be NOPs. | ||

105 | -- Floating-point conversions use the signed variant. | 105 | -- Floating-point conversions use the signed variant. | ||

106 | | MO_SF_Conv Width Width -- Signed int -> Float | 106 | | MO_SF_Conv Width Width -- Signed int -> Float | ||

107 | | MO_FS_Conv Width Width -- Float -> Signed int | 107 | | MO_FS_Conv Width Width -- Float -> Signed int | ||

108 | | MO_SS_Conv Width Width -- Signed int -> Signed int | 108 | | MO_SS_Conv Width Width -- Signed int -> Signed int | ||

109 | | MO_UU_Conv Width Width -- unsigned int -> unsigned int | 109 | | MO_UU_Conv Width Width -- unsigned int -> unsigned int | ||

110 | | MO_XX_Conv Width Width -- int -> int; puts no requirements on the | ||||

111 | -- contents of upper bits when extending; | ||||

112 | -- narrowing is simply truncation; the only | ||||

113 | -- expectation is that we can recover the | ||||

114 | -- original value by applying the opposite | ||||

115 | -- MO_XX_Conv, e.g., | ||||

116 | -- MO_XX_CONV W64 W8 (MO_XX_CONV W8 W64 x) | ||||

117 | -- is equivalent to just x. | ||||

110 | | MO_FF_Conv Width Width -- Float -> Float | 118 | | MO_FF_Conv Width Width -- Float -> Float | ||

111 | 119 | | |||

112 | -- Vector element insertion and extraction operations | 120 | -- Vector element insertion and extraction operations | ||

113 | | MO_V_Insert Length Width -- Insert scalar into vector | 121 | | MO_V_Insert Length Width -- Insert scalar into vector | ||

114 | | MO_V_Extract Length Width -- Extract scalar from vector | 122 | | MO_V_Extract Length Width -- Extract scalar from vector | ||

115 | 123 | | |||

116 | -- Integer vector operations | 124 | -- Integer vector operations | ||

117 | | MO_V_Add Length Width | 125 | | MO_V_Add Length Width | ||

▲ Show 20 Lines • Show All 269 Lines • ▼ Show 20 Line(s) | 357 | case mop of | |||

387 | MO_Xor {} -> ty1 | 395 | MO_Xor {} -> ty1 | ||

388 | MO_Not r -> cmmBits r | 396 | MO_Not r -> cmmBits r | ||

389 | MO_Shl r -> cmmBits r | 397 | MO_Shl r -> cmmBits r | ||

390 | MO_U_Shr r -> cmmBits r | 398 | MO_U_Shr r -> cmmBits r | ||

391 | MO_S_Shr r -> cmmBits r | 399 | MO_S_Shr r -> cmmBits r | ||

392 | 400 | | |||

393 | MO_SS_Conv _ to -> cmmBits to | 401 | MO_SS_Conv _ to -> cmmBits to | ||

394 | MO_UU_Conv _ to -> cmmBits to | 402 | MO_UU_Conv _ to -> cmmBits to | ||

403 | MO_XX_Conv _ to -> cmmBits to | ||||

395 | MO_FS_Conv _ to -> cmmBits to | 404 | MO_FS_Conv _ to -> cmmBits to | ||

396 | MO_SF_Conv _ to -> cmmFloat to | 405 | MO_SF_Conv _ to -> cmmFloat to | ||

397 | MO_FF_Conv _ to -> cmmFloat to | 406 | MO_FF_Conv _ to -> cmmFloat to | ||

398 | 407 | | |||

399 | MO_V_Insert l w -> cmmVec l (cmmBits w) | 408 | MO_V_Insert l w -> cmmVec l (cmmBits w) | ||

400 | MO_V_Extract _ w -> cmmBits w | 409 | MO_V_Extract _ w -> cmmBits w | ||

401 | 410 | | |||

402 | MO_V_Add l w -> cmmVec l (cmmBits w) | 411 | MO_V_Add l w -> cmmVec l (cmmBits w) | ||

▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 449 | case op of | |||

478 | MO_Xor r -> [r,r] | 487 | MO_Xor r -> [r,r] | ||

479 | MO_Not r -> [r] | 488 | MO_Not r -> [r] | ||

480 | MO_Shl r -> [r, wordWidth dflags] | 489 | MO_Shl r -> [r, wordWidth dflags] | ||

481 | MO_U_Shr r -> [r, wordWidth dflags] | 490 | MO_U_Shr r -> [r, wordWidth dflags] | ||

482 | MO_S_Shr r -> [r, wordWidth dflags] | 491 | MO_S_Shr r -> [r, wordWidth dflags] | ||

483 | 492 | | |||

484 | MO_SS_Conv from _ -> [from] | 493 | MO_SS_Conv from _ -> [from] | ||

485 | MO_UU_Conv from _ -> [from] | 494 | MO_UU_Conv from _ -> [from] | ||

495 | MO_XX_Conv from _ -> [from] | ||||

486 | MO_SF_Conv from _ -> [from] | 496 | MO_SF_Conv from _ -> [from] | ||

487 | MO_FS_Conv from _ -> [from] | 497 | MO_FS_Conv from _ -> [from] | ||

488 | MO_FF_Conv from _ -> [from] | 498 | MO_FF_Conv from _ -> [from] | ||

489 | 499 | | |||

490 | MO_V_Insert l r -> [typeWidth (vec l (cmmBits r)),r,wordWidth dflags] | 500 | MO_V_Insert l r -> [typeWidth (vec l (cmmBits r)),r,wordWidth dflags] | ||

491 | MO_V_Extract l r -> [typeWidth (vec l (cmmBits r)),wordWidth dflags] | 501 | MO_V_Extract l r -> [typeWidth (vec l (cmmBits r)),wordWidth dflags] | ||

492 | 502 | | |||

493 | MO_V_Add _ r -> [r,r] | 503 | MO_V_Add _ r -> [r,r] | ||

▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |