Ticket #1645 (new RFC)

Opened 4 years ago

Last modified 2 years ago

Request for another overload to 'not' opcode.

Reported by: shockwave Owned by:
Priority: normal Milestone:
Component: none Version: 2.3.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

The docs page:  http://docs.parrot.org/parrot/latest/html/src/ops/cmp.ops.html

...mentions 2 overloads for opcode 'not':

not(out INT, in INT)
not(out PMC, invar PMC)

It would be sweet to have another overload for opcode 'not'.

not(out INT, invar PMC)

This would avoid the need for boxing of the operands in many cases.

Change History

Changed 4 years ago by plobsing

It is not that easy. The "logical_not" vtable, around which not_p_p is based, returns a PMC. So the vtable, not the op, is doing the boxing.

To avoid a box operation, we'd need to add a new vtable and a new op. We're trying to cut down on bloat of both op and vtable sets, so -1 to this course of action.

A case could be made that logical_not should return an intval (or maybe even be removed in favour of using get_bool).

Changed 3 years ago by bacek

Hello.

+1 to remove "logical_not" vtable and implement "op not" in terms of .get_bool.

-- Bacek

Changed 2 years ago by bacek

Hello.

cotto, can we have some resolution on this?

-- Bacek

Note: See TracTickets for help on using tickets.